<?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 SarmientoThe Scariest Lie We Believed About Backup Verifications &#8211; Edwin M Sarmiento</title>
	<atom:link href="https://www.edwinmsarmiento.com/the-scariest-lie-we-believed-about-backup-verification/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>The Scariest Lie We Believed About Backup Verifications</title>
		<link>https://www.edwinmsarmiento.com/the-scariest-lie-we-believed-about-backup-verification/</link>
		<comments>https://www.edwinmsarmiento.com/the-scariest-lie-we-believed-about-backup-verification/#comments</comments>
		<pubDate>Tue, 25 Aug 2015 01:54:13 +0000</pubDate>
		<dc:creator>Edwin M Sarmiento</dc:creator>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[backup checksum]]></category>
		<category><![CDATA[RESTORE VERIFYONLY]]></category>
		<guid isPermaLink="false">http://www.edwinmsarmiento.com/?p=2006</guid>

				<description><![CDATA[Have you ever done something for a long time believing it to be true but actually isn&#8217;t? You know, something like going over 10% of the speed limit when you&#8217;re driving and thinking that you&#8217;re not over speeding? I&#8217;m guilty of this myself. But what&#8217;s even worse is that there are a lot of information on the [&#8230;]]]></description>
					<content:encoded><![CDATA[<img width="694" height="568" src="https://www.edwinmsarmiento.com/wp-content/uploads/2015/08/VerifyBackupIntegrity.jpg" class="featured-image wp-post-image" alt="" srcset="https://www.edwinmsarmiento.com/wp-content/uploads/2015/08/VerifyBackupIntegrity.jpg 694w, https://www.edwinmsarmiento.com/wp-content/uploads/2015/08/VerifyBackupIntegrity-300x246.jpg 300w, https://www.edwinmsarmiento.com/wp-content/uploads/2015/08/VerifyBackupIntegrity-489x400.jpg 489w, https://www.edwinmsarmiento.com/wp-content/uploads/2015/08/VerifyBackupIntegrity-82x67.jpg 82w, https://www.edwinmsarmiento.com/wp-content/uploads/2015/08/VerifyBackupIntegrity-600x491.jpg 600w" sizes="(max-width: 694px) 100vw, 694px" /><p>Have you ever done something for a long time believing it to be true but actually isn&#8217;t? You know, something like going over 10% of the speed limit when you&#8217;re driving and thinking that you&#8217;re not over speeding? I&#8217;m guilty of this myself. But what&#8217;s even worse is that there are a lot of information on the internet that tell you something is deemed true when it actually isn&#8217;t. Let me explain.</p>
<p>When you create a database maintenance plan used for running database backups, one of the options you&#8217;ll see is to verify the integrity of the generated backup. Refer to the screenshot above as an example. The check box <em><strong>Verify backup integrity</strong></em> runs the <a href="https://msdn.microsoft.com/en-us/library/ms188902.aspx" target="_blank">RESTORE VERIFYONLY</a> command immediately after the BACKUP DATABASE or BACKUP LOG command completes. The <strong>RESTORE VERIFYONLY</strong> command &#8220;<em>verifies that the backup set is complete and all volumes are readable and that some header fields of database pages, such as the page ID (as if it were about to write the data).&#8221; </em>The one thing that is missed the most is the information about backup checksum. Referring to the list of checks that the <strong>RESTORE VERIFYONLY</strong> command performs: &#8220;c<em>hecksum <span style="color: #800000;"><strong>(if present on the media),</strong></span></em>&#8221; emphasis mine. This means that the <strong>RESTORE VERIFYONLY</strong> command will only perform checksum verification if the backup media also contains the checksum verification.</p>
<p>To illustrate, I created a sample database named <strong>test</strong> that I will use for this purpose. I&#8217;ve also intentionally corrupted a page in the database to see how the <strong>RESTORE VERIFYONLY</strong> command behaves. I&#8217;ve created a simple database maintenance plan that will take a backup of the <strong>test</strong> database and verifies the backup integrity. I&#8217;ve also taken the generated T-SQL command to further illustrate the parameters used for both the BACKUP DATABASE command and the <strong>RESTORE VERIFYONLY</strong> command.</p>
<div style="background-color:#eeeeee;border:1px solid #D6D6D6;font-family:arial,helvetica,sans-serif;font-size:15px;line-height:20px;margin:8px 0 20px;padding:15px 20px;"><code style="font-size: 14px;"><span style="color: blue;">BACKUP DATABASE </span><span style="color: black;">[test] </span><span style="color: blue;">TO  DISK = </span><span style="color: red;">N'C:\Program Files\Microsoft SQL Server\MSSQL12.MSSQLSERVER\MSSQL\Backup\test_backup_2015_07_25_131110_1918625.bak'<br />
</span><span style="color: blue;">WITH </span><span style="color: black;">NOFORMAT</span><span style="color: gray;">, </span><span style="color: black;">NOINIT</span><span style="color: gray;">,  </span><span style="color: black;">NAME </span><span style="color: blue;">= </span><span style="color: red;">N'test_backup_2015_07_25_131110_1918625'</span><span style="color: gray;">,<br />
</span><span style="color: black;">SKIP</span><span style="color: gray;">, </span><span style="color: black;">REWIND</span><span style="color: gray;">, </span><span style="color: black;">NOUNLOAD</span><span style="color: gray;">,  </span><span style="color: black;">STATS </span><span style="color: blue;">= </span><span style="color: black;">10<br />
GO<br />
</span><span style="color: blue;">DECLARE </span><span style="color: #434343;">@backupSetId </span><span style="color: blue;">AS INT<br />
SELECT </span><span style="color: #434343;">@backupSetId </span><span style="color: blue;">= </span><span style="color: black;">position </span><span style="color: blue;">FROM </span><span style="color: black;">msdb..backupset<br />
</span><span style="color: blue;">WHERE </span><span style="color: black;">database_name</span><span style="color: blue;">=</span><span style="color: red;">N'test' </span><span style="color: gray;">AND </span><span style="color: black;">backup_set_id</span><span style="color: blue;">=</span><span style="color: gray;">(</span><span style="color: blue;">SELECT </span><span style="color: magenta;">MAX</span><span style="color: gray;">(</span><span style="color: black;">backup_set_id</span><span style="color: gray;">) </span><span style="color: blue;">FROM </span><span style="color: black;">msdb..backupset </span><span style="color: blue;">WHERE </span><span style="color: black;">database_name</span><span style="color: blue;">=</span><span style="color: red;">N'test' </span><span style="color: gray;">)<br />
</span><span style="color: blue;">IF </span><span style="color: #434343;">@backupSetId </span><span style="color: blue;">IS </span><span style="color: gray;">NULL </span><span style="color: blue;">BEGIN RAISERROR</span><span style="color: gray;">(</span><span style="color: red;">N'Verify failed. Backup information for database ''test'' not found.'</span><span style="color: gray;">, </span><span style="color: black;">16</span><span style="color: gray;">, </span><span style="color: black;">1</span><span style="color: gray;">) </span><span style="color: blue;">END<br />
RESTORE </span><span style="color: black;">VERIFYONLY<br />
</span><span style="color: blue;">FROM  DISK = </span><span style="color: red;">N'C:\Program Files\Microsoft SQL Server\MSSQL12.MSSQLSERVER\MSSQL\Backup\test_backup_2015_07_25_131110_1918625.bak'<br />
</span><span style="color: blue;">WITH  FILE = </span><span style="color: #434343;">@backupSetId</span><span style="color: gray;">,  </span><span style="color: black;">NOUNLOAD</span><span style="color: gray;">,  </span><span style="color: black;">NOREWIND<br />
</span></code></div>
<p>Running the database maintenance plan on my sample database with the <strong>RESTORE VERIFYONLY</strong> command yield the following results.</p>
<p><a href="https://www.edwinmsarmiento.com/wp-content/uploads/2015/08/VerifyBackupIntegrity_TSQL.jpg"><img fetchpriority="high" decoding="async" class="aligncenter size-full wp-image-2010" src="https://www.edwinmsarmiento.com/wp-content/uploads/2015/08/VerifyBackupIntegrity_TSQL.jpg" alt="VerifyBackupIntegrity_TSQL" width="1658" height="735" srcset="https://www.edwinmsarmiento.com/wp-content/uploads/2015/08/VerifyBackupIntegrity_TSQL.jpg 1658w, https://www.edwinmsarmiento.com/wp-content/uploads/2015/08/VerifyBackupIntegrity_TSQL-300x133.jpg 300w, https://www.edwinmsarmiento.com/wp-content/uploads/2015/08/VerifyBackupIntegrity_TSQL-1024x454.jpg 1024w, https://www.edwinmsarmiento.com/wp-content/uploads/2015/08/VerifyBackupIntegrity_TSQL-760x337.jpg 760w, https://www.edwinmsarmiento.com/wp-content/uploads/2015/08/VerifyBackupIntegrity_TSQL-518x230.jpg 518w, https://www.edwinmsarmiento.com/wp-content/uploads/2015/08/VerifyBackupIntegrity_TSQL-82x36.jpg 82w, https://www.edwinmsarmiento.com/wp-content/uploads/2015/08/VerifyBackupIntegrity_TSQL-600x266.jpg 600w" sizes="(max-width: 1658px) 100vw, 1658px" /></a></p>
<p>&nbsp;</p>
<p>The scary thing about this is that <span style="color: #800000;"><strong>YOU BELIEVED</strong></span> that the backup was successful and that verifying the backup was also successful. All you did was to check the status of the SQL Server Agent job execution and verified whether or not the job completed successfully. You, then, go on doing your usual task, thinking that you have a good, solid, working backup. You might be in for a surprise.</p>
<p>I did mention that I intentionally corrupted the sample database to prove the point. I ran DBCC CHECKDB on the sample database which reported the corrupted page.</p>
<p><a href="https://www.edwinmsarmiento.com/wp-content/uploads/2015/08/CHECKDB_testDB.jpg"><img decoding="async" class="aligncenter size-full wp-image-2011" src="https://www.edwinmsarmiento.com/wp-content/uploads/2015/08/CHECKDB_testDB.jpg" alt="CHECKDB_testDB" width="1376" height="362" srcset="https://www.edwinmsarmiento.com/wp-content/uploads/2015/08/CHECKDB_testDB.jpg 1376w, https://www.edwinmsarmiento.com/wp-content/uploads/2015/08/CHECKDB_testDB-300x79.jpg 300w, https://www.edwinmsarmiento.com/wp-content/uploads/2015/08/CHECKDB_testDB-1024x269.jpg 1024w, https://www.edwinmsarmiento.com/wp-content/uploads/2015/08/CHECKDB_testDB-760x200.jpg 760w, https://www.edwinmsarmiento.com/wp-content/uploads/2015/08/CHECKDB_testDB-518x136.jpg 518w, https://www.edwinmsarmiento.com/wp-content/uploads/2015/08/CHECKDB_testDB-82x22.jpg 82w, https://www.edwinmsarmiento.com/wp-content/uploads/2015/08/CHECKDB_testDB-600x158.jpg 600w" sizes="(max-width: 1376px) 100vw, 1376px" /></a></p>
<p>&nbsp;</p>
<p>In a <a href="https://www.edwinmsarmiento.com/is-a-successful-backup-really-a-successful-backup/" target="_blank">previous blog post</a>, I mentioned how to properly generate backups using the CHECKSUM option. If you run your backups using the CHECKSUM option, your RESTORE VERIFYONLY command will automatically run the checksum verification because the backup media has it. Here&#8217;s the same T-SQL statement that has the CHECKSUM option in the BACKUP DATABASE command. Note that the backup failed because the sample database contained a corrupted page.</p>
<p><a href="https://www.edwinmsarmiento.com/wp-content/uploads/2015/08/VerifyBackupIntegrity2_TSQL1.jpg"><img decoding="async" class="aligncenter size-full wp-image-2013" src="https://www.edwinmsarmiento.com/wp-content/uploads/2015/08/VerifyBackupIntegrity2_TSQL1.jpg" alt="VerifyBackupIntegrity2_TSQL" width="1666" height="678" srcset="https://www.edwinmsarmiento.com/wp-content/uploads/2015/08/VerifyBackupIntegrity2_TSQL1.jpg 1666w, https://www.edwinmsarmiento.com/wp-content/uploads/2015/08/VerifyBackupIntegrity2_TSQL1-300x122.jpg 300w, https://www.edwinmsarmiento.com/wp-content/uploads/2015/08/VerifyBackupIntegrity2_TSQL1-1024x417.jpg 1024w, https://www.edwinmsarmiento.com/wp-content/uploads/2015/08/VerifyBackupIntegrity2_TSQL1-760x309.jpg 760w, https://www.edwinmsarmiento.com/wp-content/uploads/2015/08/VerifyBackupIntegrity2_TSQL1-518x211.jpg 518w, https://www.edwinmsarmiento.com/wp-content/uploads/2015/08/VerifyBackupIntegrity2_TSQL1-82x33.jpg 82w, https://www.edwinmsarmiento.com/wp-content/uploads/2015/08/VerifyBackupIntegrity2_TSQL1-600x244.jpg 600w" sizes="(max-width: 1666px) 100vw, 1666px" /></a></p>
<p>&nbsp;</p>
<p>If I was working with a valid, non-corrupted database in a backup media, the <strong>RESTORE VERIFYONLY</strong> command can run a corresponding checksum verification.</p>
<p><a href="https://www.edwinmsarmiento.com/wp-content/uploads/2015/08/VerifyBackupIntegrity3_TSQL.jpg"><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-2014" src="https://www.edwinmsarmiento.com/wp-content/uploads/2015/08/VerifyBackupIntegrity3_TSQL.jpg" alt="VerifyBackupIntegrity3_TSQL" width="1700" height="720" srcset="https://www.edwinmsarmiento.com/wp-content/uploads/2015/08/VerifyBackupIntegrity3_TSQL.jpg 1700w, https://www.edwinmsarmiento.com/wp-content/uploads/2015/08/VerifyBackupIntegrity3_TSQL-300x127.jpg 300w, https://www.edwinmsarmiento.com/wp-content/uploads/2015/08/VerifyBackupIntegrity3_TSQL-1024x434.jpg 1024w, https://www.edwinmsarmiento.com/wp-content/uploads/2015/08/VerifyBackupIntegrity3_TSQL-760x322.jpg 760w, https://www.edwinmsarmiento.com/wp-content/uploads/2015/08/VerifyBackupIntegrity3_TSQL-518x219.jpg 518w, https://www.edwinmsarmiento.com/wp-content/uploads/2015/08/VerifyBackupIntegrity3_TSQL-82x35.jpg 82w, https://www.edwinmsarmiento.com/wp-content/uploads/2015/08/VerifyBackupIntegrity3_TSQL-600x254.jpg 600w" sizes="(max-width: 1700px) 100vw, 1700px" /></a></p>
<h3>Call To Action</h3>
<p>I would strongly recommend checking all of your backup jobs &#8211; be it in your maintenance plans or custom scripts &#8211; to make sure that you are not just taking backups for the sake of taking backups. You don&#8217;t want to be in a situation where a backup that you thought was valid was completely useless simply because you relied on the RESTORE VERIFYONLY command.</p>
]]></content:encoded>
			

		<wfw:commentRss>https://www.edwinmsarmiento.com/the-scariest-lie-we-believed-about-backup-verification/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
				<post-id xmlns="com-wordpress:feed-additions:1">2006</post-id>	</item>
	</channel>
</rss>