<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>SQL Server Storage Engine : Backup</title><link>http://blogs.msdn.com/sqlserverstorageengine/archive/tags/Backup/default.aspx</link><description>Tags: Backup</description><dc:language>en</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>When is too much success a bad thing?</title><link>http://blogs.msdn.com/sqlserverstorageengine/archive/2007/10/30/when-is-too-much-success-a-bad-thing.aspx</link><pubDate>Tue, 30 Oct 2007 19:18:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5783164</guid><dc:creator>kfarlee</dc:creator><slash:comments>4</slash:comments><comments>http://blogs.msdn.com/sqlserverstorageengine/comments/5783164.aspx</comments><wfw:commentRss>http://blogs.msdn.com/sqlserverstorageengine/commentrss.aspx?PostID=5783164</wfw:commentRss><description>&lt;P&gt;I was talking to a customer the other day who had an interesting problem:&amp;nbsp; Successful backups.&lt;/P&gt;
&lt;P&gt;Specifically, their problem had to do with the success messages that SQL backup puts in the SQL errorlog and the system event log.&lt;/P&gt;
&lt;P&gt;Seems like a nice, friendly thing to do right?&amp;nbsp; Drop a note that your backup was successful, note the LSN, etc.&lt;/P&gt;
&lt;P&gt;The problem comes when you do a LOT of backups.&amp;nbsp; In this case, the customer was doing 1 T-log backup per minute on EACH of 5 production databases.&amp;nbsp; That adds up to an errorlog entry every 12 seconds.&amp;nbsp; As you can see, the errorlog very quickly gets bloated with success messages.&amp;nbsp; This in turn causes two issues:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Managing the size of the log itself&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;Finding anything actionable in the flood of success messages.&lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;In this customer's case they had an added complication:&amp;nbsp; They were using a monitoring tool which scanned the SQL errorlog for certain error codes.&amp;nbsp; As it so happens, every so often the LSN noted in a success message just happened to match with some error condition, and the DBA got woken up to deal with his "corrupt database".&lt;/P&gt;
&lt;P&gt;So, I went spelunking, and found a jewel which might save some of you some problems.&lt;/P&gt;
&lt;P&gt;There is a traceflag, 3226, which suppresses these success messages from both the SQL errorlog and the system event log.&amp;nbsp; By enabling this traceflag you will no longer get the flood of success messages in your logs.&amp;nbsp; Of course, if you've implemented some sort of logic which depends on the content of these messages, that would be a bad thing, but for most people who do very frequent backups, this could be an asset.&lt;/P&gt;
&lt;P&gt;This traceflag has been in the product since SQL 2000 so any existing instances can take advantage of it immediately.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Kevin Farlee&lt;/P&gt;
&lt;P&gt;Storage Engine PM&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=5783164" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/sqlserverstorageengine/archive/tags/Disaster+Recovery/default.aspx">Disaster Recovery</category><category domain="http://blogs.msdn.com/sqlserverstorageengine/archive/tags/Backup/default.aspx">Backup</category></item><item><title>Fuzzy backups and RESTORE DATABASE WITH STOPAT</title><link>http://blogs.msdn.com/sqlserverstorageengine/archive/2007/10/26/fuzzy-backups-and-restore-database-with-stopat.aspx</link><pubDate>Sat, 27 Oct 2007 01:25:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5696320</guid><dc:creator>kfarlee</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/sqlserverstorageengine/comments/5696320.aspx</comments><wfw:commentRss>http://blogs.msdn.com/sqlserverstorageengine/commentrss.aspx?PostID=5696320</wfw:commentRss><description>&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face="Times New Roman" size=3&gt;So what’s a “fuzzy backup” and how does it relate to STOPAT?&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;FONT face="Times New Roman" size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face="Times New Roman" size=3&gt;There has been some confusion about what RESTORE DATABASE WITH STOPAT does, if it works, and why it behaves as it does.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;This is not about RESTORE LOG WITH STOPAT, but only RESTORE DATABASE.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;To understand how this works and why, you need to understand the concept of fuzzy backups and how they work at restore time.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face="Times New Roman" size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face="Times New Roman" size=3&gt;When we restore a database backup, we need to end up with all pages in the database at the same effective LSN.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;This is a challenge when you consider that it may take hours to copy all the pages in a very large database.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;BR&gt;&lt;FONT face="Times New Roman" size=3&gt;When a database backup starts, we note the LSN which is the min of:&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoListParagraph style="MARGIN: auto 0in auto 0.5in; TEXT-INDENT: -0.25in; mso-list: l1 level1 lfo1"&gt;&lt;SPAN style="COLOR: #1f497d; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT size=3&gt;·&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT size=3&gt;&lt;FONT face="Times New Roman"&gt;The last checkpoint&lt;SPAN style="COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoListParagraph style="MARGIN: auto 0in auto 0.5in; TEXT-INDENT: -0.25in; mso-list: l1 level1 lfo1"&gt;&lt;SPAN style="COLOR: #1f497d; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT size=3&gt;·&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT size=3&gt;&lt;FONT face="Times New Roman"&gt;Repl-start&lt;SPAN style="COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoListParagraph style="MARGIN: auto 0in auto 0.5in; TEXT-INDENT: -0.25in; mso-list: l1 level1 lfo1"&gt;&lt;SPAN style="COLOR: #1f497d; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT size=3&gt;·&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT size=3&gt;&lt;FONT face="Times New Roman"&gt;The oldest active transaction.&lt;SPAN style="COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face="Times New Roman" size=3&gt;.&lt;BR&gt;We then start copying pages.&amp;nbsp; Some are copied at the beginning of the &lt;BR&gt;backup.&lt;BR&gt;Some may be copied hours later, depending on the size of the database.&lt;BR&gt;In order to restore a database which is self-consistent, when we're done all &lt;BR&gt;the pages need to be at the same effective LSN.&lt;BR&gt;We could do that by locking the database during the backup, but that MIGHT &lt;BR&gt;cause some of you operational problems :)&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;BR&gt;&lt;FONT face="Times New Roman" size=3&gt;What we do instead is note the LSN when the last data copy operation &lt;BR&gt;completes, and copy the portion of the log from the begin backup to the end &lt;BR&gt;backup LSNs into the backup file.&lt;BR&gt;The last stage of a database restore is to use that segment of log to run a &lt;BR&gt;REDO pass to bring all pages up to the state as of the end of the backup.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;BR&gt;&lt;FONT face="Times New Roman" size=3&gt;Getting back to STOPAT:&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face="Times New Roman" size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face="Times New Roman" size=3&gt;A full database backup can only be restored to the time of the end of the &lt;BR&gt;backup.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;That means that you can’t STOPAT a point midway through the backup.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Consider: Some pages were copied after that STOPAT time, so we cannot make the database consistent.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face="Times New Roman" size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face="Times New Roman" size=3&gt;So what good is STOPAT when restoring a database?&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Its purpose is to flag an error if the backup is too recent to be able to reach the STOPAT time.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;For example:&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoListParagraph style="MARGIN: auto 0in auto 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo2"&gt;&lt;SPAN style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT size=3&gt;·&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face="Times New Roman" size=3&gt;Full backup starts at T1&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoListParagraph style="MARGIN: auto 0in auto 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo2"&gt;&lt;SPAN style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT size=3&gt;·&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face="Times New Roman" size=3&gt;User decides to restore database to T0, using a combination of full and log backups.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoListParagraph style="MARGIN: auto 0in auto 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo2"&gt;&lt;SPAN style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT size=3&gt;·&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face="Times New Roman" size=3&gt;If the backup in step 1 is used, the database cannot be restored to T0, so backup throws an error.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face="Times New Roman" size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=5696320" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/sqlserverstorageengine/archive/tags/Disaster+Recovery/default.aspx">Disaster Recovery</category><category domain="http://blogs.msdn.com/sqlserverstorageengine/archive/tags/Backup/default.aspx">Backup</category><category domain="http://blogs.msdn.com/sqlserverstorageengine/archive/tags/Restore/default.aspx">Restore</category></item><item><title>The Ins and Outs of Offline Files</title><link>http://blogs.msdn.com/sqlserverstorageengine/archive/2007/06/02/the-ins-and-outs-of-offline-files.aspx</link><pubDate>Sat, 02 Jun 2007 22:35:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3049487</guid><dc:creator>Paul Randal - MSFT</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/sqlserverstorageengine/comments/3049487.aspx</comments><wfw:commentRss>http://blogs.msdn.com/sqlserverstorageengine/commentrss.aspx?PostID=3049487</wfw:commentRss><description>&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;EM&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;First blog post of the year from TechEd! Well, &lt;A href="http://www.sqlskills.com/blogs/kimberly/" mce_href="http://www.sqlskills.com/blogs/kimberly/"&gt;Kimberly&lt;/A&gt; and I arrived a day early hoping to chill out in the sun by the pool but contrary to all expectations the weather sucks today – it’s actually much better in Seattle.&amp;nbsp;Instead we're hibernating in our&amp;nbsp;room blogging&amp;nbsp;and having a &lt;A class="" href="http://www.blokus.com/index.htm" mce_href="http://www.blokus.com/index.htm"&gt;Blokus&lt;/A&gt; re-match – last time we were in &lt;A href="http://blogs.msdn.com/sqlserverstorageengine/archive/2007/04/06/sswugtv-interview-with-paul-and-kimberly.aspx" mce_href="http://blogs.msdn.com/sqlserverstorageengine/archive/2007/04/06/sswugtv-interview-with-paul-and-kimberly.aspx"&gt;Orlando in March&lt;/A&gt; she beat me soundly so I need to get my revenge :-)&lt;/SPAN&gt;&lt;/EM&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;EM&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;/SPAN&gt;&lt;/EM&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;Over the next few posts I want to touch on some of the issues that have been causing confusion on the &lt;A class="" href="http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=744&amp;amp;SiteID=1" mce_href="http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=744&amp;amp;SiteID=1"&gt;MSDN Disaster Recovery forum&lt;/A&gt;. First up is offline files.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;FONT face="Times New Roman" size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-bidi-font-size: 12.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;One of the cool things you can do in SQL Server 2005 is set a particular file to be offline and then restore just that file from backups. The rest of the database stays online as long as the file isn’t part of the primary filegroup or a transaction log file. This allows you to restore a damaged database file without having to take the whole database offline.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-bidi-font-size: 12.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-bidi-font-size: 12.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;You have to be careful though, depending on what recovery mode the database is in:&lt;/SPAN&gt;&lt;/P&gt;
&lt;UL type=disc&gt;
&lt;LI class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-list: l0 level1 lfo1; tab-stops: list .5in"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;If you’re using simple recovery mode, the file in question has to be part of a &lt;I style="mso-bidi-font-style: normal"&gt;read-only&lt;/I&gt; filegroup and you have to have a backup of the file that was taken &lt;I style="mso-bidi-font-style: normal"&gt;after&lt;/I&gt; the filegroup was made read-only.&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-list: l0 level1 lfo1; tab-stops: list .5in"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;If you’re using full or bulk-logged recovery mode, you have to have a backup of the file &lt;I style="mso-bidi-font-style: normal"&gt;and&lt;/I&gt; a complete transaction log backup chain.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;The main point to emphasize here is that you have to have a backup! Once a file has been set offline, the ONLY way to bring it back online is to restore it from backups. I’ve worked up a simple script that illustrates how to do this.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;Firstly I create a database &lt;I style="mso-bidi-font-style: normal"&gt;offlinefiletest&lt;/I&gt; and add a filegroup with a single file called &lt;I style="mso-bidi-font-style: normal"&gt;damagedfile&lt;/I&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;USE&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt; master&lt;SPAN style="COLOR: gray"&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;GO&lt;SPAN style="COLOR: gray"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;-- create our test database&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;IF&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt; &lt;SPAN style="COLOR: fuchsia"&gt;DATABASEPROPERTY&lt;/SPAN&gt; &lt;SPAN style="COLOR: gray"&gt;(&lt;/SPAN&gt;N&lt;SPAN style="COLOR: red"&gt;'offlinefiletest'&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;,&lt;/SPAN&gt; &lt;SPAN style="COLOR: red"&gt;'Version'&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;)&lt;/SPAN&gt; &lt;SPAN style="COLOR: gray"&gt;&amp;gt;&lt;/SPAN&gt; 0&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DROP&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt; &lt;SPAN style="COLOR: blue"&gt;DATABASE&lt;/SPAN&gt; offlinefiletest&lt;SPAN style="COLOR: gray"&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;GO&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;CREATE&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt; &lt;SPAN style="COLOR: blue"&gt;DATABASE&lt;/SPAN&gt; offlinefiletest &lt;SPAN style="COLOR: blue"&gt;ON&lt;/SPAN&gt; &lt;SPAN style="COLOR: gray"&gt;(&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; NAME&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt; &lt;SPAN style="COLOR: gray"&gt;=&lt;/SPAN&gt; fgt_mdf&lt;SPAN style="COLOR: gray"&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; FILENAME&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt; &lt;SPAN style="COLOR: gray"&gt;=&lt;/SPAN&gt; &lt;SPAN style="COLOR: red"&gt;'c:\offlinefiletest\offlinefiletest.mdf'&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SIZE&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt; &lt;SPAN style="COLOR: gray"&gt;=&lt;/SPAN&gt; 2MB&lt;SPAN style="COLOR: gray"&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: fuchsia; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;LOG&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt; &lt;SPAN style="COLOR: blue"&gt;ON&lt;/SPAN&gt; &lt;SPAN style="COLOR: gray"&gt;(&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; NAME&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt; &lt;SPAN style="COLOR: gray"&gt;=&lt;/SPAN&gt; fgt_log&lt;SPAN style="COLOR: gray"&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; FILENAME&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt; &lt;SPAN style="COLOR: gray"&gt;=&lt;/SPAN&gt; &lt;SPAN style="COLOR: red"&gt;'c:\offlinefiletest\offlinefiletest.ldf'&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SIZE&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt; &lt;SPAN style="COLOR: gray"&gt;=&lt;/SPAN&gt; 1MB&lt;SPAN style="COLOR: gray"&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;GO&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;-- Add a filegroup with a single file&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;ALTER&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt; &lt;SPAN style="COLOR: blue"&gt;DATABASE&lt;/SPAN&gt; offlinefiletest &lt;SPAN style="COLOR: blue"&gt;ADD&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;FILEGROUP&lt;/SPAN&gt; offlinefg&lt;SPAN style="COLOR: gray"&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;GO&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;ALTER&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt; &lt;SPAN style="COLOR: blue"&gt;DATABASE&lt;/SPAN&gt; offlinefiletest &lt;SPAN style="COLOR: blue"&gt;ADD&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;FILE&lt;/SPAN&gt; &lt;SPAN style="COLOR: gray"&gt;(&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; NAME&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt; &lt;SPAN style="COLOR: gray"&gt;=&lt;/SPAN&gt; damagedfile&lt;SPAN style="COLOR: gray"&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; FILENAME&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt; &lt;SPAN style="COLOR: gray"&gt;=&lt;/SPAN&gt; &lt;SPAN style="COLOR: red"&gt;'c:\offlinefiletest\damagedfile.ndf'&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SIZE&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt; &lt;SPAN style="COLOR: gray"&gt;=&lt;/SPAN&gt; 512KB&lt;SPAN style="COLOR: gray"&gt;)&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;TO&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;FILEGROUP&lt;/SPAN&gt; offlinefg&lt;SPAN style="COLOR: gray"&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;GO&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;Next I take a full database backup and a transaction log backup. Note that I’m using the CHECKSUM options – see my previous blog post &lt;A href="http://blogs.msdn.com/sqlserverstorageengine/archive/2007/04/17/example-corrupt-database-to-play-with.aspx" mce_href="http://blogs.msdn.com/sqlserverstorageengine/archive/2007/04/17/example-corrupt-database-to-play-with.aspx"&gt;here&lt;/A&gt; for more info on these.&lt;SPAN style="COLOR: green"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;BACKUP&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt; &lt;SPAN style="COLOR: blue"&gt;DATABASE&lt;/SPAN&gt; offlinefiletest &lt;SPAN style="COLOR: blue"&gt;TO&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DISK&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt; &lt;SPAN style="COLOR: gray"&gt;=&lt;/SPAN&gt; &lt;SPAN style="COLOR: red"&gt;'c:\offlinefiletest\offlinefiletest.bak'&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; WITH&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt; INIT&lt;SPAN style="COLOR: gray"&gt;,&lt;/SPAN&gt; &lt;SPAN style="COLOR: fuchsia"&gt;CHECKSUM&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;GO&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;BACKUP&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt; &lt;SPAN style="COLOR: fuchsia"&gt;LOG&lt;/SPAN&gt; offlinefiletest &lt;SPAN style="COLOR: blue"&gt;TO&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DISK&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt; &lt;SPAN style="COLOR: gray"&gt;=&lt;/SPAN&gt; &lt;SPAN style="COLOR: red"&gt;'c:\offlinefiletest\offlinefiletest_log.bak'&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; WITH&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt; INIT&lt;SPAN style="COLOR: gray"&gt;,&lt;/SPAN&gt; &lt;SPAN style="COLOR: fuchsia"&gt;CHECKSUM&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;GO&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;Now I set the &lt;I style="mso-bidi-font-style: normal"&gt;damagedfile&lt;/I&gt; offline and check the &lt;I style="mso-bidi-font-style: normal"&gt;sys.database_files&lt;/I&gt; system catalog view to ensure the file has been taken offline.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;ALTER&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt; &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;DATABASE&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt; offlinefiletest &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;MODIFY FILE &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;(&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;NAME &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;=&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt; damagedfile&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;,&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt; OFFLINE&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;GO&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;-- Check the file state in the system catalog&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;SELECT&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt; &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: fuchsia; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;file_id&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: fuchsia; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CONVERT&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt; &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;(&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;CHAR &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;(&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;15&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;),&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt; &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: fuchsia; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;RTRIM&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt; &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;(&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;name&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;))&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt; AS name&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: fuchsia; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CONVERT&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt; &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;(&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;CHAR &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;(&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;15&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;),&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt; &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: fuchsia; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;RTRIM&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt; &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;(&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;state_desc&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;))&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt; AS state&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;FROM&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt; offlinefiletest&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;.&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;sys.database_files &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;WHERE name &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;=&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt; &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;'damagedfile'&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;GO&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;And we get back:&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 7.5pt; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;file_id&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; name&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; state&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 7.5pt; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;-----------&amp;nbsp;&amp;nbsp;&amp;nbsp;---------------&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ---------------&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 7.5pt; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;damagedfile&amp;nbsp;&amp;nbsp; OFFLINE &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;There are a bunch of states that a file can be in – the full list is in the Books Online entry for &lt;I style="mso-bidi-font-style: normal"&gt;sys.database_files&lt;/I&gt;. Ok – so our file is offline. Let’s try setting it online again.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;ALTER&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt; &lt;SPAN style="COLOR: blue"&gt;DATABASE&lt;/SPAN&gt; offlinefiletest MODIFY &lt;SPAN style="COLOR: blue"&gt;FILE&lt;/SPAN&gt; &lt;SPAN style="COLOR: gray"&gt;(&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;NAME&lt;/SPAN&gt; &lt;SPAN style="COLOR: gray"&gt;=&lt;/SPAN&gt; offlinefile&lt;SPAN style="COLOR: gray"&gt;,&lt;/SPAN&gt; ONLINE&lt;SPAN style="COLOR: gray"&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;GO&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;And we get back:&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 7.5pt; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;Msg 155, Level 15, State 1, Line 4&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 7.5pt; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;'ONLINE' is not a recognized CREATE/ALTER DATABASE option.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;That’s because there’s no T-SQL syntax to explicitly set a file online – you HAVE to restore it from a backup. Let’s see what our backup contains using:&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;RESTORE&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt; FILELISTONLY &lt;SPAN style="COLOR: blue"&gt;FROM&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;DISK&lt;/SPAN&gt; &lt;SPAN style="COLOR: gray"&gt;=&lt;/SPAN&gt; &lt;SPAN style="COLOR: red"&gt;'c:\offlinefiletest\offlinefiletest.bak'&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;GO&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;It has all three files. We’ll start the restore process by specifying which file we want to restore and also giving the NORECOVERY option – this allows us to restore subsequent log backups too.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;RESTORE&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt; &lt;SPAN style="COLOR: blue"&gt;DATABASE&lt;/SPAN&gt; offlinefiletest&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;FILE&lt;/SPAN&gt; &lt;SPAN style="COLOR: gray"&gt;=&lt;/SPAN&gt; &lt;SPAN style="COLOR: red"&gt;'damagedfile'&lt;/SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;FROM&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt; &lt;SPAN style="COLOR: blue"&gt;DISK&lt;/SPAN&gt; &lt;SPAN style="COLOR: gray"&gt;=&lt;/SPAN&gt; &lt;SPAN style="COLOR: red"&gt;'c:\offlinefiletest\offlinefiletest.bak'&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;WITH&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt; NORECOVERY&lt;SPAN style="COLOR: gray"&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;GO&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;Now we’ve started the restore process, let’s check the state of the file again using the same &lt;I style="mso-bidi-font-style: normal"&gt;sys.database_files&lt;/I&gt; query as above. We get the following results:&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 7.5pt; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;file_id&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; name&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; state&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 7.5pt; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;-----------&amp;nbsp;&amp;nbsp;&amp;nbsp;---------------&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ---------------&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 7.5pt; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;damagedfile&amp;nbsp;&amp;nbsp;&amp;nbsp;RESTORING &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;The file is now listed as RESTORING. We complete the restore process by restoring all the log backups in the backup chain (in our case only one):&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;RESTORE&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt; &lt;SPAN style="COLOR: fuchsia"&gt;LOG&lt;/SPAN&gt; offlinefiletest &lt;SPAN style="COLOR: blue"&gt;FROM DISK&lt;/SPAN&gt; &lt;SPAN style="COLOR: gray"&gt;=&lt;/SPAN&gt; &lt;SPAN style="COLOR: red"&gt;'c:\offlinefiletest\offlinefiletest_log.bak'&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;WITH&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt; RECOVERY&lt;SPAN style="COLOR: gray"&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;GO&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;And now if we check the &lt;I style="mso-bidi-font-style: normal"&gt;sys.database_files&lt;/I&gt; system catalog view again we should see that the file is online again:&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 7.5pt; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;file_id&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; name&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; state&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 7.5pt; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;-----------&amp;nbsp;&amp;nbsp;&amp;nbsp;---------------&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ---------------&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 7.5pt; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;damagedfile&amp;nbsp;&amp;nbsp; ONLINE &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;It is - success!!&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;Bottom line here – this is a powerful feature that allows for much better availability in the event of a disaster BUT you must be setup to use it. As with all features, especially around disaster recovery, make sure you know the requirements and limitations for successful use. I've attached the complete script for you to play with.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'"&gt;Ok – now there’s a little bit of blue sky – chill time! Hope to see a bunch of you during the week – see &lt;A href="http://blogs.msdn.com/sqlserverstorageengine/archive/2007/05/15/first-teched-of-the-year-coming-up.aspx" mce_href="http://blogs.msdn.com/sqlserverstorageengine/archive/2007/05/15/first-teched-of-the-year-coming-up.aspx"&gt;here&lt;/A&gt; for a list of what we’re up to session-wise.&lt;/SPAN&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=3049487" width="1" height="1"&gt;</description><enclosure url="http://blogs.msdn.com/sqlserverstorageengine/attachment/3049487.ashx" length="2441" type="application/octet-stream" /><category domain="http://blogs.msdn.com/sqlserverstorageengine/archive/tags/Disaster+Recovery/default.aspx">Disaster Recovery</category><category domain="http://blogs.msdn.com/sqlserverstorageengine/archive/tags/Backup/default.aspx">Backup</category><category domain="http://blogs.msdn.com/sqlserverstorageengine/archive/tags/Restore/default.aspx">Restore</category></item><item><title>Can you mix-n-match backup devices?</title><link>http://blogs.msdn.com/sqlserverstorageengine/archive/2007/04/22/mix-n-match-backup-devices.aspx</link><pubDate>Mon, 23 Apr 2007 03:15:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2238729</guid><dc:creator>Paul Randal - MSFT</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/sqlserverstorageengine/comments/2238729.aspx</comments><wfw:commentRss>http://blogs.msdn.com/sqlserverstorageengine/commentrss.aspx?PostID=2238729</wfw:commentRss><description>&lt;P&gt;I was asked this question yesterday and didn't know the answer so thought it would be good for a quick post. Can you use devices from your main and mirrored backup media sets together to perform a restore?&lt;/P&gt;
&lt;P&gt;The code below creates a single-device backup and then examines it.&lt;/P&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;BACKUP&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;DATABASE&lt;/FONT&gt;&lt;FONT size=2&gt; AdventureWorks&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;TO&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;DISK&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt; N&lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;'c:\mediaset1device1.bck'&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;WITH&lt;/FONT&gt;&lt;FONT size=2&gt; FORMAT&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;,&lt;/FONT&gt;&lt;FONT size=2&gt; STATS&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;
&lt;P&gt;GO&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;RESTORE&lt;/FONT&gt;&lt;FONT size=2&gt; HEADERONLY &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;FROM&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;DISK&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;N&lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;'c:\mediaset1device1.bck'&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;
&lt;P&gt;GO&lt;/P&gt;&lt;/FONT&gt;
&lt;P&gt;The &lt;EM&gt;BackupSize&lt;/EM&gt; in the output is 172,044,800 bytes and the on-disk size of the file is 164MB. Now let's use two devices and see what happens.&lt;/P&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;BACKUP&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;DATABASE&lt;/FONT&gt;&lt;FONT size=2&gt; AdventureWorks&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;TO&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;DISK&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;N&lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;'c:\mediaset1device1.bck'&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;,&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;DISK&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;N&lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;'c:\mediaset1device2.bck'&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;
&lt;P&gt;MIRROR &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;TO&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;DISK&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;N&lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;'c:\mediaset2device1.bck'&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;,&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;DISK&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;N&lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;'c:\mediaset2device2.bck'&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;WITH&lt;/FONT&gt;&lt;FONT size=2&gt; FORMAT&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;,&lt;/FONT&gt;&lt;FONT size=2&gt; STATS&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;
&lt;P&gt;GO&lt;/P&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;RESTORE&lt;/FONT&gt;&lt;FONT size=2&gt; HEADERONLY &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;FROM&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;DISK&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;N&lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;'c:\mediaset1device1.bck'&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;
&lt;P&gt;GO&lt;/P&gt;&lt;/FONT&gt;
&lt;P&gt;&lt;/FONT&gt;The &lt;EM&gt;BackupSize&lt;/EM&gt; is now 344,113,152 bytes (roughly double what it was previously because we've mirrored the whole backup) and the on-disk size of each file is 82MB (half of what it was for a single-device). This proves that the backup has been split over the two devices. Now let's try to mix devices from the two backup media sets and see if it's possible:&lt;/P&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;RESTORE&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;DATABASE&lt;/FONT&gt;&lt;FONT size=2&gt; AdventureWorks&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;FROM&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;DISK&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;N&lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;'c:\mediaset1device1.bck'&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;,&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;DISK&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;N&lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;'c:\mediaset2device2.bck'&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;WITH&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff00ff size=2&gt;REPLACE&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;,&lt;/FONT&gt;&lt;FONT size=2&gt; STATS&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;
&lt;P&gt;GO&lt;/P&gt;&lt;/FONT&gt;
&lt;P&gt;And it works fine - excellent! That's the whole point of having mirrored backups.&lt;/P&gt;
&lt;P&gt;The second part of the question was about whether backup device types can differ between media sets in the same backup. The answer to this is no - as documented in Books Online. All the backup devices involved in a single backup, regardless of whether they're part of a mirror media set or not, must be of the same type and have similar characteristics.&lt;/P&gt;
&lt;P&gt;Next up - can it hurt to have thousands of filegroups?&lt;FONT size=2&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=2238729" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/sqlserverstorageengine/archive/tags/Backup/default.aspx">Backup</category><category domain="http://blogs.msdn.com/sqlserverstorageengine/archive/tags/Restore/default.aspx">Restore</category><category domain="http://blogs.msdn.com/sqlserverstorageengine/archive/tags/VLDB+Maintenance/default.aspx">VLDB Maintenance</category></item><item><title>Oh no – my backup is corrupt too! Help!</title><link>http://blogs.msdn.com/sqlserverstorageengine/archive/2007/03/05/oh-no-my-backup-is-corrupt-too-help.aspx</link><pubDate>Tue, 06 Mar 2007 00:59:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1812450</guid><dc:creator>Paul Randal - MSFT</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/sqlserverstorageengine/comments/1812450.aspx</comments><wfw:commentRss>http://blogs.msdn.com/sqlserverstorageengine/commentrss.aspx?PostID=1812450</wfw:commentRss><description>&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;Funny how a bunch of people all seem to have the same problem at the same time. Maybe it’s just that people don’t want to talk about corruption until someone else does – it’s like a dark secret that once let out of the bag – everyone talks. The common HA/DR issue over the last few days on the newsgroups and forums seems to be not just data corruption but backup corruption too.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;It goes back to the statement that &lt;EM&gt;you don’t have a backup until you’ve done a restore&lt;/EM&gt;. What do I mean by that? I don’t mean you need to restore it back over the original database, but unless you’ve checked the validity of the backup, how do you know it’s going to work in a disaster recovery situation?&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;You really want to check two things:&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;
&lt;DIV class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;The integrity of the database being backed up&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;The integrity of the backup file itself&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/LI&gt;&lt;/OL&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;Check #1 is easy – run some form of DBCC consistency checks &lt;STRONG&gt;before&lt;/STRONG&gt; taking a full backup – otherwise you may be backing up a corrupt database. In fact, I was just dealing with a customer who unfortunately had PFS page header corruption (which cannot be repaired through DBCC) in their database and then found out that it was also in their backup. Their choice then became restoring from a week-old backup or exporting all data into a new database – neither of which is particularly palatable…&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;Sometimes it may not be possible to run CHECKDB on the source database - commonly on VLDB systems or system with high, continuous workload where the extra overhead required cannot be tolerated for the length of the CHECKDB. In that case, consider running CHECKDB on a restored copy of the database. This not only proves to you that the backup is valid (because it restores correctly) but that the source database was not corrupt at the time the backup was taken. This is a common strategy on systems that where CHECKDB cannot be run. The only problem with this approach is – what does it mean if the CHECKDB comes back with errors? You can’t tell whether the restored database or the source database is corrupt so you’re &lt;EM&gt;forced&lt;/EM&gt; to go back to the source database and run another CHECKDB. Either way – you’ve successfully caught some corruption before it has a chance to really bite you.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;I’ve just explained a component of check #2 – validating the backup. The other thing to do before doing the backup in SQL Server 2005 is choosing to use the WITH CHECKSUM option on the backup command. This will do two things while the backup is being taken:&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;
&lt;DIV class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;Evaluate and check all existing page checksums or torn-page protection on database pages as they’re read&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;Calculate a checksum over the whole backup stream and save it in the backup&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;This can help ensure that the database being backed up doesn’t have any corruption caused by the IO-subsystem.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;Once the backup is taken, it’s possible to verify all of this without actually writing out anything – using RESTORE … WITH VERIFYONLY. This will do everything short of writing bytes to disk, including rechecking any existing page checksums or torn-page protection on pages in the backup and recalculating and checking the checksum on the entire backup.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;So, there’s a lot you can do to cut down on the likelihood of having a corrupt backup when the time comes to use it. Now – what happens if you get into the situation from the title of this post – the database AND the backup are corrupt?&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;Well, many people would throw up their hands in despair, but there is one thing you can do – allow the restore to ignore errors. There’s an option on restore called CONTINUE_AFTER_ERROR which will let the restore continue even if page checksum failure or corruptions in the backup stream are found. The catch is that the database may be inconsistent afterwards so you’ll need to work out what data is corrupt and do an export/import or run repair. In the best scenario, the only corruptions needing repair will be in non-clustered indexes, in which case you can rebuild them or allow repair to fix them up. In the worst scenario, the corruptions will be in the base table data, you’ll need to use REPAIR_ALLOW_DATA_LOSS; however, this may still be better than not being able to restore the backup at all.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;Bottom line – make sure you validate your backups after you take them so you don’t get into a difficult situation. Also, be sure to keep more than one business cycle’s worth of backups (not just the last week – but maybe the last month) so that if a backup becomes bad later (through tape degradation, etc), you will have other options for restore and recovery.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1812450" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/sqlserverstorageengine/archive/tags/DBCC/default.aspx">DBCC</category><category domain="http://blogs.msdn.com/sqlserverstorageengine/archive/tags/Disaster+Recovery/default.aspx">Disaster Recovery</category><category domain="http://blogs.msdn.com/sqlserverstorageengine/archive/tags/Backup/default.aspx">Backup</category><category domain="http://blogs.msdn.com/sqlserverstorageengine/archive/tags/Restore/default.aspx">Restore</category></item><item><title>What Master???</title><link>http://blogs.msdn.com/sqlserverstorageengine/archive/2006/09/26/772550.aspx</link><pubDate>Tue, 26 Sep 2006 20:18:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:772550</guid><dc:creator>kfarlee</dc:creator><slash:comments>7</slash:comments><comments>http://blogs.msdn.com/sqlserverstorageengine/comments/772550.aspx</comments><wfw:commentRss>http://blogs.msdn.com/sqlserverstorageengine/commentrss.aspx?PostID=772550</wfw:commentRss><description>&lt;P&gt;I've come across a few interesting DR scenarios lately, (interesting in the sense that the resolution wasn't immediately obvious, and fortunately the answer didn't start out with "update your resume...")&lt;/P&gt;
&lt;P&gt;The situation that comes to mind is a customer who was doing all the right things.&lt;/P&gt;
&lt;P&gt;He had a disaster recovery plan.&amp;nbsp; He had written scripts to implement the steps so there wouldn't be mistakes in the heat of the moment.&amp;nbsp; HE WAS TESTING HIS PLAN (kudos) when he discovered the issue here:&lt;/P&gt;
&lt;P&gt;His plan included backing up all user databases, as well as the system DBs, and then using a 3rd-party backup program to protect the system as a whole, providing one-button bare metal restore.&amp;nbsp; Sounds like a great plan, right?&amp;nbsp; What could go wrong?&lt;/P&gt;
&lt;P&gt;The plan and the SQL scripts worked perfectly when he tested them out on a running system.&amp;nbsp; Unfortunately, when he tested the end-to-end bare metal restore, SQL wouldn't come up.&amp;nbsp; There was an error message about Master being corrupt which prevented the instance from starting.&lt;/P&gt;
&lt;P&gt;No problem!&amp;nbsp; We've got a backup of Master right here.&amp;nbsp; Just restore it and we're on the road to recovery...&amp;nbsp; Well, almost.&amp;nbsp; The catch is that you have to have the instance running in single-user mode in order to restore master.&amp;nbsp; That means it has to be running.&amp;nbsp; In order for the instance to run, you need at least some viable copy of Master in place.&amp;nbsp; Catch 22, right?&lt;/P&gt;
&lt;P&gt;Fortunately, there is a solution.&amp;nbsp; Setup provides a mechanism to recreate the system datbases without reinstalling all of the SQL binaries, but it's not obvious how to find it in BOL.&amp;nbsp; The magic incantation turns out to be:&lt;/P&gt;
&lt;P&gt;start /wait &amp;lt;CD or DVD Drive&amp;gt;\setup.exe /qn INSTANCENAME=&amp;lt;Instance&amp;gt; REINSTALL=SQL_Engine REBUILDDATABASE=1 SAPWD=&amp;lt;NewStrongPassword&amp;gt;&lt;/P&gt;
&lt;P&gt;From there, you'll have a running instance with no user databases and all default settings.&amp;nbsp; You can then restore master, msdb, model, and the rest of your databases and be on the road.&lt;/P&gt;
&lt;P&gt;For our friend, there was an additional complication:&amp;nbsp; He was running Express.&amp;nbsp; The reason that this complicated matters is that Express is normally installed by downloading the compressed installer, which expands itself, runs the installation, and then cleans up the install files.&amp;nbsp; Unfortunately, with the command above, MSI is going to look for the .MSI files in the location that SQL was installed from, which no longer exists, since it was cleaned up...&lt;/P&gt;
&lt;P&gt;So, there are a couple of extra steps:&amp;nbsp; First is to download the Express kit, and extract the contents to a local directory.&amp;nbsp; This is done by saving the SQLEXPRESS.EXE file and NOT running it from the download prompt.&amp;nbsp; Instead, after the download completes, manually run the program with the -x switch. i.e. D:\Expressdir\SQLEXPRESS.EXE -x&lt;/P&gt;
&lt;P&gt;This results in the setup files being extracted, but no other steps are taken.&amp;nbsp; Now we need to instruct MSI to use these files and not the remembered location when rebuilding the databases.&amp;nbsp; This is done by adding the REINSTALLMODE=vomus option to the command:&lt;/P&gt;
&lt;P&gt;start /wait &amp;lt;CD or DVD Drive&amp;gt;\setup.exe /qn INSTANCENAME=SQLExpress REINSTALL=SQL_Engine REBUILDDATABASE=1 SAPWD=&amp;lt;NewStrongPassword&amp;gt; REINSTALLMODE=vomus&lt;/P&gt;
&lt;P&gt;And it's just that easy!&lt;/P&gt;
&lt;P&gt;Next time I'll talk about a more disastrous situation and the desperate measures required to deal with it.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=772550" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/sqlserverstorageengine/archive/tags/Disaster+Recovery/default.aspx">Disaster Recovery</category><category domain="http://blogs.msdn.com/sqlserverstorageengine/archive/tags/Backup/default.aspx">Backup</category><category domain="http://blogs.msdn.com/sqlserverstorageengine/archive/tags/Restore/default.aspx">Restore</category></item><item><title>Why you should NOT optimize your backup strategy for backup speed</title><link>http://blogs.msdn.com/sqlserverstorageengine/archive/2006/06/19/Kevin-Farlee.aspx</link><pubDate>Tue, 20 Jun 2006 07:50:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:637456</guid><dc:creator>kfarlee</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.msdn.com/sqlserverstorageengine/comments/637456.aspx</comments><wfw:commentRss>http://blogs.msdn.com/sqlserverstorageengine/commentrss.aspx?PostID=637456</wfw:commentRss><description>&lt;P&gt;Sounds kinda funny, doesn't it?&amp;nbsp; I mean, who here doesn't have someone breathing down your neck every time you go past your backup window?&amp;nbsp; So why would you NOT optimize for fast backups?&amp;nbsp; It just makes sense.&amp;nbsp; You do backups every day, so they should be optimized.&lt;/P&gt;
&lt;P&gt;Two&amp;nbsp;words:&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#ff0000&gt;&lt;STRONG&gt;Disaster Recovery&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#000000&gt;If you think people get cranky when you go 20 minutes past your backup window, try taking 2 days to get your mission-critical database back on the air!&amp;nbsp; That kind of attention is not pleasant.&amp;nbsp; &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;What I'm trying to get across is that you really want to think through your DR strategy from the standpoint of a recovery plan instead of a backup plan.&amp;nbsp; Plan exactly how you will recover in different scenarios.&amp;nbsp; Work out the most efficient way to get back in the air from every situation you can think of.&amp;nbsp; Then work back and make sure that you have a backup strategy that gives you the building blocks you'll need to accomplish those plans.&lt;/P&gt;
&lt;P&gt;That's not to say that you can't have both; It is entirely possible to come up with a plan which minizes both backup and restore time.&amp;nbsp; You just have to plan it that way.&amp;nbsp; The extreme example is the person who does a full backup once a month, and LOTS of log backups in between.&amp;nbsp; Log backups are quick, right?&amp;nbsp; So, the backup strategy is optimal, right?&amp;nbsp; But it would be a nightmare applying all of those log backups to recover from a disaster.&lt;/P&gt;
&lt;P&gt;With SQL Server 2005 Enterprise, there are lots of features that allow higher availability and faster recovery, and they should be looked into.&amp;nbsp; One Example:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Partial Database Availability &lt;/STRONG&gt;This is huge!&amp;nbsp; In a nutshell, this feature means that as soon as your primary filegroup is online, your database is available.&amp;nbsp; Obviously, only those filegroups which are online can be accessed, but at least you can work with whatever is online.&amp;nbsp; What this looks like in a DR situation is this:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Restore and roll forward your primary filegroup, and the minimal set of additional filegroups required to get your most important app running.&lt;/LI&gt;
&lt;LI&gt;At this point, your most critical customers are already online.&lt;/LI&gt;
&lt;LI&gt;Then, at your leisure, restore/roll forward additional filegroups containing less critical data such as historical records.&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;In this way you can get back on the air far quicker than what it would take to restore your entire 2TB database.&amp;nbsp; Unless you plan ahead and break your database up into appropriate filegroups, this won't work for you.&lt;/P&gt;
&lt;P&gt;The point to all this is to encourage you to plan &lt;STRONG&gt;and rehearse &lt;/STRONG&gt;disaster recovery&amp;nbsp;&lt;STRONG&gt;before&lt;/STRONG&gt; the lights go out and everyone is in headless-chicken mode.&amp;nbsp; Rational decisions are rarely made in a panic.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Kevin Farlee&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=637456" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/sqlserverstorageengine/archive/tags/Disaster+Recovery/default.aspx">Disaster Recovery</category><category domain="http://blogs.msdn.com/sqlserverstorageengine/archive/tags/Backup/default.aspx">Backup</category><category domain="http://blogs.msdn.com/sqlserverstorageengine/archive/tags/Restore/default.aspx">Restore</category></item><item><title>Just why are you backing up your database?</title><link>http://blogs.msdn.com/sqlserverstorageengine/archive/2006/06/15/632304.aspx</link><pubDate>Thu, 15 Jun 2006 17:35:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:632304</guid><dc:creator>kfarlee</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.msdn.com/sqlserverstorageengine/comments/632304.aspx</comments><wfw:commentRss>http://blogs.msdn.com/sqlserverstorageengine/commentrss.aspx?PostID=632304</wfw:commentRss><description>&lt;P&gt;So, I'd like to make a couple of assertions about backup and disaster recovery that will hopefully get you to thinking, and just might change the way you think about the topic.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;There are two distinct motivations for doing backups, and they imply differing requirements and solutions.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;OK, what am I talking about?&amp;nbsp; Ask yourself the question, as obvious as it seems, "Why do you take backups every night?"&amp;nbsp; I'm sure you'll come up with lots of answers, but if you think about it, they fall into two classes:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Disaster Recovery 
&lt;LI&gt;Archiving and records retention&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;I will argue that these are very different requirements.&amp;nbsp; For the first case, if you are doing a backup for DR purposes, you almost &lt;EM&gt;always&lt;/EM&gt; want the very most recent version of the database that you can get.&amp;nbsp; 1 ms before the disk crashed, or before the user hit COMMIT on that DROP TABLE where he thought he was in the test DB would be perfect.&lt;/P&gt;
&lt;P&gt;I have rarely if ever seen a requirement to recover from a catastrophic outage from data that's over a week old.&amp;nbsp; So, this implies that you may not need to keep this class of backups around for long, but they must be very quickly available.&lt;/P&gt;
&lt;P&gt;In the second case, you do need to keep the backups around for a long time.&amp;nbsp; In some cases, a VERY long time.&amp;nbsp; But, for archival purposes, they really don't need to be so fine-grained.&amp;nbsp; If you need the database from Q1 2005, you probably don't need to see it in 12 hour increments for every day in the quarter. Typically, your business cycles will dictate that there are distinct times&amp;nbsp;from&amp;nbsp;which you may need to see the data.&lt;/P&gt;
&lt;P&gt;So, how can this be exploited?&lt;/P&gt;
&lt;P&gt;If you separate the two backup requirements, you can come up with solutions for DR like disk snapshots or simply keeping the backups on spinning (disk) media for a week or so, where this would clearly not be economically feasible for archival purposes.&lt;/P&gt;
&lt;P&gt;On the other hand, for archival purposes, you might be able to get away with far less frequent backups, something which would clearly not be acceptable for DR purposes.&lt;/P&gt;
&lt;P&gt;You can see then, that you can combine these to come up with strategies which give you very fast (in some cases instantaneous) backups, very fast restores, and far less time spent in taking archival copies of your database.&lt;/P&gt;
&lt;P&gt;Kevin Farlee&lt;/P&gt;
&lt;P&gt;SQL Storage Engine PM&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=632304" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/sqlserverstorageengine/archive/tags/Disaster+Recovery/default.aspx">Disaster Recovery</category><category domain="http://blogs.msdn.com/sqlserverstorageengine/archive/tags/Backup/default.aspx">Backup</category></item></channel></rss>