{"id":5598,"date":"2015-09-23T15:39:56","date_gmt":"2015-09-23T13:39:56","guid":{"rendered":"https:\/\/www.dbi-services.com\/blog\/sql-server-alwayson-readable-secondary-replicas-and-index-rebuild-online-vs-offline\/"},"modified":"2015-09-23T15:39:56","modified_gmt":"2015-09-23T13:39:56","slug":"sql-server-alwayson-readable-secondary-replicas-and-index-rebuild-online-vs-offline","status":"publish","type":"post","link":"https:\/\/www.dbi-services.com\/blog\/sql-server-alwayson-readable-secondary-replicas-and-index-rebuild-online-vs-offline\/","title":{"rendered":"SQL Server AlwaysOn : readable secondary replicas and index rebuild online vs offline"},"content":{"rendered":"<p>A couple of weeks ago, I was involved in a discussion on the French forum <a href=\"http:\/\/www.developpez.net\/forums\/f49\/bases-donnees\/ms-sql-server\/\" target=\"_blank\" rel=\"noopener noreferrer\">developpez.com<\/a> about SQL Server AlwaysOn and availability groups, index strategies and the impact on the readable secondary replicas. During this discussion, one of the forum member stated that rebuilding an index online had less impact than rebuilding an index offline on a readable secondary replica but I disagree with this affirmative. Is it really true? Let\u2019s verify in this blog post.<\/p>\n<p>First of all, let\u2019s talk quickly about readable secondary replicas. Each engaged secondary replica has a dedicated redo thread which is responsible to apply the log records that come from the primary replica to the secondary replica (regardless the synchronization type). However, we can be in a situation where this thread can be blocked and it can leave the secondary replicas far behind (with an effective impact on the RTO defined for the concerned databases \/ applications). One of the common situation you may face is the following: a long running query on a readable secondary replica and at the same time a rebuild index operation is in progress followed by other DML commands on the primary replica.<\/p>\n<p>In fact, rebuilding an index generates a DDL operation (ALTER INDEX \u2026 REBUILD) that must be propagated and applied by the redo thread on each secondary replica. This operation needs to take a Sch-M lock that can block the redo thread while the reporting query is running.<\/p>\n<p>So, let\u2019s begin on the primary replica \u2026 What is the difference between rebuilding an index offline and online? Well, the latter is very interesting to reduce the overall lock contention. Indeed, with exception of short-time shared (S) at the beginning and schema-modification (Sch-M) locks at the end of the execution, there are no full table locks held. Other users can access the table, <span style=\"text-decoration: line-through\">and<\/span> read, and modify data from there. The former needs to acquire schema modification (Sch-M) lock for the duration of the execution, which blocks entire access to the table even in read uncommitted transaction isolation level.<\/p>\n<p><a href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/blog-63-1-locks-offline-vs-online.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-3969\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/blog-63-1-locks-offline-vs-online.jpg\" alt=\"blog 63- 1 - locks offline vs online\" width=\"300\" height=\"175\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>But wait&#8230; The above explanation is only valid on the primary replica. What about the secondary replicas? In fact, the story is not the same because the Sch-M lock must be applied by the redo thread which can be blocked while a long reporting query is running as said above. In this case, the blocking point is shifted from the offline \/ online feature to the total duration of the reporting query itself on each concerned secondary as shown below:<\/p>\n<p><a href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/blog-63-2-locks-and-redo-thread.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-3970\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/blog-63-2-locks-and-redo-thread.jpg\" alt=\"blog 63- 2 - locks and redo thread\" width=\"300\" height=\"181\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>In both cases (rebuild index offline and online), we will be blocked on the secondary until the long running query is finished. Furthermore, generally speaking, rebuilding an index offline is quicker than performing the same operation online especially if there is an important concurrent DML activity at the same period. This is why on the above schema you will see the offline index mark before the online index mark in the timeline.<\/p>\n<p>Let me illustrate this point on my lab environment that consists of a pretty basic configuration:<\/p>\n<p><a href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/blog-63-3-hadr-configuration.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3972\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/blog-63-3-hadr-configuration.jpg\" alt=\"blog 63- 3 - hadr configuration\" width=\"962\" height=\"60\" \/><\/a><\/p>\n<p>I will use for my tests the famous <em>bigTransactionHistory<\/em> table in the <em>AdventureWorks<\/em> database.<\/p>\n<p>On the primary replica I will rebuild the following index offline or online to compare each scenario:<\/p>\n<ul>\n<li>The index definition:<\/li>\n<\/ul>\n<pre class=\"brush: sql; gutter: true; first-line: 1\">CREATE NONCLUSTERED INDEX IX_ProductId_TransactionDate\nON bigTransactionHistory\n(\n\tProductId,\n\tTransactionDate\n)\nINCLUDE \n(\n\tQuantity,\n\tActualCost\n)\nGO<\/pre>\n<ul>\n<li>The index rebuild statement<\/li>\n<\/ul>\n<pre class=\"brush: sql; gutter: true; first-line: 1\">alter index IX_ProductId_TransactionDate\non bigTransactionHistory\nrebuild -- with (online = on)<\/pre>\n<p>&nbsp;<\/p>\n<p>Finally, on my readable secondary replica, I will use the following query to simulate my reporting activity:<\/p>\n<pre class=\"brush: sql; gutter: true; first-line: 1\">dbcc dropcleanbuffers;\ngo\n\nselect \n\tProductID,\n\tsum(cast(Quantity as bigint))\nfrom dbo.bigTransactionHistory\ncross join (select number from master..spt_values where type = 'P') as t\ncross join (select number from master..spt_values where type = 'P') as t2\ncross join (select number from master..spt_values where type = 'P') as t3\ncross join (select number from master..spt_values where type = 'P') as t4\ncross join (select number from master..spt_values where type = 'P') as t5\ngroup by ProductID\noption (maxdop 1)\ngo<\/pre>\n<p>&nbsp;<\/p>\n<p>On both scenarios, I noticed that the total duration of the blocking state of the redo thread is tightly relied to the total duration of the reporting query execution. We can notice by taking a look at the information provided by <em>sys.dm_exec_requests <\/em>DMV on the secondary replica the state of the redo thread during the execution of my reporting query on my readable secondary replica:<\/p>\n<pre class=\"brush: sql; gutter: true; first-line: 1\">select \n\tsession_id, \n\tcommand, \n\tblocking_session_id, \n\twait_time, \n\twait_type, \n\twait_resource, \n\ttotal_elapsed_time\nfrom sys.dm_exec_requests \nwhere command = 'DB STARTUP'\n or session_id = 56<\/pre>\n<p>&nbsp;<\/p>\n<p><a href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/blog-63-4-redo-thread-blocked-info.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3973\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/blog-63-4-redo-thread-blocked-info.jpg\" alt=\"blog 63- 4 - redo thread blocked info\" width=\"696\" height=\"58\" \/><\/a><\/p>\n<p>Session_id = 49 is related to the redo thread and the session_id = 56 to my reporting query. You can notice the related wait type here: LCK_M_SCH_M issued by the ALTER INDEX REBUILD command on the primary replica in a waiting state.<\/p>\n<p>We can also get additional information by taking a look at the redo queue value with the <em>sys.dm_hadr_availability_replica_states<\/em> DMV.<\/p>\n<pre class=\"brush: sql; gutter: true; first-line: 1\">SELECT \n\tag.name AS ag_name, \n\tar.replica_server_name AS ag_replica_server, \n\tdr_state.database_id as database_id, \n\tCASE \n\t\tWHEN ar_state.is_local = 1 THEN N'LOCAL' \n\t\tELSE 'REMOTE' \n\tEND AS is_ag_replica_local, \n\tCASE \n\t\tWHEN ar_state.role_desc IS NULL THEN N'DISCONNECTED' \n\t\tELSE ar_state.role_desc \n\tEND AS ag_replica_role, \n\tar_state.connected_state_desc, \n\tar.availability_mode_desc, \n\tdr_state.synchronization_state_desc,\n\tdr_state.redo_queue_size,\n\tdr_state.redo_rate\nFROM sys.availability_groups AS ag \nJOIN sys.availability_replicas AS ar  \n\tON ag.group_id = ar.group_id  \nJOIN sys.dm_hadr_availability_replica_states AS ar_state \n\tON ar.replica_id = ar_state.replica_id \nJOIN sys.dm_hadr_database_replica_states dr_state \n\ton ag.group_id = dr_state.group_id \n\t\tand dr_state.replica_id = ar_state.replica_id;<\/pre>\n<p>&nbsp;<\/p>\n<p><a href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/blog-63-5-redo-queue.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3974\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/blog-63-5-redo-queue.jpg\" alt=\"blog 63- 5 - redo queue\" width=\"1114\" height=\"57\" \/><\/a><\/p>\n<p>The redo queue size suggests also that there is a problem with the redo thread. Then, when I performed some additional updates on the <em>dbo.bigTransactionHistory<\/em> table the redo queue increased accordingly to my update activity. Finally, once my reporting query finished, the redo thread was unlocked and was able to continue to apply the remaining log records in the redo queue. After a\u00a0few seconds, the redo queue size dropped quickly to zero as shown below:<\/p>\n<p><a href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/blog-63-6-redo-queue-2.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3975\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/blog-63-6-redo-queue-2.jpg\" alt=\"blog 63- 6 - redo queue 2\" width=\"1113\" height=\"57\" \/><\/a><\/p>\n<p>In conclusion, we\u2019ve seen that performing index rebuild operations with either online or offline options can effectively have a different impact depending on where the action is performed (primary or secondary replica). However we have to keep in mind that on the secondary replicas, the use of the both options\u00a0doesn&#8217;t matter and has the same effect on the redo thread. Instead, the queries from the read only activity become our main concern in this case.<\/p>\n<p>Hope this helps!<\/p>\n<p>By David Barbarin<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A couple of weeks ago, I was involved in a discussion on the French forum developpez.com about SQL Server AlwaysOn and availability groups, index strategies and the impact on the readable secondary replicas. During this discussion, one of the forum member stated that rebuilding an index online had less impact than rebuilding an index offline [&hellip;]<\/p>\n","protected":false},"author":26,"featured_media":5605,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[229],"tags":[466,297,84,531,51],"type_dbi":[],"class_list":["post-5598","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-database-administration-monitoring","tag-alwayson","tag-availability-groups","tag-high-availability","tag-index-rebuild-online","tag-sql-server"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.2 (Yoast SEO v27.2) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>SQL Server AlwaysOn : readable secondary replicas and index rebuild online vs offline<\/title>\n<meta name=\"description\" content=\"SQL Server AlwaysOn : readable secondary replicas and index rebuild online vs offline\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.dbi-services.com\/blog\/sql-server-alwayson-readable-secondary-replicas-and-index-rebuild-online-vs-offline\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"SQL Server AlwaysOn : readable secondary replicas and index rebuild online vs offline\" \/>\n<meta property=\"og:description\" content=\"SQL Server AlwaysOn : readable secondary replicas and index rebuild online vs offline\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.dbi-services.com\/blog\/sql-server-alwayson-readable-secondary-replicas-and-index-rebuild-online-vs-offline\/\" \/>\n<meta property=\"og:site_name\" content=\"dbi Blog\" \/>\n<meta property=\"article:published_time\" content=\"2015-09-23T13:39:56+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/blog-63-1-locks-offline-vs-online-1.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"811\" \/>\n\t<meta property=\"og:image:height\" content=\"472\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Microsoft Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Microsoft Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/sql-server-alwayson-readable-secondary-replicas-and-index-rebuild-online-vs-offline\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/sql-server-alwayson-readable-secondary-replicas-and-index-rebuild-online-vs-offline\/\"},\"author\":{\"name\":\"Microsoft Team\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/bfab48333280d616e1170e7369df90a4\"},\"headline\":\"SQL Server AlwaysOn : readable secondary replicas and index rebuild online vs offline\",\"datePublished\":\"2015-09-23T13:39:56+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/sql-server-alwayson-readable-secondary-replicas-and-index-rebuild-online-vs-offline\/\"},\"wordCount\":879,\"commentCount\":0,\"image\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/sql-server-alwayson-readable-secondary-replicas-and-index-rebuild-online-vs-offline\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/blog-63-1-locks-offline-vs-online-1.jpg\",\"keywords\":[\"AlwaysOn\",\"Availability groups\",\"High availability\",\"index rebuild online\",\"SQL Server\"],\"articleSection\":[\"Database Administration &amp; Monitoring\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.dbi-services.com\/blog\/sql-server-alwayson-readable-secondary-replicas-and-index-rebuild-online-vs-offline\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/sql-server-alwayson-readable-secondary-replicas-and-index-rebuild-online-vs-offline\/\",\"url\":\"https:\/\/www.dbi-services.com\/blog\/sql-server-alwayson-readable-secondary-replicas-and-index-rebuild-online-vs-offline\/\",\"name\":\"SQL Server AlwaysOn : readable secondary replicas and index rebuild online vs offline\",\"isPartOf\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/sql-server-alwayson-readable-secondary-replicas-and-index-rebuild-online-vs-offline\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/sql-server-alwayson-readable-secondary-replicas-and-index-rebuild-online-vs-offline\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/blog-63-1-locks-offline-vs-online-1.jpg\",\"datePublished\":\"2015-09-23T13:39:56+00:00\",\"author\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/bfab48333280d616e1170e7369df90a4\"},\"description\":\"SQL Server AlwaysOn : readable secondary replicas and index rebuild online vs offline\",\"breadcrumb\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/sql-server-alwayson-readable-secondary-replicas-and-index-rebuild-online-vs-offline\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.dbi-services.com\/blog\/sql-server-alwayson-readable-secondary-replicas-and-index-rebuild-online-vs-offline\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/sql-server-alwayson-readable-secondary-replicas-and-index-rebuild-online-vs-offline\/#primaryimage\",\"url\":\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/blog-63-1-locks-offline-vs-online-1.jpg\",\"contentUrl\":\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/blog-63-1-locks-offline-vs-online-1.jpg\",\"width\":811,\"height\":472},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/sql-server-alwayson-readable-secondary-replicas-and-index-rebuild-online-vs-offline\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Accueil\",\"item\":\"https:\/\/www.dbi-services.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"SQL Server AlwaysOn : readable secondary replicas and index rebuild online vs offline\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#website\",\"url\":\"https:\/\/www.dbi-services.com\/blog\/\",\"name\":\"dbi Blog\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.dbi-services.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/bfab48333280d616e1170e7369df90a4\",\"name\":\"Microsoft Team\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/secure.gravatar.com\/avatar\/c44a1a792c059f24055763aa77d80a244467f6eef724a8bd13db8d4a350b7a4c?s=96&d=mm&r=g\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/c44a1a792c059f24055763aa77d80a244467f6eef724a8bd13db8d4a350b7a4c?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/c44a1a792c059f24055763aa77d80a244467f6eef724a8bd13db8d4a350b7a4c?s=96&d=mm&r=g\",\"caption\":\"Microsoft Team\"},\"url\":\"https:\/\/www.dbi-services.com\/blog\/author\/microsoft-team\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"SQL Server AlwaysOn : readable secondary replicas and index rebuild online vs offline","description":"SQL Server AlwaysOn : readable secondary replicas and index rebuild online vs offline","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.dbi-services.com\/blog\/sql-server-alwayson-readable-secondary-replicas-and-index-rebuild-online-vs-offline\/","og_locale":"en_US","og_type":"article","og_title":"SQL Server AlwaysOn : readable secondary replicas and index rebuild online vs offline","og_description":"SQL Server AlwaysOn : readable secondary replicas and index rebuild online vs offline","og_url":"https:\/\/www.dbi-services.com\/blog\/sql-server-alwayson-readable-secondary-replicas-and-index-rebuild-online-vs-offline\/","og_site_name":"dbi Blog","article_published_time":"2015-09-23T13:39:56+00:00","og_image":[{"width":811,"height":472,"url":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/blog-63-1-locks-offline-vs-online-1.jpg","type":"image\/jpeg"}],"author":"Microsoft Team","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Microsoft Team","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.dbi-services.com\/blog\/sql-server-alwayson-readable-secondary-replicas-and-index-rebuild-online-vs-offline\/#article","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/sql-server-alwayson-readable-secondary-replicas-and-index-rebuild-online-vs-offline\/"},"author":{"name":"Microsoft Team","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/bfab48333280d616e1170e7369df90a4"},"headline":"SQL Server AlwaysOn : readable secondary replicas and index rebuild online vs offline","datePublished":"2015-09-23T13:39:56+00:00","mainEntityOfPage":{"@id":"https:\/\/www.dbi-services.com\/blog\/sql-server-alwayson-readable-secondary-replicas-and-index-rebuild-online-vs-offline\/"},"wordCount":879,"commentCount":0,"image":{"@id":"https:\/\/www.dbi-services.com\/blog\/sql-server-alwayson-readable-secondary-replicas-and-index-rebuild-online-vs-offline\/#primaryimage"},"thumbnailUrl":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/blog-63-1-locks-offline-vs-online-1.jpg","keywords":["AlwaysOn","Availability groups","High availability","index rebuild online","SQL Server"],"articleSection":["Database Administration &amp; Monitoring"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.dbi-services.com\/blog\/sql-server-alwayson-readable-secondary-replicas-and-index-rebuild-online-vs-offline\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.dbi-services.com\/blog\/sql-server-alwayson-readable-secondary-replicas-and-index-rebuild-online-vs-offline\/","url":"https:\/\/www.dbi-services.com\/blog\/sql-server-alwayson-readable-secondary-replicas-and-index-rebuild-online-vs-offline\/","name":"SQL Server AlwaysOn : readable secondary replicas and index rebuild online vs offline","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.dbi-services.com\/blog\/sql-server-alwayson-readable-secondary-replicas-and-index-rebuild-online-vs-offline\/#primaryimage"},"image":{"@id":"https:\/\/www.dbi-services.com\/blog\/sql-server-alwayson-readable-secondary-replicas-and-index-rebuild-online-vs-offline\/#primaryimage"},"thumbnailUrl":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/blog-63-1-locks-offline-vs-online-1.jpg","datePublished":"2015-09-23T13:39:56+00:00","author":{"@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/bfab48333280d616e1170e7369df90a4"},"description":"SQL Server AlwaysOn : readable secondary replicas and index rebuild online vs offline","breadcrumb":{"@id":"https:\/\/www.dbi-services.com\/blog\/sql-server-alwayson-readable-secondary-replicas-and-index-rebuild-online-vs-offline\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.dbi-services.com\/blog\/sql-server-alwayson-readable-secondary-replicas-and-index-rebuild-online-vs-offline\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.dbi-services.com\/blog\/sql-server-alwayson-readable-secondary-replicas-and-index-rebuild-online-vs-offline\/#primaryimage","url":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/blog-63-1-locks-offline-vs-online-1.jpg","contentUrl":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/blog-63-1-locks-offline-vs-online-1.jpg","width":811,"height":472},{"@type":"BreadcrumbList","@id":"https:\/\/www.dbi-services.com\/blog\/sql-server-alwayson-readable-secondary-replicas-and-index-rebuild-online-vs-offline\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Accueil","item":"https:\/\/www.dbi-services.com\/blog\/"},{"@type":"ListItem","position":2,"name":"SQL Server AlwaysOn : readable secondary replicas and index rebuild online vs offline"}]},{"@type":"WebSite","@id":"https:\/\/www.dbi-services.com\/blog\/#website","url":"https:\/\/www.dbi-services.com\/blog\/","name":"dbi Blog","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.dbi-services.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/bfab48333280d616e1170e7369df90a4","name":"Microsoft Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/c44a1a792c059f24055763aa77d80a244467f6eef724a8bd13db8d4a350b7a4c?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/c44a1a792c059f24055763aa77d80a244467f6eef724a8bd13db8d4a350b7a4c?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/c44a1a792c059f24055763aa77d80a244467f6eef724a8bd13db8d4a350b7a4c?s=96&d=mm&r=g","caption":"Microsoft Team"},"url":"https:\/\/www.dbi-services.com\/blog\/author\/microsoft-team\/"}]}},"_links":{"self":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/5598","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/users\/26"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/comments?post=5598"}],"version-history":[{"count":0,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/5598\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/media\/5605"}],"wp:attachment":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/media?parent=5598"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/categories?post=5598"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/tags?post=5598"},{"taxonomy":"type","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/type_dbi?post=5598"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}