<?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>DBCC CHECKDB &#8211; Database Research &amp; Development</title>
	<atom:link href="https://www.dbrnd.com/tag/dbcc-checkdb/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.dbrnd.com</link>
	<description>BIGData &#124; NoSQL &#124; MSSQL &#124; MySQL &#124; PostgreSQL</description>
	<lastBuildDate>Sun, 17 Dec 2017 20:20:44 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0.6</generator>
	<item>
		<title>SQL Server 2016: Introduced MAXDOP with DBCC Commands</title>
		<link>https://www.dbrnd.com/2018/01/sql-server-2016-introduced-maxdop-with-dbcc-commands-dbcc-checkdb-checktable/</link>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Fri, 05 Jan 2018 16:16:56 +0000</pubDate>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[Database Crashed]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[DBCC CHECKDB]]></category>
		<category><![CDATA[DBCC CHECKTABLE]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[Max Degree of Parallelism]]></category>
		<category><![CDATA[MAXDOP]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Server Administrator]]></category>
		<category><![CDATA[SQL Server Monitoring]]></category>
		<category><![CDATA[SQL Server Performance Tunning]]></category>
		<category><![CDATA[SQL Server Tips and Tricks]]></category>
		<category><![CDATA[TSQL]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=4165</guid>

					<description><![CDATA[<div><img width="450" height="180" src="https://www.dbrnd.com/wp-content/uploads/2017/12/SQLServer-Parallel-Processing.gif" class="attachment-post-image size-post-image wp-post-image" alt="SQLServer Parallel Processing" decoding="async" fetchpriority="high" /></div>SQL Server 2016 enhanced the use of DBCC Commands by adding support of MAXDOP. A Max Degree of Parallelism (MAXDOP) is used to define some CPU threads at Server Configuration Level as well as at Query Execution Level. I have read different SQL Forums, and Blogs about the MAXDOP and everyone is saying that the [&#8230;]]]></description>
										<content:encoded><![CDATA[<div><img width="450" height="180" src="https://www.dbrnd.com/wp-content/uploads/2017/12/SQLServer-Parallel-Processing.gif" class="attachment-post-image size-post-image wp-post-image" alt="SQLServer Parallel Processing" decoding="async" /></div><p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2018%2F01%2Fsql-server-2016-introduced-maxdop-with-dbcc-commands-dbcc-checkdb-checktable%2F&amp;linkname=SQL%20Server%202016%3A%20Introduced%20MAXDOP%20with%20DBCC%20Commands" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2018%2F01%2Fsql-server-2016-introduced-maxdop-with-dbcc-commands-dbcc-checkdb-checktable%2F&amp;linkname=SQL%20Server%202016%3A%20Introduced%20MAXDOP%20with%20DBCC%20Commands" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2018%2F01%2Fsql-server-2016-introduced-maxdop-with-dbcc-commands-dbcc-checkdb-checktable%2F&amp;linkname=SQL%20Server%202016%3A%20Introduced%20MAXDOP%20with%20DBCC%20Commands" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2018%2F01%2Fsql-server-2016-introduced-maxdop-with-dbcc-commands-dbcc-checkdb-checktable%2F&amp;linkname=SQL%20Server%202016%3A%20Introduced%20MAXDOP%20with%20DBCC%20Commands" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2018%2F01%2Fsql-server-2016-introduced-maxdop-with-dbcc-commands-dbcc-checkdb-checktable%2F&amp;linkname=SQL%20Server%202016%3A%20Introduced%20MAXDOP%20with%20DBCC%20Commands" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2018%2F01%2Fsql-server-2016-introduced-maxdop-with-dbcc-commands-dbcc-checkdb-checktable%2F&amp;linkname=SQL%20Server%202016%3A%20Introduced%20MAXDOP%20with%20DBCC%20Commands" title="Pocket" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.dbrnd.com%2F2018%2F01%2Fsql-server-2016-introduced-maxdop-with-dbcc-commands-dbcc-checkdb-checktable%2F&#038;title=SQL%20Server%202016%3A%20Introduced%20MAXDOP%20with%20DBCC%20Commands" data-a2a-url="https://www.dbrnd.com/2018/01/sql-server-2016-introduced-maxdop-with-dbcc-commands-dbcc-checkdb-checktable/" data-a2a-title="SQL Server 2016: Introduced MAXDOP with DBCC Commands"></a></p><p>SQL Server 2016 enhanced the use of DBCC Commands by adding support of MAXDOP. </p>
<blockquote><p>A Max Degree of Parallelism (MAXDOP) is used to define some CPU threads at Server Configuration Level as well as at Query Execution Level. </p></blockquote>
<blockquote><p>I have read different SQL Forums, and Blogs about the MAXDOP and everyone is saying that the result of MAXDOP is a different basis on your system configuration. </p></blockquote>
<blockquote><p>Yes, it is true 100%. Before using MAXDOP you should check your CPU configuration and load of SQL Server.<br />
Once you have defined MAXDOP, you must check the query execution plan and accordingly you should decide the value of MAXDOP.</p></blockquote>
<blockquote><p>We are running DBCC CHECKDB for repairing the database related issues. If your database size is huge, it requires more CPU/IO.<br />
Now you can add MAXDOP to optimize the task of DBCC commands. </p></blockquote>
<p><strong>DBCC with MAXDOP:</strong></p>
<pre class="crayon-plain-tag">DBCC CHECKDB (AdventureWorks2016CTP3)
WITH MAXDOP = 2;

DBCC CHECKTABLE ('Person.AddressType')
WITH MAXDOP = 2;</pre> </p>
<p><strong>Related Article:</strong></p>
<blockquote class="wp-embedded-content" data-secret="7fpebHftG0"><p><a href="https://www.dbrnd.com/2015/11/sql-server-monitor-and-manage-database-corruption/">SQL Server: Monitor and Manage Database Corruption</a></p></blockquote>
<p><iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted"  src="https://www.dbrnd.com/2015/11/sql-server-monitor-and-manage-database-corruption/embed/#?secret=7fpebHftG0" data-secret="7fpebHftG0" width="600" height="338" title="&#8220;SQL Server: Monitor and Manage Database Corruption&#8221; &#8212; Database Research &amp; Development" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>SQL Server: When you last executed DBCC CHECKDB? (Using sp_readerrorlog)</title>
		<link>https://www.dbrnd.com/2017/11/sql-server-when-you-last-executed-dbcc-checkdb-using-sp_readerrorlog/</link>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Fri, 17 Nov 2017 16:16:50 +0000</pubDate>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[DBCC CHECKDB]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[sp_readerrorlog]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Server Administrator]]></category>
		<category><![CDATA[SQL Server Error]]></category>
		<category><![CDATA[SQL Server Monitoring]]></category>
		<category><![CDATA[SQL Server Performance Tuning]]></category>
		<category><![CDATA[SQL Server Programming]]></category>
		<category><![CDATA[SQL Server Tips and Tricks]]></category>
		<category><![CDATA[TSQL]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=6122</guid>

					<description><![CDATA[In this post, I am sharing a way to check the execution history of DBA command like DBCC CHECKDB in SQL Server. Why is this important? DBCC CHECKDB is important for SQL Database which is fixing and showing critical errors. But if your database size is huge and some other DBA already executed DBCC CHECKDB [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F11%2Fsql-server-when-you-last-executed-dbcc-checkdb-using-sp_readerrorlog%2F&amp;linkname=SQL%20Server%3A%20When%20you%20last%20executed%20DBCC%20CHECKDB%3F%20%28Using%20sp_readerrorlog%29" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F11%2Fsql-server-when-you-last-executed-dbcc-checkdb-using-sp_readerrorlog%2F&amp;linkname=SQL%20Server%3A%20When%20you%20last%20executed%20DBCC%20CHECKDB%3F%20%28Using%20sp_readerrorlog%29" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F11%2Fsql-server-when-you-last-executed-dbcc-checkdb-using-sp_readerrorlog%2F&amp;linkname=SQL%20Server%3A%20When%20you%20last%20executed%20DBCC%20CHECKDB%3F%20%28Using%20sp_readerrorlog%29" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F11%2Fsql-server-when-you-last-executed-dbcc-checkdb-using-sp_readerrorlog%2F&amp;linkname=SQL%20Server%3A%20When%20you%20last%20executed%20DBCC%20CHECKDB%3F%20%28Using%20sp_readerrorlog%29" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F11%2Fsql-server-when-you-last-executed-dbcc-checkdb-using-sp_readerrorlog%2F&amp;linkname=SQL%20Server%3A%20When%20you%20last%20executed%20DBCC%20CHECKDB%3F%20%28Using%20sp_readerrorlog%29" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F11%2Fsql-server-when-you-last-executed-dbcc-checkdb-using-sp_readerrorlog%2F&amp;linkname=SQL%20Server%3A%20When%20you%20last%20executed%20DBCC%20CHECKDB%3F%20%28Using%20sp_readerrorlog%29" title="Pocket" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F11%2Fsql-server-when-you-last-executed-dbcc-checkdb-using-sp_readerrorlog%2F&#038;title=SQL%20Server%3A%20When%20you%20last%20executed%20DBCC%20CHECKDB%3F%20%28Using%20sp_readerrorlog%29" data-a2a-url="https://www.dbrnd.com/2017/11/sql-server-when-you-last-executed-dbcc-checkdb-using-sp_readerrorlog/" data-a2a-title="SQL Server: When you last executed DBCC CHECKDB? (Using sp_readerrorlog)"></a></p><p>In this post, I am sharing a way to check the execution history of DBA command like DBCC CHECKDB in SQL Server.</p>
<p><strong>Why is this important?</strong></p>
<blockquote><p>DBCC CHECKDB is important for SQL Database which is fixing and showing critical errors. But if your database size is huge and some other DBA already executed DBCC CHECKDB then?</p>
<p>Do you need to run again? &#8211; The answer is NO.</p></blockquote>
<p>If you have a big size of the database, DBCC CHECKDB requires more time to complete the execution.</p>
<p><strong>The solution:</strong></p>
<blockquote><p>Before executing DBCC CHECKDB, you should check the execution history of it.<br />
You can do using sp_readerrorlog, which is an undocumented system stored procedure.</p>
<p>Using this, you can read the contents of SQL Server error log files, and you can also perform a search using your keywords.</p></blockquote>
<p><strong>Syntax of sp_readerrorlog:</strong></p><pre class="crayon-plain-tag">EXEC sp_readerrorlog  &lt;LogNumber&gt;, &lt;LogType&gt;, &lt;SearchTerm1&gt;, &lt;SearchTerm2&gt;</pre><p>
Log number 0= current log<br />
Log type 1= read SQL Server error logs</p><pre class="crayon-plain-tag">EXEC sp_readerrorlog 0, 1, 'DBCC CHECKDB'</pre><p>
<strong>Sample result:</strong></p>
<p><img loading="lazy" decoding="async" class="alignnone size-full wp-image-6124" src="https://www.dbrnd.com/wp-content/uploads/2017/09/SQL-sp_readerrorlog.png" alt="SQL sp_readerrorlog" width="545" height="119" /></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>SQL Server: How to find Corrupted Indexed View using DBCC CHECKDB?</title>
		<link>https://www.dbrnd.com/2017/05/sql-server-how-to-find-corrupted-indexed-view-using-dbcc-checkdb/</link>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Mon, 29 May 2017 16:16:57 +0000</pubDate>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[Corrupt Index]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[DBCC CHECKDB]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[Index viewed]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Server Administrator]]></category>
		<category><![CDATA[SQL Server Error]]></category>
		<category><![CDATA[SQL Server Monitoring]]></category>
		<category><![CDATA[SQL Server Performance Tuning]]></category>
		<category><![CDATA[SQL Server Programming]]></category>
		<category><![CDATA[SQL Server Tips and Tricks]]></category>
		<category><![CDATA[TSQL]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=5346</guid>

					<description><![CDATA[In this post, I am sharing DBCC CHECKDB with option EXTENDED_LOGICAL_CHECKS of SQL Server. If you execute only DBCC CHECKDB, excludes other logical checks like persisted columns, indexed views, filtered indexes which improve the overall performance of it. If you run DBCC CHECKDB with option EXTENDED_LOGICAL_CHECKS, it does logical checks like indexed views, XML indexes, [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F05%2Fsql-server-how-to-find-corrupted-indexed-view-using-dbcc-checkdb%2F&amp;linkname=SQL%20Server%3A%20How%20to%20find%20Corrupted%20Indexed%20View%20using%20DBCC%20CHECKDB%3F" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F05%2Fsql-server-how-to-find-corrupted-indexed-view-using-dbcc-checkdb%2F&amp;linkname=SQL%20Server%3A%20How%20to%20find%20Corrupted%20Indexed%20View%20using%20DBCC%20CHECKDB%3F" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F05%2Fsql-server-how-to-find-corrupted-indexed-view-using-dbcc-checkdb%2F&amp;linkname=SQL%20Server%3A%20How%20to%20find%20Corrupted%20Indexed%20View%20using%20DBCC%20CHECKDB%3F" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F05%2Fsql-server-how-to-find-corrupted-indexed-view-using-dbcc-checkdb%2F&amp;linkname=SQL%20Server%3A%20How%20to%20find%20Corrupted%20Indexed%20View%20using%20DBCC%20CHECKDB%3F" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F05%2Fsql-server-how-to-find-corrupted-indexed-view-using-dbcc-checkdb%2F&amp;linkname=SQL%20Server%3A%20How%20to%20find%20Corrupted%20Indexed%20View%20using%20DBCC%20CHECKDB%3F" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F05%2Fsql-server-how-to-find-corrupted-indexed-view-using-dbcc-checkdb%2F&amp;linkname=SQL%20Server%3A%20How%20to%20find%20Corrupted%20Indexed%20View%20using%20DBCC%20CHECKDB%3F" title="Pocket" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F05%2Fsql-server-how-to-find-corrupted-indexed-view-using-dbcc-checkdb%2F&#038;title=SQL%20Server%3A%20How%20to%20find%20Corrupted%20Indexed%20View%20using%20DBCC%20CHECKDB%3F" data-a2a-url="https://www.dbrnd.com/2017/05/sql-server-how-to-find-corrupted-indexed-view-using-dbcc-checkdb/" data-a2a-title="SQL Server: How to find Corrupted Indexed View using DBCC CHECKDB?"></a></p><p>In this post, I am sharing DBCC CHECKDB with option EXTENDED_LOGICAL_CHECKS of SQL Server. </p>
<p>If you execute only DBCC CHECKDB, excludes other logical checks like persisted columns, indexed views, filtered indexes which improve the overall performance of it. </p>
<p>If you run DBCC CHECKDB with option EXTENDED_LOGICAL_CHECKS, it does logical checks like indexed views, XML indexes, and spatial indexes.<br />
You can also use EXTENDED_LOGICAL_CHECKS with DBCC CHECKTABLE. </p>
<p><strong>The syntax is:</strong></p>
<pre class="crayon-plain-tag">DBCC CHECKDB(Db_Name) WITH EXTENDED_LOGICAL_CHECKS
GO
DBCC CHECKTABLE(Table_Name) WITH EXTENDED_LOGICAL_CHECKS
GO</pre> </p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>SQL Server: How to repair corrupted Clustered Index using REPAIR_REBUILD option</title>
		<link>https://www.dbrnd.com/2017/03/sql-server-how-to-repair-corrupted-clustered-index-using-repair_rebuild-option-dbcc-checkdb-dbcc-checktable/</link>
					<comments>https://www.dbrnd.com/2017/03/sql-server-how-to-repair-corrupted-clustered-index-using-repair_rebuild-option-dbcc-checkdb-dbcc-checktable/#comments</comments>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Sat, 11 Mar 2017 16:16:39 +0000</pubDate>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[clustered index]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[DBCC CHECKDB]]></category>
		<category><![CDATA[DBCC CHECKTABLE]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[Index corruption]]></category>
		<category><![CDATA[Rebuild Clustered Index]]></category>
		<category><![CDATA[Repair Index]]></category>
		<category><![CDATA[REPAIR_REBUILD]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Server Administrator]]></category>
		<category><![CDATA[SQL Server Error]]></category>
		<category><![CDATA[SQL Server Monitoring]]></category>
		<category><![CDATA[SQL Server Performance Tuning]]></category>
		<category><![CDATA[SQL Server Programming]]></category>
		<category><![CDATA[SQL Server Tips and Tricks]]></category>
		<category><![CDATA[TSQL]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=4731</guid>

					<description><![CDATA[I executed DBCC CHECKTABLE on one of my tables, and I got below error. &#8220;table &#8216;tbl_students&#8217; (ID 6589332541). Data row does not have a matching index row in the index &#8216;idx_tbl_students_id&#8217; (ID 88). Possible missing or invalid keys for the index row matching.&#8221; The above error is indicating the corruption of index &#8220;idx_tbl_students_id&#8221; so few [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F03%2Fsql-server-how-to-repair-corrupted-clustered-index-using-repair_rebuild-option-dbcc-checkdb-dbcc-checktable%2F&amp;linkname=SQL%20Server%3A%20How%20to%20repair%20corrupted%20Clustered%20Index%20using%20REPAIR_REBUILD%20option" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F03%2Fsql-server-how-to-repair-corrupted-clustered-index-using-repair_rebuild-option-dbcc-checkdb-dbcc-checktable%2F&amp;linkname=SQL%20Server%3A%20How%20to%20repair%20corrupted%20Clustered%20Index%20using%20REPAIR_REBUILD%20option" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F03%2Fsql-server-how-to-repair-corrupted-clustered-index-using-repair_rebuild-option-dbcc-checkdb-dbcc-checktable%2F&amp;linkname=SQL%20Server%3A%20How%20to%20repair%20corrupted%20Clustered%20Index%20using%20REPAIR_REBUILD%20option" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F03%2Fsql-server-how-to-repair-corrupted-clustered-index-using-repair_rebuild-option-dbcc-checkdb-dbcc-checktable%2F&amp;linkname=SQL%20Server%3A%20How%20to%20repair%20corrupted%20Clustered%20Index%20using%20REPAIR_REBUILD%20option" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F03%2Fsql-server-how-to-repair-corrupted-clustered-index-using-repair_rebuild-option-dbcc-checkdb-dbcc-checktable%2F&amp;linkname=SQL%20Server%3A%20How%20to%20repair%20corrupted%20Clustered%20Index%20using%20REPAIR_REBUILD%20option" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F03%2Fsql-server-how-to-repair-corrupted-clustered-index-using-repair_rebuild-option-dbcc-checkdb-dbcc-checktable%2F&amp;linkname=SQL%20Server%3A%20How%20to%20repair%20corrupted%20Clustered%20Index%20using%20REPAIR_REBUILD%20option" title="Pocket" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F03%2Fsql-server-how-to-repair-corrupted-clustered-index-using-repair_rebuild-option-dbcc-checkdb-dbcc-checktable%2F&#038;title=SQL%20Server%3A%20How%20to%20repair%20corrupted%20Clustered%20Index%20using%20REPAIR_REBUILD%20option" data-a2a-url="https://www.dbrnd.com/2017/03/sql-server-how-to-repair-corrupted-clustered-index-using-repair_rebuild-option-dbcc-checkdb-dbcc-checktable/" data-a2a-title="SQL Server: How to repair corrupted Clustered Index using REPAIR_REBUILD option"></a></p><p>I executed DBCC CHECKTABLE on one of my tables, and I got below error.<br />
<em>&#8220;table &#8216;tbl_students&#8217; (ID 6589332541). Data row does not have a matching index row in the index &#8216;idx_tbl_students_id&#8217; (ID 88). Possible missing or invalid keys for the index row matching.&#8221;</em></p>
<blockquote><p>The above error is indicating the corruption of index &#8220;idx_tbl_students_id&#8221; so few records are missing.<br />
If your index corrupted, there are two possible solutions. One is Restore your database backup and Second is Rebuild your corrupted indexes.</p></blockquote>
<p>People are using REBUILD command for rebuilding the indexes, but in this article, I repaired the index using option REPAIR_REBUILD of DBCC. </p>
<blockquote><p>You can use the REPAIR_REBUILD option with DBCC CHECKDB and DBCC CHECKTABLE. While executing those DBCC commands, you can repair corrupted indexes. </p></blockquote>
<p>This can include quick repairs, such as repairing missing rows in non-clustered indexes, and more time-consuming repairs, such as rebuilding an index.</p>
<p>Following are example, </p>
<pre class="crayon-plain-tag">DBCC CHECKDB ('Database_Name', REPAIR_REBUILD)
DBCC CHECKTABLE ('Table_Name', REPAIR_REBUILD)</pre> </p>
<p>You can use below article and find script to rebuild all indexes of SQL Server Database:</p>
<blockquote class="wp-embedded-content" data-secret="BjywMbat3a"><p><a href="https://www.dbrnd.com/2016/10/sql-server-t-sql-script-to-rebuild-all-indexes-of-a-database-remove-index-fragmentation-require-exclusive-lock/">SQL Server: T-SQL Script to Rebuild all Indexes of a Database</a></p></blockquote>
<p><iframe loading="lazy" class="wp-embedded-content" sandbox="allow-scripts" security="restricted"  src="https://www.dbrnd.com/2016/10/sql-server-t-sql-script-to-rebuild-all-indexes-of-a-database-remove-index-fragmentation-require-exclusive-lock/embed/#?secret=BjywMbat3a" data-secret="BjywMbat3a" width="600" height="338" title="&#8220;SQL Server: T-SQL Script to Rebuild all Indexes of a Database&#8221; &#8212; Database Research &amp; Development" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe></p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.dbrnd.com/2017/03/sql-server-how-to-repair-corrupted-clustered-index-using-repair_rebuild-option-dbcc-checkdb-dbcc-checktable/feed/</wfw:commentRss>
			<slash:comments>3</slash:comments>
		
		
			</item>
		<item>
		<title>SQL Server: How to Recover a database from SUSPECT Mode?</title>
		<link>https://www.dbrnd.com/2017/02/sql-server-how-to-recover-a-database-from-suspect-mode-online-mode-dbcc-checkdb/</link>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Sat, 04 Feb 2017 16:16:21 +0000</pubDate>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[crash database]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[DBCC CHECKDB]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[recover]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Server Administrator]]></category>
		<category><![CDATA[SQL Server Monitoring]]></category>
		<category><![CDATA[SQL Server Performance Tuning]]></category>
		<category><![CDATA[SQL Server Tips and Tricks]]></category>
		<category><![CDATA[SUSPECT Mode]]></category>
		<category><![CDATA[TSQL]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=4459</guid>

					<description><![CDATA[Recently, I shared one article about Database is stuck in &#8220;In Recovery&#8221; mode after the restart of SQL Server. SQL Server: After Restart, Database in &#8220;In Recovery&#8221; status, Can&#8217;t Access it In this post, I am going to share necessary steps to recover a database from the SUSPECT Mode. If your database in SUSPECT mode, [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F02%2Fsql-server-how-to-recover-a-database-from-suspect-mode-online-mode-dbcc-checkdb%2F&amp;linkname=SQL%20Server%3A%20How%20to%20Recover%20a%20database%20from%20SUSPECT%20Mode%3F" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F02%2Fsql-server-how-to-recover-a-database-from-suspect-mode-online-mode-dbcc-checkdb%2F&amp;linkname=SQL%20Server%3A%20How%20to%20Recover%20a%20database%20from%20SUSPECT%20Mode%3F" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F02%2Fsql-server-how-to-recover-a-database-from-suspect-mode-online-mode-dbcc-checkdb%2F&amp;linkname=SQL%20Server%3A%20How%20to%20Recover%20a%20database%20from%20SUSPECT%20Mode%3F" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F02%2Fsql-server-how-to-recover-a-database-from-suspect-mode-online-mode-dbcc-checkdb%2F&amp;linkname=SQL%20Server%3A%20How%20to%20Recover%20a%20database%20from%20SUSPECT%20Mode%3F" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F02%2Fsql-server-how-to-recover-a-database-from-suspect-mode-online-mode-dbcc-checkdb%2F&amp;linkname=SQL%20Server%3A%20How%20to%20Recover%20a%20database%20from%20SUSPECT%20Mode%3F" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F02%2Fsql-server-how-to-recover-a-database-from-suspect-mode-online-mode-dbcc-checkdb%2F&amp;linkname=SQL%20Server%3A%20How%20to%20Recover%20a%20database%20from%20SUSPECT%20Mode%3F" title="Pocket" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F02%2Fsql-server-how-to-recover-a-database-from-suspect-mode-online-mode-dbcc-checkdb%2F&#038;title=SQL%20Server%3A%20How%20to%20Recover%20a%20database%20from%20SUSPECT%20Mode%3F" data-a2a-url="https://www.dbrnd.com/2017/02/sql-server-how-to-recover-a-database-from-suspect-mode-online-mode-dbcc-checkdb/" data-a2a-title="SQL Server: How to Recover a database from SUSPECT Mode?"></a></p><p>Recently, I shared one article about Database is stuck in &#8220;In Recovery&#8221; mode after the restart of SQL Server. </p>
<blockquote class="wp-embedded-content" data-secret="M8rxPhX7zc"><p><a href="https://www.dbrnd.com/2017/02/sql-server-after-restart-database-in-in-recovery-status-cant-access-it-database-crashed/">SQL Server: After Restart, Database in &#8220;In Recovery&#8221; status, Can&#8217;t Access it</a></p></blockquote>
<p><iframe loading="lazy" class="wp-embedded-content" sandbox="allow-scripts" security="restricted"  src="https://www.dbrnd.com/2017/02/sql-server-after-restart-database-in-in-recovery-status-cant-access-it-database-crashed/embed/#?secret=M8rxPhX7zc" data-secret="M8rxPhX7zc" width="600" height="338" title="&#8220;SQL Server: After Restart, Database in &#8220;In Recovery&#8221; status, Can&#8217;t Access it&#8221; &#8212; Database Research &amp; Development" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe></p>
<p>In this post, I am going to share necessary steps to recover a database from the SUSPECT Mode. If your database in SUSPECT mode, you cannot access it. </p>
<blockquote><p>There are several reasons behind the SUSPECT Mode like a hardware issue, transaction log file is corrupt, missing transaction log file, improper shutdown or restart of SQL Server, page or disk is corrupt and other much more.</p></blockquote>
<p>You can check the SQL Server error logs which give you more details.</p>
<p>Action steps to recover a database from SUSPECT Mode to ONLINE Mode:</p>
<p><strong>Change the database status to EMERGENCY Mode:</strong></p>
<pre class="crayon-plain-tag">ALTER DATABASE database_name SET  EMERGENCY</pre> </p>
<p><strong>Now administrator can access your database and execute DBCC CHECKDB next:</strong></p>
<pre class="crayon-plain-tag">DBCC CHECKDB('database_name')</pre> </p>
<p><strong>Bring the SQL Database into Single user mode:</strong></p>
<pre class="crayon-plain-tag">ALTER DATABASE database_name SET SINGLE_USER WITH ROLLBACK IMMEDIATE</pre> </p>
<p><strong>Re-Run DBCC CHECKDB with repari options:</strong><br />
It repairs the database and fixes the error, but there are chance of data loss.</p><pre class="crayon-plain-tag">DBCC CHECKDB (database_name, REPAIR_ALLOW_DATA_LOSS)</pre><p> </p>
<p><strong>If you get success message, change the database mode from single-user mode to multi-user mode.</strong></p>
<pre class="crayon-plain-tag">ALTER DATABASE database_name SET MULTI_USER</pre> </p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>SQL Server: Monitor and Manage Database Corruption</title>
		<link>https://www.dbrnd.com/2015/11/sql-server-monitor-and-manage-database-corruption/</link>
					<comments>https://www.dbrnd.com/2015/11/sql-server-monitor-and-manage-database-corruption/#comments</comments>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Fri, 06 Nov 2015 05:54:49 +0000</pubDate>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[DBCC CHECKDB]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[msdb.dbo.suspect_pages]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Server Administrator]]></category>
		<category><![CDATA[SQL Server Monitoring]]></category>
		<category><![CDATA[SQL Server Performance Tunning]]></category>
		<category><![CDATA[SQL Server Tips and Tricks]]></category>
		<category><![CDATA[TSQL]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=1025</guid>

					<description><![CDATA[In this post, I am going to provide necessary information to monitor and manage Database Corruption of SQL Server. As we are Database Administrator, so this is our responsibility to find data corruption of the database before it crashes. You can monitor corrupted database page using one system table of MSDB. Please execute below statement [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2015%2F11%2Fsql-server-monitor-and-manage-database-corruption%2F&amp;linkname=SQL%20Server%3A%20Monitor%20and%20Manage%20Database%20Corruption" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2015%2F11%2Fsql-server-monitor-and-manage-database-corruption%2F&amp;linkname=SQL%20Server%3A%20Monitor%20and%20Manage%20Database%20Corruption" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2015%2F11%2Fsql-server-monitor-and-manage-database-corruption%2F&amp;linkname=SQL%20Server%3A%20Monitor%20and%20Manage%20Database%20Corruption" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2015%2F11%2Fsql-server-monitor-and-manage-database-corruption%2F&amp;linkname=SQL%20Server%3A%20Monitor%20and%20Manage%20Database%20Corruption" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2015%2F11%2Fsql-server-monitor-and-manage-database-corruption%2F&amp;linkname=SQL%20Server%3A%20Monitor%20and%20Manage%20Database%20Corruption" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2015%2F11%2Fsql-server-monitor-and-manage-database-corruption%2F&amp;linkname=SQL%20Server%3A%20Monitor%20and%20Manage%20Database%20Corruption" title="Pocket" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.dbrnd.com%2F2015%2F11%2Fsql-server-monitor-and-manage-database-corruption%2F&#038;title=SQL%20Server%3A%20Monitor%20and%20Manage%20Database%20Corruption" data-a2a-url="https://www.dbrnd.com/2015/11/sql-server-monitor-and-manage-database-corruption/" data-a2a-title="SQL Server: Monitor and Manage Database Corruption"></a></p><p>In this post, I am going to provide necessary information to monitor and manage Database Corruption of SQL Server.</p>
<p>As we are Database Administrator, so this is our responsibility to find data corruption of the database before it crashes. </p>
<p>You can monitor corrupted database page using one system table of MSDB.<br />
Please execute below statement to find information about corruption.</p>
<pre class="crayon-plain-tag">SELECT * FROM msdb.dbo.suspect_pages
WHERE (event_type = 1 OR event_type = 2 OR event_type = 3);</pre>
<p><strong>This corrupted page logged in different situations.</strong></p>
<ul>
<li>824 error : Torn pages error.</li>
<li>823 error: Disk or Hardware error.</li>
<li>DBCC repaired the page.</li>
<li>Bad checksum.</li>
<li>DBCC deallocation.</li>
<li>Restored Database with Bad marked.</li>
</ul>
<p><strong>How to deal with this corrupted pages?</strong></p>
<p>The first step, execute DBCC CHECKDB.</p>
<pre class="crayon-plain-tag">DBCC CHECKDB () WITH NO_INFOMSGS, ALL_ERRORMSGS</pre> </p>
<p>You should check your database backup strategy and recovery model.<br />
If corruption happens and not resolved yet, you can restore a fresh backup. </p>
<p>Another best practice is to take the full database object script for Database structure.<br />
You can also use any other third-party recovery tools.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.dbrnd.com/2015/11/sql-server-monitor-and-manage-database-corruption/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
	</channel>
</rss>
