<?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 SarmientoFULL &#8211; Edwin M Sarmiento</title>
	<atom:link href="https://www.edwinmsarmiento.com/category/full/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>&gt;Broken BACKUP and RESTORE sequence?</title>
		<link>https://www.edwinmsarmiento.com/broken-backup-and-restore-sequence/</link>
		<comments>https://www.edwinmsarmiento.com/broken-backup-and-restore-sequence/#respond</comments>
		<pubDate>Tue, 29 Jul 2008 06:08:00 +0000</pubDate>
		<dc:creator>Edwin M Sarmiento</dc:creator>
				<category><![CDATA[BACKUP]]></category>
		<category><![CDATA[DIFFERENTIAL]]></category>
		<category><![CDATA[FULL]]></category>
		<category><![CDATA[RESTORE]]></category>
		<category><![CDATA[SQL Server Disaster Recovery]]></category>
		<guid isPermaLink="false">http://bassplayerdoc.wordpress.com/2008/07/29/broken-backup-and-restore-sequence</guid>

				<description><![CDATA[&#62;Have you ever had the to scratch your head because your database backups won&#8217;t work even if you are practically sure that you have tested them properly? Imagine this &#8211; you have a regular FULL and DIFFERENTIAL database backups working together as part of your backup process. Your FULL backups run every Sunday and your [&#8230;]]]></description>
					<content:encoded><![CDATA[<p>&gt;<span style="font-family:arial;">Have you ever had the to scratch your head because your database backups won&#8217;t work even if you are practically sure that you have tested them properly? Imagine this &#8211; you have a regular <strong><span style="font-size:85%;">FULL</span></strong> and <strong><span style="font-size:85%;">DIFFERENTIAL</span></strong> database backups working together as part of your backup process. Your <strong><span style="font-size:85%;">FULL</span></strong> backups run every Sunday and your <span style="font-size:85%;"><strong>DIFFERENTIAL</strong></span> backups run everyday. Then, all of a sudden on a particular Wednesday, your developers decided to restore a <span style="font-size:85%;"><strong>FULL</strong></span> backup of your production databases into your test environment to test a functionality. What happens? The backup sequence is broken. <span style="font-size:85%;"><strong>DIFFERENTIAL</strong></span> backups contain the changes since the last <span style="font-size:85%;"><strong>FULL</strong></span> backup. If you are following the sequence and working with the backups generated by your backup process, you would have done some tests using the Sunday <span style="font-size:85%;"><strong>FULL</strong></span> backup and the latest <span style="font-size:85%;"><strong>DIFFERENTIAL</strong></span> backup. Not in this case. You would need the <span style="font-size:85%;"><strong>FULL</strong></span> backup created on that specific Wednesday (which unfortunately was deleted after being restored on the test environment). Let me show you a sample code to demonstrate</span><br /><span style="font-family:Arial;"></span></p>
<p><span style="font-size:85%;color:blue;"><strong>USE </strong></span><span style="font-size:85%;color:black;"><strong>master<br />GO</p>
<p></strong></span><span style="font-size:85%;"><strong><span style="color:green;">&#8211;FULL DATABASE BACKUP on Sunday<br /></span><span style="color:blue;">BACKUP DATABASE </span></strong></span><span style="font-size:85%;"><strong><span style="color:black;">AdventureWorks<br /></span><span style="color:blue;">TO DISK = </span></strong></span><span style="font-size:85%;"><strong><span style="color:red;">&#8216;D:AdventureWorks_FULL.BAK&#8217;<br /></span><span style="color:blue;">WITH </span><span style="color:#000099;">INIT</span><span style="color:gray;">, </span><span style="color:black;">FORMAT</span><span style="color:gray;">, </span><span style="color:#000099;">STATS</span><span style="color:blue;">=</span></strong></span><span style="font-size:85%;"><strong><span style="color:black;">10<br />GO</p>
<p></span><span style="color:blue;">USE </span></strong></span><span style="font-size:85%;color:black;"><strong>master<br />GO</p>
<p></strong></span><span style="font-size:85%;"><strong><span style="color:green;">&#8211;FULL DATABASE BACKUP ON Wednesday CREATED BY YOUR DEVELOPERS<br /></span><span style="color:blue;">BACKUP DATABASE </span></strong></span><span style="font-size:85%;"><strong><span style="color:black;">AdventureWorks<br /></span><span style="color:blue;">TO DISK = </span></strong></span><span style="font-size:85%;"><strong><span style="color:red;">&#8216;D:AdventureWorksD.BAK&#8217;<br /></span><span style="color:blue;">WITH </span><span style="color:#000099;">INIT</span><span style="color:gray;">, </span><span style="color:black;">FORMAT</span><span style="color:gray;">, </span><span style="color:#000099;">STATS</span><span style="color:blue;">=</span></strong></span><span style="font-size:85%;"><strong><span style="color:black;">10<br />GO</p>
<p></span><span style="color:blue;">USE </span></strong></span><span style="font-size:85%;color:black;"><strong>master<br />GO</p>
<p></strong></span><span style="font-size:85%;"><strong><span style="color:green;">&#8211;DIFFERENTIAL DATABASE BACKUP AFTER THE LAST FULL BACKUP<br /></span><span style="color:blue;">BACKUP DATABASE </span></strong></span><span style="font-size:85%;"><strong><span style="color:black;">AdventureWorks<br /></span><span style="color:blue;">TO DISK = </span></strong></span><span style="font-size:85%;"><strong><span style="color:red;">&#8216;D:AdventureWorks_DIFF.BAK&#8217;<br /></span><span style="color:blue;">WITH </span><span style="color:black;">DIFFERENTIAL</span><span style="color:gray;">, </span><span style="color:black;">INIT</span><span style="color:gray;">, </span><span style="color:black;">FORMAT</span><span style="color:gray;">, </span><span style="color:black;">STATS</span><span style="color:blue;">=</span></strong></span><span style="font-size:85%;color:black;"><strong>10<br />GO<br /></strong></p>
<p></span><span style="font-size:85%;color:black;"></span><span style="font-size:85%;color:black;"></p>
<p><span style="font-family:arial;font-size:100%;">If you&#8217;re the DBA, you might be thinking that you still have your backup sequence intact and this is what you might have done should you need to restore</span></p>
<p></span></p>
<p></span><strong><span style="color:green;">&#8211;RESTORE SEQUENCE STARTS<br /></span><span style="color:blue;">RESTORE DATABASE </span></strong><strong><span style="color:black;">AdventureWorks<br /></span><span style="color:blue;">FROM DISK = </span></strong><strong><span style="color:red;">&#8216;D:AdventureWorks_FULL.BAK&#8217;<br /></span><span style="color:blue;">WITH </span><span style="color:magenta;">REPLACE</span><span style="color:gray;">, </span><span style="color:#000099;">NORECOVERY</span><span style="color:gray;">, </span><span style="color:#000099;">STATS</span><span style="color:blue;">=</span></strong><span style="color:black;"><strong>10<br />GO</p>
<p></strong></span><strong><span style="color:green;">&#8211;FAIL DUE TO INCONSISTENT RESTORE SEQUENCE<br /></span><span style="color:blue;">RESTORE DATABASE </span></strong><strong><span style="color:black;">AdventureWorks<br /></span><span style="color:blue;">FROM DISK = </span></strong><strong><span style="color:red;">&#8216;D:AdventureWorks_DIFF.BAK&#8217;<br /></span><span style="color:blue;">WITH </span><span style="color:magenta;">REPLACE</span><span style="color:gray;">, </span><span style="color:#000099;">NORECOVERY</span><span style="color:gray;">, </span><span style="color:#000099;">STATS</span><span style="color:blue;">=</span></strong><span style="color:black;"><strong>10<br />GO<br /></strong></span><br /><span style="color:black;"><span style="font-family:arial;">Now, there are a couple of ways to solve this problem. One is to create a trigger on your MSDB database to trap events written on your <strong><span style="font-size:85%;">backupset</span></strong> system table and check for the <strong><span style="font-size:85%;">type</span></strong> column for <strong>D</strong> values. At least you get to be notified for any <strong><span style="font-size:85%;">FULL</span></strong> database backups outside of your normal backup process. In SQL Server 2005, it&#8217;s as easy as using the <strong><span style="font-size:85%;">COPY_ONLY</span></strong> option in the <a href="http://msdn.microsoft.com/en-us/library/ms186865.aspx"><strong><span style="font-size:85%;">BACKUP</span></strong> </a>command. This specifies that the backup is a copy-only backup, which does not affect the normal sequence of backups. Make sure that your operational DBAs and developers who work on SQL Server 2005 know how to use this option whenever thay run ad-hoc backups. Here&#8217;s how to use the <span style="font-size:85%;"><strong>COPY_ONLY</strong></span> clause on your <span style="font-size:85%;"><strong>BACKUP</strong></span> commands (with emphasis on <strong><span style="font-size:85%;">COPY_ONLY</span></strong>)</span></span></p>
<p></span><span style="color:green;">&#8211;FULL DATABASE BACKUP on Wednesday<br /></span><span style="color:blue;">BACKUP DATABASE </span><span style="color:black;">AdventureWorks<br /></span><span style="color:blue;">TO DISK = </span><span style="color:red;">&#8216;D:AdventureWorksD.BAK&#8217;<br /></span><span style="color:blue;">WITH </span><span style="color:#000099;">INIT</span><span style="color:gray;">, </span><span style="color:black;">FORMAT</span><span style="color:gray;">, </span><span style="color:#000099;">STATS</span><span style="color:blue;">=</span><span style="color:black;">10</span><span style="color:gray;">, </span><span style="color:black;"><strong><span style="color:#000099;">COPY_ONLY</span></strong><br />GO<br /></span><span style="color:black;"></span></p>
<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/92377218009570869-5015714173759590495?l=bassplayerdoc.blogspot.com' alt='' /></div>
]]></content:encoded>
			

		<wfw:commentRss>https://www.edwinmsarmiento.com/broken-backup-and-restore-sequence/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
				<post-id xmlns="com-wordpress:feed-additions:1">125</post-id>	</item>
	</channel>
</rss>