{"id":4302,"date":"2015-01-30T07:37:00","date_gmt":"2015-01-30T06:37:00","guid":{"rendered":"https:\/\/www.dbi-services.com\/blog\/sql-server-online-index-rebuild-and-minimally-logged-operations\/"},"modified":"2015-01-30T07:37:00","modified_gmt":"2015-01-30T06:37:00","slug":"sql-server-online-index-rebuild-and-minimally-logged-operations","status":"publish","type":"post","link":"https:\/\/www.dbi-services.com\/blog\/sql-server-online-index-rebuild-and-minimally-logged-operations\/","title":{"rendered":"SQL Server: Online index rebuild &amp; minimally logged operations"},"content":{"rendered":"<p>A couple of days ago, I encountered an interesting case with a customer concerning a rebuild index operation on a datawarehouse environment. Let me introduce the situation: a \u201cusual DBA day\u201d with an almost usual error message found in your dedicated mailbox: \u201cThe transaction log for database &#8216;xxx&#8217; is full\u201d. After checking the concerned database, I notice that its transaction log has grown up and has fulfilled the entire volume. In the same time, I also identify the root cause of our problem: an index rebuild operation performed last night that concerns a big index (approximately 20 GB in size) on a fact table. On top of all, the size of the transaction log before raising the error message was 60 GB.<\/p>\n<p>As you know, on datawarehouse environment, the database recovery model is usually configured either to SIMPLE or BULK_LOGGED to minimize write operations of bulk activity and of course the concerned database meets this requirement. According to the <a href=\"https:\/\/technet.microsoft.com\/en-us\/library\/ms191484(v=sql.105).aspx\">Microsoft document<\/a> we could expect to get minimally logged records for index rebuild operations (ALTER INEX REBUILD) regardless the offline \/ online mode used to rebuild the index. So why the transaction log has grown heavily in this case?<\/p>\n<p>To get a response we have first to take a look at the rebuild index tool used by my customer: the <a href=\"https:\/\/ola.hallengren.com\/\">OLA<\/a> script with <strong>INDEX_REBUILD_ONLINE,INDEX_REBUILD_OFFLINE<\/strong> values for FragmentationHigh parameter. Don&#8217;t worry OLA scripts work perfectly and the truth is out there \ud83d\ude42 In the context of my customer, rebuild indexes online was permitted because the edition of the concerned SQL Server instance was Enterprise and this is precisely where we have to investigate here.<\/p>\n<p>Let me demonstrate with a pretty simple example. On my lab environment I have a SQL Server 2014 instance with Enterprise edition. This instance hosts the well-known AdventureWorks2012 database with a dbo.bigTransactionHistory_rs1 table (this table is derived from the original <a href=\"http:\/\/sqlblog.com\/blogs\/adam_machanic\/archive\/2011\/10\/17\/thinking-big-adventure.aspx\">script<\/a> provided by Adam Machanic).<\/p>\n<p>Here the current size of the <strong>AdventureWorks2012<\/strong> database:<\/p>\n<div style=\"margin-bottom: 0.0001pt;line-height: normal;background: none repeat scroll 0% 0% #d9d9d9\"><span style=\"font-size: 9.5pt;font-family: Consolas;color: blue\">select<\/span><\/div>\n<div style=\"margin-bottom: 0.0001pt;line-height: normal;background: none repeat scroll 0% 0% #d9d9d9\"><span style=\"font-size: 9.5pt;font-family: Consolas\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 name <span style=\"color: blue\">as logical_name<span style=\"color: gray\">,<\/span><\/span><\/span><\/div>\n<div style=\"margin-bottom: 0.0001pt;line-height: normal;background: none repeat scroll 0% 0% #d9d9d9\"><span style=\"font-size: 9.5pt;font-family: Consolas\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 physical_name<span style=\"color: gray\">,<\/span><\/span><\/div>\n<div style=\"margin-bottom: 0.0001pt;line-height: normal;background: none repeat scroll 0% 0% #d9d9d9\"><span style=\"font-size: 9.5pt;font-family: Consolas\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 size <span style=\"color: gray\">\/ 128 <span style=\"color: blue\">as size_mb<span style=\"color: gray\">,<\/span><\/span><\/span><\/span><\/div>\n<div style=\"margin-bottom: 0.0001pt;line-height: normal;background: none repeat scroll 0% 0% #d9d9d9\"><span style=\"font-size: 9.5pt;font-family: Consolas\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 type_desc<span style=\"color: gray\">,<\/span><\/span><\/div>\n<div style=\"margin-bottom: 0.0001pt;line-height: normal;background: none repeat scroll 0% 0% #d9d9d9\"><span style=\"font-size: 9.5pt;font-family: Consolas\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <span style=\"color: fuchsia\">cast<span style=\"color: gray\">(<span style=\"color: fuchsia\">FILEPROPERTY<span style=\"color: gray\">(name<span style=\"color: gray\">, <span style=\"color: red\">&#8216;SpaceUsed&#8217;<span style=\"color: gray\">) <span style=\"color: gray\">* 100. <span style=\"color: gray\">\/ size <span style=\"color: blue\">as <span style=\"color: blue\">decimal<span style=\"color: gray\">(5<span style=\"color: gray\">, 2<span style=\"color: gray\">)) <span style=\"color: blue\">as [space_used_%]<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/div>\n<div style=\"margin-bottom: 0.0001pt;line-height: normal;background: none repeat scroll 0% 0% #d9d9d9\"><span style=\"font-size: 9.5pt;font-family: Consolas;color: blue\">from<span style=\"font-size: 9.5pt;font-family: Consolas\"> <span style=\"color: green\">sys<span style=\"color: gray\">.<span style=\"color: green\">database_files<\/span><\/span><\/span><\/span><\/span><\/div>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/blog_28_1_database_situation.jpg\" alt=\"blog_28_1_database_situation\" width=\"622\" height=\"47\" \/><\/p>\n<p>and here the size of the<strong> dbo.bigTransactionHistory_rs1<\/strong> table:<\/p>\n<div style=\"margin-bottom: 0.0001pt;line-height: normal;background: none repeat scroll 0% 0% #d9d9d9\"><span style=\"font-size: 9.5pt;font-family: Consolas;color: blue\">exec<span style=\"font-size: 9.5pt;font-family: Consolas\"> <span style=\"color: maroon\">sp_spaceused@objname <span style=\"color: gray\">= <span style=\"color: red\">N&#8217;dbo.bigTransactionHistory_rs1&#8242;<span style=\"color: gray\">;<\/span><\/span><\/span><\/span><\/span><\/span><\/div>\n<div style=\"margin-bottom: 0.0001pt;line-height: normal;background: none repeat scroll 0% 0% #d9d9d9\"><span style=\"font-size: 9.5pt;font-family: Consolas;color: blue\">go<\/span><\/div>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/blog_28_2_bigTransactionHistory_rs1_situation.jpg\" alt=\"blog_28_2_bigTransactionHistory_rs1_situation\" width=\"483\" height=\"44\" \/><\/p>\n<p>Total used size: <strong>1.1 GB<\/strong><\/p>\n<p>Because we are in SIMPLE recovery model, I will momentary disable the checkpoint process in order to have time to get log records inside the transaction log by using the traceflag 3505<\/p>\n<p style=\"margin-bottom: 0.0001pt;line-height: normal;background: none repeat scroll 0% 0% #d9d9d9\"><span style=\"font-size: 9.5pt;font-family: Consolas;color: blue\">dbcc<span style=\"font-size: 9.5pt;font-family: Consolas\"> traceon<span style=\"color: gray\">(3505<span style=\"color: gray\">, <span style=\"color: gray\">-1<span style=\"color: gray\">);<\/span><\/span><\/span><\/span><\/span><\/span><\/p>\n<p>&nbsp;<\/p>\n<h5>Case 1: ALTER REBUID INDEX OFFLINE<\/h5>\n<div style=\"margin-bottom: 0.0001pt;line-height: normal;background: none repeat scroll 0% 0% #d9d9d9\"><span style=\"font-size: 9.5pt;font-family: Consolas;color: blue\">alter<span style=\"font-size: 9.5pt;font-family: Consolas\"> <span style=\"color: blue\">index pk_bigTransactionHistory<\/span><\/span><\/span><\/div>\n<div style=\"margin-bottom: 0.0001pt;line-height: normal;background: none repeat scroll 0% 0% #d9d9d9\"><span style=\"font-size: 9.5pt;font-family: Consolas;color: blue\">on<span style=\"font-size: 9.5pt;font-family: Consolas\"> dbo<span style=\"color: gray\">.bigTransactionHistory_rs1 <span style=\"color: blue\">rebuild<\/span><\/span><\/span><\/span><\/div>\n<div style=\"margin-bottom: 0.0001pt;line-height: normal;background: none repeat scroll 0% 0% #d9d9d9\"><span style=\"font-size: 9.5pt;font-family: Consolas;color: blue\">with <span style=\"font-size: 9.5pt;font-family: Consolas;color: gray\">(<span style=\"font-size: 9.5pt;font-family: Consolas;color: blue\">online<span style=\"font-size: 9.5pt;font-family: Consolas\"> <span style=\"color: gray\">= <span style=\"color: blue\">off<span style=\"color: gray\">, <span style=\"color: blue\">maxdop <span style=\"color: gray\">= 1<span style=\"color: gray\">);<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/div>\n<div style=\"margin-bottom: 0.0001pt;line-height: normal;background: none repeat scroll 0% 0% #d9d9d9\"><span style=\"font-size: 9.5pt;font-family: Consolas;color: blue\">go<\/span><\/div>\n<p>Let&#8217;s check the size of transaction log of the AdventureWorks2012 database<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/blog_28_3_database_situation_after_rebuild_offline.jpg\" alt=\"blog_28_3_database_situation_after_rebuild_offline\" width=\"618\" height=\"51\" \/><\/p>\n<h5>Case 2: ALTER REBUID INDEX ONLINE<\/h5>\n<div style=\"margin-bottom: 0.0001pt;line-height: normal;background: none repeat scroll 0% 0% #d9d9d9\"><span style=\"font-size: 9.5pt;font-family: Consolas;color: green\">&#8212; to initiate a tlog truncation before rebuilding the same index online<\/span><\/div>\n<div style=\"margin-bottom: 0.0001pt;line-height: normal;background: none repeat scroll 0% 0% #d9d9d9\"><span style=\"font-size: 9.5pt;font-family: Consolas;color: blue\">Checkpoint;<\/span><\/div>\n<div style=\"margin-bottom: 0.0001pt;line-height: normal;background: none repeat scroll 0% 0% #d9d9d9\"><span style=\"font-size: 9.5pt;font-family: Consolas;color: blue\">\u00a0<\/span><\/div>\n<div style=\"margin-bottom: 0.0001pt;line-height: normal;background: none repeat scroll 0% 0% #d9d9d9\"><span style=\"font-size: 9.5pt;font-family: Consolas;color: blue\">alter<span style=\"font-size: 9.5pt;font-family: Consolas\"> <span style=\"color: blue\">index pk_bigTransactionHistory<\/span><\/span><\/span><\/div>\n<div style=\"margin-bottom: 0.0001pt;line-height: normal;background: none repeat scroll 0% 0% #d9d9d9\"><span style=\"font-size: 9.5pt;font-family: Consolas;color: blue\">on<span style=\"font-size: 9.5pt;font-family: Consolas\"> dbo<span style=\"color: gray\">.bigTransactionHistory_rs1 <span style=\"color: blue\">rebuild<\/span><\/span><\/span><\/span><\/div>\n<div style=\"margin-bottom: 0.0001pt;line-height: normal;background: none repeat scroll 0% 0% #d9d9d9\"><span style=\"font-size: 9.5pt;font-family: Consolas;color: blue\">with <span style=\"font-size: 9.5pt;font-family: Consolas;color: gray\">(<span style=\"font-size: 9.5pt;font-family: Consolas;color: blue\">online<span style=\"font-size: 9.5pt;font-family: Consolas\"> <span style=\"color: gray\">= <span style=\"color: blue\">off<span style=\"color: gray\">, <span style=\"color: blue\">maxdop <span style=\"color: gray\">= 1<span style=\"color: gray\">);<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/div>\n<div style=\"margin-bottom: 0.0001pt;line-height: normal;background: none repeat scroll 0% 0% #d9d9d9\"><span style=\"font-size: 9.5pt;font-family: Consolas;color: blue\">go<\/span><\/div>\n<p>Let&#8217;s check again the size of the transaction log of the AdventureWorks2012 database:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/blog_28_3_database_situation_after_rebuild_online.jpg\" alt=\"blog_28_3_database_situation_after_rebuild_online\" width=\"619\" height=\"50\" \/><\/p>\n<p>It is clear that we have an obvious difference of size concerning the transaction log for each operation.<\/p>\n<div>&#8211; offline: 4096 * 0.35% = <strong>14MB<\/strong><\/div>\n<div>&#8211; online: 4096 * 5.63% = <strong>230MB.<\/strong><\/div>\n<p>Stay curious and let&#8217;s have a look deeper at the records written inside the transaction log for each mode by using the undocumented function sys.fn_dblog() as follows:<\/p>\n<div style=\"margin-bottom: 0.0001pt;line-height: normal;background: none repeat scroll 0% 0% #d9d9d9\"><span style=\"font-size: 9.5pt;font-family: Consolas;color: blue\">select<\/span><\/div>\n<div style=\"margin-bottom: 0.0001pt;line-height: normal;background: none repeat scroll 0% 0% #d9d9d9\"><span style=\"font-size: 9.5pt;font-family: Consolas\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <span style=\"color: fuchsia\">COUNT<span style=\"color: gray\">(*) <span style=\"color: blue\">as nb_records<span style=\"color: gray\">,<\/span><\/span><\/span><\/span><\/span><\/div>\n<div style=\"margin-bottom: 0.0001pt;line-height: normal;background: none repeat scroll 0% 0% #d9d9d9\"><span style=\"font-size: 9.5pt;font-family: Consolas\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <span style=\"color: fuchsia\">SUM<span style=\"color: gray\">([Log Record Length]<span style=\"color: gray\">)\/ 1024 <span style=\"color: blue\">as kbytes<\/span><\/span><\/span><\/span><\/span><\/div>\n<div style=\"margin-bottom: 0.0001pt;line-height: normal;background: none repeat scroll 0% 0% #d9d9d9\"><span style=\"font-size: 9.5pt;font-family: Consolas;color: blue\">from<span style=\"font-size: 9.5pt;font-family: Consolas\"> <span style=\"color: green\">sys<span style=\"color: gray\">.<span style=\"color: green\">fn_dblog<span style=\"color: gray\">(NULL, <span style=\"color: gray\">NULL);<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/div>\n<div style=\"margin-bottom: 0.0001pt;line-height: normal;background: none repeat scroll 0% 0% #d9d9d9\"><span style=\"font-size: 9.5pt;font-family: Consolas;color: blue\">go<\/span><\/div>\n<p>&nbsp;<\/p>\n<table border=\"0\">\n<tbody>\n<tr>\n<td style=\"text-align: center\"><strong>Offline<\/strong><\/td>\n<td style=\"text-align: center\"><strong>Online<\/strong><\/td>\n<\/tr>\n<tr>\n<td>\u00a0<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/blog_28_4_tlog_detail_offline_mode.jpg\" alt=\"blog_28_4_tlog_detail_offline_mode\" width=\"160\" height=\"48\" \/><\/td>\n<td>\u00a0<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/blog_28_4_tlog_detail_online_mode.jpg\" alt=\"blog_28_4_tlog_detail_online_mode\" width=\"160\" height=\"47\" \/><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>As expected we may notice a lot of records with index rebuild online operation comparing to the index rebuild offline operation (x21)<br \/>\nLet&#8217;s continue looking at the operations performed by SQL Server during the index rebuild operation in both cases:<\/p>\n<div style=\"margin-bottom: 0.0001pt;line-height: normal;background: none repeat scroll 0% 0% #d9d9d9\"><span style=\"font-size: 9.5pt;font-family: Consolas;color: blue\">select<\/span><\/div>\n<div style=\"margin-bottom: 0.0001pt;line-height: normal;background: none repeat scroll 0% 0% #d9d9d9\"><span style=\"font-size: 9.5pt;font-family: Consolas\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Operation<span style=\"color: gray\">,<\/span><\/span><\/div>\n<div style=\"margin-bottom: 0.0001pt;line-height: normal;background: none repeat scroll 0% 0% #d9d9d9\"><span style=\"font-size: 9.5pt;font-family: Consolas\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <span style=\"color: fuchsia\">COUNT<span style=\"color: gray\">(*) <span style=\"color: blue\">as nb_records<span style=\"color: gray\">,<\/span><\/span><\/span><\/span><\/span><\/div>\n<div style=\"margin-bottom: 0.0001pt;line-height: normal;background: none repeat scroll 0% 0% #d9d9d9\"><span style=\"font-size: 9.5pt;font-family: Consolas\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <span style=\"color: fuchsia\">SUM<span style=\"color: gray\">([Log Record Length]<span style=\"color: gray\">)\/ 1024 <span style=\"color: blue\">as kbytes<\/span><\/span><\/span><\/span><\/span><\/div>\n<div style=\"margin-bottom: 0.0001pt;line-height: normal;background: none repeat scroll 0% 0% #d9d9d9\"><span style=\"font-size: 9.5pt;font-family: Consolas;color: blue\">from<span style=\"font-size: 9.5pt;font-family: Consolas\"> <span style=\"color: green\">sys<span style=\"color: gray\">.<span style=\"color: green\">fn_dblog<span style=\"color: gray\">(NULL, <span style=\"color: gray\">NULL)<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/div>\n<div style=\"margin-bottom: 0.0001pt;line-height: normal;background: none repeat scroll 0% 0% #d9d9d9\"><span style=\"font-size: 9.5pt;font-family: Consolas;color: blue\">group<span style=\"font-size: 9.5pt;font-family: Consolas\"> <span style=\"color: blue\">by Operation<\/span><\/span><\/span><\/div>\n<div style=\"margin-bottom: 0.0001pt;line-height: normal;background: none repeat scroll 0% 0% #d9d9d9\"><span style=\"font-size: 9.5pt;font-family: Consolas;color: blue\">order<span style=\"font-size: 9.5pt;font-family: Consolas\"> <span style=\"color: blue\">by kbytes <span style=\"color: blue\">desc<\/span><\/span><\/span><\/span><\/div>\n<div style=\"margin-bottom: 0.0001pt;line-height: normal;background: none repeat scroll 0% 0% #d9d9d9\"><span style=\"font-size: 9.5pt;font-family: Consolas;color: blue\">go<\/span><\/div>\n<p>&nbsp;<\/p>\n<table border=\"0\">\n<tbody>\n<tr>\n<td style=\"text-align: center\"><strong>Offline<\/strong><\/td>\n<td style=\"text-align: center\"><strong>Online<\/strong><\/td>\n<\/tr>\n<tr>\n<td><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/blog_28_5_tlog_detail_offline_mode_2.jpg\" alt=\"blog_28_5_tlog_detail_offline_mode_2\" width=\"259\" height=\"288\" \/><\/td>\n<td><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/blog_28_5_tlog_detail_online_mode_2.jpg\" alt=\"blog_28_5_tlog_detail_online_mode_2\" width=\"282\" height=\"413\" \/><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p>The above picture is very interesting because we may again see an obvious difference between each mode. For example, if we consider the operations performed in the second case (on the right, some of them doesn&#8217;t concern bulk activity as LOP_MIGRATE_LOCKS, LOP_DELETE_ROWS, LOP_DELETE_SPLITS, LOP_MODIFY_COLUMS an unknown allocation unit, which probably concerns the new structure. At this point I can&#8217;t confirm it (I don&#8217;t show here all details o these operations. I let you see by yourself). Furthermore, in the first case (on the left), the majority of operations concerns only LOP_MODIFY_OPERATION on the PFS page (context).<\/p>\n<p>Does it mean that the online mode doesn&#8217;t use minimaly mechanism for the whole rebuild process? I retrieved an interesting response from this <a href=\"http:\/\/support.microsoft.com\/kb\/2407439\">Microsoft KB<\/a> which confirms my suspicion.<\/p>\n<p><strong> Online Index Rebuild is a fully logged operation on SQL Server 2008 and later versions, whereas it is minimally-logged in SQL Server 2005. The change was made to ensure data integrity and more robust restore capabilities. <\/strong><\/p>\n<p>However I guess we don&#8217;t have the same behavior than the FULL recovery model here. Indeed, there still exists a difference between SIMPLE \/ BULK_LOGGED and FULL recovery models in term of amount of log records generated. Here a picture of the transaction log size after rebuilding the big index online in full recovery model in my case:<\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/blog_28_3_database_situation_after_rebuild_online_full_recovery.jpg\" alt=\"blog_28_3_database_situation_after_rebuild_online_full_recovery\" width=\"630\" height=\"51\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>Ouch! <strong>230MB<\/strong> (SIMPLE \/ BULK-LOGGED) vs <strong>7GB<\/strong>\u00a0 (FULL). It is clear that using FULL recovery model with rebuild index online operations will have a huge impact on the transaction log compared to the SIMPLE \/ BULK-LOGGED recovery model. So the solution in my case consisted in switching to offline mode or at least reducing the online operation for the concerned index.<\/p>\n<p>Happy maintenance!<\/p>\n<p><span style=\"float: none;background-color: #ffffff;color: #333333;cursor: text;font-family: Georgia,'Times New Roman','Bitstream Charter',Times,serif;font-size: 16px;font-style: normal;font-variant: normal;font-weight: 400;letter-spacing: normal;text-align: left;text-decoration: none;text-indent: 0px;text-transform: none\">By David Barbarin<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>A couple of days ago, I encountered an interesting case with a customer concerning a rebuild index operation on a datawarehouse environment. Let me introduce the situation: a \u201cusual DBA day\u201d with an almost usual error message found in your dedicated mailbox: \u201cThe transaction log for database &#8216;xxx&#8217; is full\u201d. After checking the concerned database, [&hellip;]<\/p>\n","protected":false},"author":26,"featured_media":4303,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[197],"tags":[530,531,532,51,533],"type_dbi":[],"class_list":["post-4302","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-application-integration-middleware","tag-bulk-logged","tag-index-rebuild-online","tag-recovery-model","tag-sql-server","tag-transaction-log"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.2 (Yoast SEO v27.4) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>SQL Server: Online index rebuild &amp; minimally logged operations - dbi Blog<\/title>\n<meta name=\"description\" content=\"Online index rebuild and minimally logged operations with Microsoft SQL Server.\" \/>\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-online-index-rebuild-and-minimally-logged-operations\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"SQL Server: Online index rebuild &amp; minimally logged operations\" \/>\n<meta property=\"og:description\" content=\"Online index rebuild and minimally logged operations with Microsoft SQL Server.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.dbi-services.com\/blog\/sql-server-online-index-rebuild-and-minimally-logged-operations\/\" \/>\n<meta property=\"og:site_name\" content=\"dbi Blog\" \/>\n<meta property=\"article:published_time\" content=\"2015-01-30T06:37:00+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/blog_28_1_database_situation.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"733\" \/>\n\t<meta property=\"og:image:height\" content=\"56\" \/>\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=\"5 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-online-index-rebuild-and-minimally-logged-operations\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/sql-server-online-index-rebuild-and-minimally-logged-operations\\\/\"},\"author\":{\"name\":\"Microsoft Team\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#\\\/schema\\\/person\\\/bfab48333280d616e1170e7369df90a4\"},\"headline\":\"SQL Server: Online index rebuild &amp; minimally logged operations\",\"datePublished\":\"2015-01-30T06:37:00+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/sql-server-online-index-rebuild-and-minimally-logged-operations\\\/\"},\"wordCount\":947,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/sql-server-online-index-rebuild-and-minimally-logged-operations\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2022\\\/04\\\/blog_28_1_database_situation.jpg\",\"keywords\":[\"bulk-logged\",\"index rebuild online\",\"recovery model\",\"SQL Server\",\"transaction log\"],\"articleSection\":[\"Application integration &amp; Middleware\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/sql-server-online-index-rebuild-and-minimally-logged-operations\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/sql-server-online-index-rebuild-and-minimally-logged-operations\\\/\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/sql-server-online-index-rebuild-and-minimally-logged-operations\\\/\",\"name\":\"SQL Server: Online index rebuild &amp; minimally logged operations - dbi Blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/sql-server-online-index-rebuild-and-minimally-logged-operations\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/sql-server-online-index-rebuild-and-minimally-logged-operations\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2022\\\/04\\\/blog_28_1_database_situation.jpg\",\"datePublished\":\"2015-01-30T06:37:00+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#\\\/schema\\\/person\\\/bfab48333280d616e1170e7369df90a4\"},\"description\":\"Online index rebuild and minimally logged operations with Microsoft SQL Server.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/sql-server-online-index-rebuild-and-minimally-logged-operations\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/sql-server-online-index-rebuild-and-minimally-logged-operations\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/sql-server-online-index-rebuild-and-minimally-logged-operations\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2022\\\/04\\\/blog_28_1_database_situation.jpg\",\"contentUrl\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2022\\\/04\\\/blog_28_1_database_situation.jpg\",\"width\":733,\"height\":56},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/sql-server-online-index-rebuild-and-minimally-logged-operations\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Accueil\",\"item\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"SQL Server: Online index rebuild &amp; minimally logged operations\"}]},{\"@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: Online index rebuild &amp; minimally logged operations - dbi Blog","description":"Online index rebuild and minimally logged operations with Microsoft SQL Server.","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-online-index-rebuild-and-minimally-logged-operations\/","og_locale":"en_US","og_type":"article","og_title":"SQL Server: Online index rebuild &amp; minimally logged operations","og_description":"Online index rebuild and minimally logged operations with Microsoft SQL Server.","og_url":"https:\/\/www.dbi-services.com\/blog\/sql-server-online-index-rebuild-and-minimally-logged-operations\/","og_site_name":"dbi Blog","article_published_time":"2015-01-30T06:37:00+00:00","og_image":[{"width":733,"height":56,"url":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/blog_28_1_database_situation.jpg","type":"image\/jpeg"}],"author":"Microsoft Team","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Microsoft Team","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.dbi-services.com\/blog\/sql-server-online-index-rebuild-and-minimally-logged-operations\/#article","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/sql-server-online-index-rebuild-and-minimally-logged-operations\/"},"author":{"name":"Microsoft Team","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/bfab48333280d616e1170e7369df90a4"},"headline":"SQL Server: Online index rebuild &amp; minimally logged operations","datePublished":"2015-01-30T06:37:00+00:00","mainEntityOfPage":{"@id":"https:\/\/www.dbi-services.com\/blog\/sql-server-online-index-rebuild-and-minimally-logged-operations\/"},"wordCount":947,"commentCount":0,"image":{"@id":"https:\/\/www.dbi-services.com\/blog\/sql-server-online-index-rebuild-and-minimally-logged-operations\/#primaryimage"},"thumbnailUrl":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/blog_28_1_database_situation.jpg","keywords":["bulk-logged","index rebuild online","recovery model","SQL Server","transaction log"],"articleSection":["Application integration &amp; Middleware"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.dbi-services.com\/blog\/sql-server-online-index-rebuild-and-minimally-logged-operations\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.dbi-services.com\/blog\/sql-server-online-index-rebuild-and-minimally-logged-operations\/","url":"https:\/\/www.dbi-services.com\/blog\/sql-server-online-index-rebuild-and-minimally-logged-operations\/","name":"SQL Server: Online index rebuild &amp; minimally logged operations - dbi Blog","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.dbi-services.com\/blog\/sql-server-online-index-rebuild-and-minimally-logged-operations\/#primaryimage"},"image":{"@id":"https:\/\/www.dbi-services.com\/blog\/sql-server-online-index-rebuild-and-minimally-logged-operations\/#primaryimage"},"thumbnailUrl":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/blog_28_1_database_situation.jpg","datePublished":"2015-01-30T06:37:00+00:00","author":{"@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/bfab48333280d616e1170e7369df90a4"},"description":"Online index rebuild and minimally logged operations with Microsoft SQL Server.","breadcrumb":{"@id":"https:\/\/www.dbi-services.com\/blog\/sql-server-online-index-rebuild-and-minimally-logged-operations\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.dbi-services.com\/blog\/sql-server-online-index-rebuild-and-minimally-logged-operations\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.dbi-services.com\/blog\/sql-server-online-index-rebuild-and-minimally-logged-operations\/#primaryimage","url":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/blog_28_1_database_situation.jpg","contentUrl":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/blog_28_1_database_situation.jpg","width":733,"height":56},{"@type":"BreadcrumbList","@id":"https:\/\/www.dbi-services.com\/blog\/sql-server-online-index-rebuild-and-minimally-logged-operations\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Accueil","item":"https:\/\/www.dbi-services.com\/blog\/"},{"@type":"ListItem","position":2,"name":"SQL Server: Online index rebuild &amp; minimally logged operations"}]},{"@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\/4302","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=4302"}],"version-history":[{"count":0,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/4302\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/media\/4303"}],"wp:attachment":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/media?parent=4302"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/categories?post=4302"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/tags?post=4302"},{"taxonomy":"type","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/type_dbi?post=4302"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}