<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Edwin M SarmientoHow To Identify Potential Data Loss When DBCC CHECKDB Reports Corruption &#8211; The Simple Way &#8211; Edwin M Sarmiento</title>
	<atom:link href="https://www.edwinmsarmiento.com/how-to-identify-potential-data-loss-when-dbcc-checkdb-reports-corruption/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.edwinmsarmiento.com</link>
	<description>Intentional Excellence</description>
	<lastBuildDate>Mon, 13 Apr 2026 21:00:49 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
<site xmlns="com-wordpress:feed-additions:1">84283043</site>		<item>
		<title>How To Identify Potential Data Loss When DBCC CHECKDB Reports Corruption &#8211; The Simple Way</title>
		<link>https://www.edwinmsarmiento.com/how-to-identify-potential-data-loss-when-dbcc-checkdb-reports-corruption/</link>
		<comments>https://www.edwinmsarmiento.com/how-to-identify-potential-data-loss-when-dbcc-checkdb-reports-corruption/#respond</comments>
		<pubDate>Sun, 08 Mar 2015 03:25:29 +0000</pubDate>
		<dc:creator>Edwin M Sarmiento</dc:creator>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[database corruption]]></category>
		<category><![CDATA[database recovery]]></category>
		<category><![CDATA[DBCC CHECKDB]]></category>
		<guid isPermaLink="false">http://www.edwinmsarmiento.com/?p=1252</guid>

				<description><![CDATA[A few days ago, one of my customers reached out to me on Yahoo Messenger (yes, it still exists) and asked how to identify what the potential data loss is when DBCC CHECKDB reports corruption of a SQL Server database. My common response is the usual &#8220;it depends&#8221; in that there are cases when DBCC CHECKDB may recommend using [&#8230;]]]></description>
					<content:encoded><![CDATA[<img width="760" height="195" src="https://www.edwinmsarmiento.com/wp-content/uploads/2015/03/CHECKDB_Output_1-760x195.jpg" class="featured-image wp-post-image" alt="" srcset="https://www.edwinmsarmiento.com/wp-content/uploads/2015/03/CHECKDB_Output_1-760x195.jpg 760w, https://www.edwinmsarmiento.com/wp-content/uploads/2015/03/CHECKDB_Output_1-300x77.jpg 300w, https://www.edwinmsarmiento.com/wp-content/uploads/2015/03/CHECKDB_Output_1-1024x262.jpg 1024w, https://www.edwinmsarmiento.com/wp-content/uploads/2015/03/CHECKDB_Output_1-518x133.jpg 518w, https://www.edwinmsarmiento.com/wp-content/uploads/2015/03/CHECKDB_Output_1-82x21.jpg 82w, https://www.edwinmsarmiento.com/wp-content/uploads/2015/03/CHECKDB_Output_1-600x154.jpg 600w, https://www.edwinmsarmiento.com/wp-content/uploads/2015/03/CHECKDB_Output_1.jpg 1432w" sizes="(max-width: 760px) 100vw, 760px" /><p>A few days ago, one of my customers reached out to me on Yahoo Messenger (yes, it still exists) and asked how to identify what the potential data loss is when <a href="https://msdn.microsoft.com/en-us/library/ms176064.aspx" target="_blank">DBCC CHECKDB</a> reports corruption of a SQL Server database. My common response is the usual &#8220;<em>it depends</em>&#8221; in that there are cases when DBCC CHECKDB may recommend using the option REPAIR_ALLOW_DATA_LOSS. And while you may be fine with doing so, it may not be supported. An example of this is a SharePoint database where <a href="http://support.microsoft.com/kb/841057" target="_blank">Microsoft KB 841057</a> specifically mentions that using this option renders the database in an unsupported configuration. But say you have decided to proceed, how do you know what data potentially gets lost? This blog post walks you thru the process of identifying potential data loss when DBCC CHECKDB reports corruption in your SQL Server database.</p>
<ol>
<ol>
<li><strong>Thoroughly read the output from DBCC CHECKDB</strong>. DBCC CHECKDB gives you a ton of information to get you started. Kudos to the SQL Server team for providing such level of detail on the output of DBCC CHECKDB. When reading the output, note the following information</li>
<li><strong>Identify the object affected</strong>. This is a sample output of a corrupted database that I am playing around with. It&#8217;s one of the simplest example I can come up with to demonstrate how we can use the output of DBCC CHECKDB to identify the affected object. Note that DBCC CHECKDB did not recommend using the REPAIR_ALLOW_DATA_LOSS option for this case. We can look into that in future blog posts.<img fetchpriority="high" decoding="async" class="alignnone size-full wp-image-1263" src="https://www.edwinmsarmiento.com/wp-content/uploads/2015/03/CHECKDB_Output_1.jpg" alt="CHECKDB_Output_1" width="1432" height="367" srcset="https://www.edwinmsarmiento.com/wp-content/uploads/2015/03/CHECKDB_Output_1.jpg 1432w, https://www.edwinmsarmiento.com/wp-content/uploads/2015/03/CHECKDB_Output_1-300x77.jpg 300w, https://www.edwinmsarmiento.com/wp-content/uploads/2015/03/CHECKDB_Output_1-1024x262.jpg 1024w, https://www.edwinmsarmiento.com/wp-content/uploads/2015/03/CHECKDB_Output_1-760x195.jpg 760w, https://www.edwinmsarmiento.com/wp-content/uploads/2015/03/CHECKDB_Output_1-518x133.jpg 518w, https://www.edwinmsarmiento.com/wp-content/uploads/2015/03/CHECKDB_Output_1-82x21.jpg 82w, https://www.edwinmsarmiento.com/wp-content/uploads/2015/03/CHECKDB_Output_1-600x154.jpg 600w" sizes="(max-width: 1432px) 100vw, 1432px" />DBCC CHECKDB tells me that the affected object has an Object ID value of <strong>245575913</strong>. I can use this information to find out the affected object.<img decoding="async" class="alignnone size-full wp-image-1266" src="https://www.edwinmsarmiento.com/wp-content/uploads/2015/03/Query_Output_1.jpg" alt="Query_Output_1" width="1637" height="257" srcset="https://www.edwinmsarmiento.com/wp-content/uploads/2015/03/Query_Output_1.jpg 1637w, https://www.edwinmsarmiento.com/wp-content/uploads/2015/03/Query_Output_1-300x47.jpg 300w, https://www.edwinmsarmiento.com/wp-content/uploads/2015/03/Query_Output_1-1024x161.jpg 1024w, https://www.edwinmsarmiento.com/wp-content/uploads/2015/03/Query_Output_1-760x119.jpg 760w, https://www.edwinmsarmiento.com/wp-content/uploads/2015/03/Query_Output_1-518x81.jpg 518w, https://www.edwinmsarmiento.com/wp-content/uploads/2015/03/Query_Output_1-82x13.jpg 82w, https://www.edwinmsarmiento.com/wp-content/uploads/2015/03/Query_Output_1-600x94.jpg 600w" sizes="(max-width: 1637px) 100vw, 1637px" />From the result of the query, I know that my <strong>Sales</strong> table is affected by the corruption.</li>
<li><strong>Identify the affected page</strong>. Now that I know the affected object, I can decide whether or not the data is critical. As a data professional, I would consider <strong>ALL</strong> data as critical and would treat them the same. Of course, in reality, the business dictates whether or not data can be considered critical. Given the name of the table, let&#8217;s assume that this is considered critical data and would want to minimize data loss as much as we can. From the output of DBCC CHECKDB, we can see that the page <strong>246</strong> could not be processed &#8211; this is the corrupted page. It also tells me that page <strong>291</strong> (which is an index page) points to page <strong>246</strong> (the corrupted page) and that page <strong>316</strong> is missing a reference from the previous page (page 246.) It&#8217;s very helpful that everything we need to know about the corruption is available from the DBCC CHECKDB output. There is also something to note about the type of page that got corrupted. From the output, we know that it is an index page of type <strong>2</strong>.
<p style="text-align: center;"><span style="color: #ff0000;"><em>Table error: Object ID 245575913, <strong>index ID 2</strong>, partition ID 72057594040680448, alloc unit ID 72057594045923328 (type In-row data), page (1:246).</em></span></p>
<p>Referring to<strong><a href="https://msdn.microsoft.com/en-us/library/ms173760.aspx" target="_blank"> sys.indexes</a></strong>, we know that index ID value of type 2 means that the corrupted page is a non-clustered index. Since non-clustered indexes have structures that are separate from the data rows, we can safely say that we may not have any potential data loss at all.</li>
<li><strong>Decide how to resolve the corruption</strong>. Since we&#8217;ve already identified that the corrupted page is from a non-clustered index, we can opt not to restore form backup nor run repair using REPAIR_ALLOW_DATA_LOSS but simply <em><strong>disable</strong><strong> and rebuild the index</strong></em>. Depending on how large the index is and the impact it has on the system, you can decide to either do it during or after production hours. Would it make sense to restore your database from the latest backup? Since we already know what the corrupted page is and what the potential data loss (in this case, no data loss at all,) restoring from backup wouldn&#8217;t make sense at all. Disabling and rebuilding the index is way better than taking your entire database offline just to fix a corrupted non-clustered index. Of course, if the output of DBCC CHECKDB told us something else &#8211; for example, an index ID value of type 1 which pertains to a clustered index &#8211; our decision on how to resolve the corruption would be a lot different than the example provided. And, as Paul Randal (<a href="https://twitter.com/paulrandal" target="_blank">Twitter</a> | <a href="http://www.sqlskills.com/blogs/paul/" target="_blank">Blog</a>) highlighted in his <a href="http://www.sqlskills.com/blogs/paul/teched-demo-nonclustered-index-corruption/" target="_blank">blog post</a>, just because DBCC CHECKDB reported a bunch of errors doesn&#8217;t mean you have to take your database offline to fix it.</li>
</ol>
</ol>
<p>This is just one of the many ways to identify potential data loss when DBCC CHECKDB reports corruption. The more important thing here is to regularly check and monitor for database consistency so that you as the DBA get alerted immediately when it happens.</p>
]]></content:encoded>
			

		<wfw:commentRss>https://www.edwinmsarmiento.com/how-to-identify-potential-data-loss-when-dbcc-checkdb-reports-corruption/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
				<post-id xmlns="com-wordpress:feed-additions:1">1252</post-id>	</item>
	</channel>
</rss>