<?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>data corruption &#8211; Database Research &amp; Development</title>
	<atom:link href="https://www.dbrnd.com/tag/data-corruption/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>Wed, 15 Feb 2017 20:49:26 +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: Script to monitor the Corrupt Database Pages</title>
		<link>https://www.dbrnd.com/2017/02/sql-server-script-to-monitor-the-corrupt-database-pages-checksum-page-verification/</link>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Wed, 22 Feb 2017 16:16:32 +0000</pubDate>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Server DBA Script]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[CHECKSUM]]></category>
		<category><![CDATA[corrupt data page]]></category>
		<category><![CDATA[data corruption]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></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[suspect_pages]]></category>
		<category><![CDATA[TSQL]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=4615</guid>

					<description><![CDATA[In this post, I am sharing T-SQL script to monitor the Corrupt Database Pages of SQL Server. SQL Server: Enable CHECKSUM Page Verification to detect a prime spot of Data Corruption You should not the wait for big data corruption. Periodically, DBA can monitor the data corruption in SQL Server. Use msdb.dbo.suspect_pages table to get [&#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-script-to-monitor-the-corrupt-database-pages-checksum-page-verification%2F&amp;linkname=SQL%20Server%3A%20Script%20to%20monitor%20the%20Corrupt%20Database%20Pages" 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-script-to-monitor-the-corrupt-database-pages-checksum-page-verification%2F&amp;linkname=SQL%20Server%3A%20Script%20to%20monitor%20the%20Corrupt%20Database%20Pages" 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-script-to-monitor-the-corrupt-database-pages-checksum-page-verification%2F&amp;linkname=SQL%20Server%3A%20Script%20to%20monitor%20the%20Corrupt%20Database%20Pages" 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-script-to-monitor-the-corrupt-database-pages-checksum-page-verification%2F&amp;linkname=SQL%20Server%3A%20Script%20to%20monitor%20the%20Corrupt%20Database%20Pages" 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-script-to-monitor-the-corrupt-database-pages-checksum-page-verification%2F&amp;linkname=SQL%20Server%3A%20Script%20to%20monitor%20the%20Corrupt%20Database%20Pages" 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-script-to-monitor-the-corrupt-database-pages-checksum-page-verification%2F&amp;linkname=SQL%20Server%3A%20Script%20to%20monitor%20the%20Corrupt%20Database%20Pages" 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-script-to-monitor-the-corrupt-database-pages-checksum-page-verification%2F&#038;title=SQL%20Server%3A%20Script%20to%20monitor%20the%20Corrupt%20Database%20Pages" data-a2a-url="https://www.dbrnd.com/2017/02/sql-server-script-to-monitor-the-corrupt-database-pages-checksum-page-verification/" data-a2a-title="SQL Server: Script to monitor the Corrupt Database Pages"></a></p><p>In this post, I am sharing T-SQL script to monitor the Corrupt Database Pages of SQL Server. </p>
<blockquote class="wp-embedded-content" data-secret="7TyPGqffc1"><p><a href="https://www.dbrnd.com/2017/02/sql-server-enable-checksum-page-verification-to-detect-a-prime-spot-of-corruption/">SQL Server: Enable CHECKSUM Page Verification to detect a prime spot of Data Corruption</a></p></blockquote>
<p><iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted"  src="https://www.dbrnd.com/2017/02/sql-server-enable-checksum-page-verification-to-detect-a-prime-spot-of-corruption/embed/#?secret=7TyPGqffc1" data-secret="7TyPGqffc1" width="600" height="338" title="&#8220;SQL Server: Enable CHECKSUM Page Verification to detect a prime spot of Data Corruption&#8221; &#8212; Database Research &amp; Development" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe></p>
<p>You should not the wait for big data corruption. Periodically, DBA can monitor the data corruption in SQL Server.<br />
Use msdb.dbo.suspect_pages table to get the information of corrupt pages. </p>
<pre class="crayon-plain-tag">SELECT 
	SD.NAME AS DatabaseName
	,SP.file_id AS FileID
	,MF.physical_name AS PhysicalFilePath
	,SP.page_id AS PageID
	,CASE 
		WHEN SP.event_type = 1
			THEN '823 error caused by an operating system CRC error or 824 error other than a bad checksum or a torn page'
		WHEN SP.event_type = 2
			THEN 'Bad checksum'
		WHEN SP.event_type = 3
			THEN 'Torn Page'
		WHEN SP.event_type = 4
			THEN 'Restored (The page was restored after it was marked bad)'
		WHEN SP.event_type = 5
			THEN 'Repaired (DBCC repaired the page)'
		WHEN SP.event_type = 7
			THEN 'Deallocated by DBCC'
	END AS EventDescription
	,SP.error_count AS ErrorCount
	,SP.last_update_date AS LastUpdated
FROM msdb.dbo.suspect_pages AS SP
INNER JOIN sys.databases AS SD 
	ON SD.database_id = SP.database_id
INNER JOIN sys.master_files AS MF 
	ON MF.database_id = SP.database_id
		AND MF.file_id = SP.file_id</pre> </p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>SQL Server: Enable CHECKSUM Page Verification to detect a prime spot of Data Corruption</title>
		<link>https://www.dbrnd.com/2017/02/sql-server-enable-checksum-page-verification-to-detect-a-prime-spot-of-corruption/</link>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Tue, 07 Feb 2017 16:16:58 +0000</pubDate>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[CHECKSUM]]></category>
		<category><![CDATA[data corruption]]></category>
		<category><![CDATA[data validation]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[file integrity]]></category>
		<category><![CDATA[Rebuild Index]]></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=4484</guid>

					<description><![CDATA[From the MSDN, &#8220;When CHECKSUM is enabled for the PAGE_VERIFY database option, the SQL Server Database Engine calculates a checksum over the contents of the whole page, and stores the value in the page header when a page is written to disk. When the page read from disk, the checksum is recomputed and compared to [&#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-enable-checksum-page-verification-to-detect-a-prime-spot-of-corruption%2F&amp;linkname=SQL%20Server%3A%20Enable%20CHECKSUM%20Page%20Verification%20to%20detect%20a%20prime%20spot%20of%20Data%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%2F2017%2F02%2Fsql-server-enable-checksum-page-verification-to-detect-a-prime-spot-of-corruption%2F&amp;linkname=SQL%20Server%3A%20Enable%20CHECKSUM%20Page%20Verification%20to%20detect%20a%20prime%20spot%20of%20Data%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%2F2017%2F02%2Fsql-server-enable-checksum-page-verification-to-detect-a-prime-spot-of-corruption%2F&amp;linkname=SQL%20Server%3A%20Enable%20CHECKSUM%20Page%20Verification%20to%20detect%20a%20prime%20spot%20of%20Data%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%2F2017%2F02%2Fsql-server-enable-checksum-page-verification-to-detect-a-prime-spot-of-corruption%2F&amp;linkname=SQL%20Server%3A%20Enable%20CHECKSUM%20Page%20Verification%20to%20detect%20a%20prime%20spot%20of%20Data%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%2F2017%2F02%2Fsql-server-enable-checksum-page-verification-to-detect-a-prime-spot-of-corruption%2F&amp;linkname=SQL%20Server%3A%20Enable%20CHECKSUM%20Page%20Verification%20to%20detect%20a%20prime%20spot%20of%20Data%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%2F2017%2F02%2Fsql-server-enable-checksum-page-verification-to-detect-a-prime-spot-of-corruption%2F&amp;linkname=SQL%20Server%3A%20Enable%20CHECKSUM%20Page%20Verification%20to%20detect%20a%20prime%20spot%20of%20Data%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%2F2017%2F02%2Fsql-server-enable-checksum-page-verification-to-detect-a-prime-spot-of-corruption%2F&#038;title=SQL%20Server%3A%20Enable%20CHECKSUM%20Page%20Verification%20to%20detect%20a%20prime%20spot%20of%20Data%20Corruption" data-a2a-url="https://www.dbrnd.com/2017/02/sql-server-enable-checksum-page-verification-to-detect-a-prime-spot-of-corruption/" data-a2a-title="SQL Server: Enable CHECKSUM Page Verification to detect a prime spot of Data Corruption"></a></p><p><strong>From the MSDN,</strong></p>
<blockquote><p><strong>&#8220;</strong>When CHECKSUM is enabled for the PAGE_VERIFY database option, the SQL Server Database Engine calculates a checksum over the contents of the whole page, and stores the value in the page header when a page is written to disk.</p>
<p>When the page read from disk, the checksum is recomputed and compared to the checksum value that stored in the page header. This helps provide a high level of data file integrity.<strong>&#8220;</strong></p></blockquote>
<p>Guys, You have two options, wait for huge data corruption and detect it a very first level of data corruption.</p>
<blockquote><p>Once you enable CHECKSUM, every read off and write off a check for CHECKSUM and validates it. If it finds any mismatch or broken chain of CHECKSUM value, it indicates data corruption immediately.</p>
<p><img decoding="async" class="alignright wp-image-4489 size-full" title="SQL Server Checksum" src="https://www.dbrnd.com/wp-content/uploads/2017/02/SQLServerChecksum.jpg" alt="SQL Server Checksum" width="448" height="84" srcset="https://www.dbrnd.com/wp-content/uploads/2017/02/SQLServerChecksum.jpg 448w, https://www.dbrnd.com/wp-content/uploads/2017/02/SQLServerChecksum-300x56.jpg 300w, https://www.dbrnd.com/wp-content/uploads/2017/02/SQLServerChecksum-150x28.jpg 150w" sizes="(max-width: 448px) 100vw, 448px" /></p></blockquote>
<blockquote><p>CHECKSUM option doesn&#8217;t prevent the data corruption, it gives you more confidence against data corruption, and you can detect data corruption error faster and solve it in the better way.</p></blockquote>
<blockquote><p>It occupies little CPU I/O for maintaining a CHECKSUM values, but it is acceptable.</p></blockquote>
<p><strong>Find all databases which are not configured for CHECKSUM verification:</strong></p><pre class="crayon-plain-tag">USE master
GO

SELECT NAME
        ,page_verify_option_desc
FROM master .sys.databases
WHERE page_verify_option_desc != 'CHECKSUM'
GO</pre><p>
<strong>Enable CHECKSUM for your Database:</strong></p><pre class="crayon-plain-tag">ALTER DATABASE Database_Name
SET PAGE_VERIFY CHECKSUM WITH NO_WAIT
GO</pre><p>
<strong>Important Note: </strong><br />
Once you enable and CHECKSUM for your database, It does not instantly add CHECKSUMs to your existing data pages in the database. You have to read each page using INSERT/UPDATE/DELETE or simply you can execute REBUILD option for your indexes.</p>
<p><strong>Other related articles:</strong></p>
<blockquote data-secret="kwte1ixkoM" class="wp-embedded-content"><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=kwte1ixkoM" data-secret="kwte1ixkoM" 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>
	</channel>
</rss>
