SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


The Importance of Validating Backups


The Importance of Validating Backups

Author
Message
Paul Randal
Paul Randal
SSCertifiable
SSCertifiable (5.9K reputation)SSCertifiable (5.9K reputation)SSCertifiable (5.9K reputation)SSCertifiable (5.9K reputation)SSCertifiable (5.9K reputation)SSCertifiable (5.9K reputation)SSCertifiable (5.9K reputation)SSCertifiable (5.9K reputation)

Group: General Forum Members
Points: 5888 Visits: 1717
Comments posted to this topic are about the item The Importance of Validating Backups

Paul Randal
CEO, SQLskills.com: Check out SQLskills online training!
Blog:www.SQLskills.com/blogs/paul Twitter: @PaulRandal
SQL MVP, Microsoft RD, Contributing Editor of TechNet Magazine
Author of DBCC CHECKDB/repair (and other Storage Engine) code of SQL Server 2005
Divine Flame
Divine Flame
Hall of Fame
Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)

Group: General Forum Members
Points: 3259 Visits: 2816
Thanks Paul for writing such a nice article & clarifying the importance of "WITH CHECKSUM" option when taking the backups! :-)


Sujeet Singh
M&M
M&M
SSCarpal Tunnel
SSCarpal Tunnel (4.7K reputation)SSCarpal Tunnel (4.7K reputation)SSCarpal Tunnel (4.7K reputation)SSCarpal Tunnel (4.7K reputation)SSCarpal Tunnel (4.7K reputation)SSCarpal Tunnel (4.7K reputation)SSCarpal Tunnel (4.7K reputation)SSCarpal Tunnel (4.7K reputation)

Group: General Forum Members
Points: 4689 Visits: 3912
Great stuff as usual by the SQL legend :-)

M&M
Paul Brewer
Paul Brewer
Mr or Mrs. 500
Mr or Mrs. 500 (503 reputation)Mr or Mrs. 500 (503 reputation)Mr or Mrs. 500 (503 reputation)Mr or Mrs. 500 (503 reputation)Mr or Mrs. 500 (503 reputation)Mr or Mrs. 500 (503 reputation)Mr or Mrs. 500 (503 reputation)Mr or Mrs. 500 (503 reputation)

Group: General Forum Members
Points: 503 Visits: 1309
.
Gazareth
Gazareth
SSCertifiable
SSCertifiable (5.7K reputation)SSCertifiable (5.7K reputation)SSCertifiable (5.7K reputation)SSCertifiable (5.7K reputation)SSCertifiable (5.7K reputation)SSCertifiable (5.7K reputation)SSCertifiable (5.7K reputation)SSCertifiable (5.7K reputation)

Group: General Forum Members
Points: 5702 Visits: 6001
Paul Brewer (9/24/2012)
cannot cope with databases with more than 1 data file at the moment.


Hi Paul,
Been working on a similar script myself - I use RESTORE FILELISTONLY to get the data files & also to generate the MOVE statements.

Happy to send you over some code, although it'll probably need modifying to fit your process.
My starting point is the backup files themselves, rather than msdb database.

Cheers
Gaz
Grant Fritchey
Grant Fritchey
SSC Guru
SSC Guru (71K reputation)SSC Guru (71K reputation)SSC Guru (71K reputation)SSC Guru (71K reputation)SSC Guru (71K reputation)SSC Guru (71K reputation)SSC Guru (71K reputation)SSC Guru (71K reputation)

Group: General Forum Members
Points: 71937 Visits: 32910
Well you know I loved this article. I've been ranting about this issue for quite some time. It's nice to have yet another resource to point to in order to try to get the point across. Thanks Paul.

----------------------------------------------------
The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood...
Theodore Roosevelt

The Scary DBA
Author of: SQL Server Query Performance Tuning and SQL Server Execution Plans
Product Evangelist for Red Gate Software
Gazareth
Gazareth
SSCertifiable
SSCertifiable (5.7K reputation)SSCertifiable (5.7K reputation)SSCertifiable (5.7K reputation)SSCertifiable (5.7K reputation)SSCertifiable (5.7K reputation)SSCertifiable (5.7K reputation)SSCertifiable (5.7K reputation)SSCertifiable (5.7K reputation)

Group: General Forum Members
Points: 5702 Visits: 6001
Yes, thanks for the article Paul.

Is there actually an easy way to check the output from DBCC CHECKDB?
I currently scan the SQL log using xp_readerrorlog for the DBCC output info, another way is to use TABLERESULTS clause, and check for the completion line.
However, both methods could be called undocumented - you won't find either in BOL!
charles.wong
charles.wong
Grasshopper
Grasshopper (13 reputation)Grasshopper (13 reputation)Grasshopper (13 reputation)Grasshopper (13 reputation)Grasshopper (13 reputation)Grasshopper (13 reputation)Grasshopper (13 reputation)Grasshopper (13 reputation)

Group: General Forum Members
Points: 13 Visits: 18
Great article.

Is it possible to use DBCC CHECKDB to check the database first before backing up (with all your other recommendations), so that we don't have to restore the backup to perform that test?
chrisfradenburg
chrisfradenburg
SSCrazy
SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)

Group: General Forum Members
Points: 2472 Visits: 2072
I recently talked my boss into getting a drive big enough to restore all of our DBs so we can pull them from tape and do tests on a few each week. Now just comes the job of automating that which is likely to be very fun. It would also appear that we need to do some work to secure our backups a little better.

charles.wong (9/24/2012)
Great article.

Is it possible to use DBCC CHECKDB to check the database first before backing up (with all your other recommendations), so that we don't have to restore the backup to perform that test?


You can run CHECKDB first but there's no guarantee that the DB doesn't get corrupt before the backup is done. It also won't guarantee that the backup file itself doesn't get corrupted. Some people recommend doing an integrity check and if the DB is corrupt not to back it up (assuming that this means you may be deleting the last good backup.) Our process here is to backup the database since we send the backups to another location so we shouldn't be destroying a good backup. It also means that we have a copy of the corrupt DB so if we need to restore we can then do some comparisons to try and recover some of the changes. The thing you need to be careful of is making sure you're not destroying the last good backup because then you have a problem.
Paul Randal
Paul Randal
SSCertifiable
SSCertifiable (5.9K reputation)SSCertifiable (5.9K reputation)SSCertifiable (5.9K reputation)SSCertifiable (5.9K reputation)SSCertifiable (5.9K reputation)SSCertifiable (5.9K reputation)SSCertifiable (5.9K reputation)SSCertifiable (5.9K reputation)

Group: General Forum Members
Points: 5888 Visits: 1717
Glad you all like the article!

Some of the questions:
1) If you can run CHECKDB on the prod system, go for it. But also do the backup/copy/restore/CHECKDB process too. Defense in depth - just like with security.
2) Did CHECKDB complete and find errors? Check the value of @@ERROR afterwards - guarantees to be non-zero if CHECKDB found/had a problem.

Cheers

Paul Randal
CEO, SQLskills.com: Check out SQLskills online training!
Blog:www.SQLskills.com/blogs/paul Twitter: @PaulRandal
SQL MVP, Microsoft RD, Contributing Editor of TechNet Magazine
Author of DBCC CHECKDB/repair (and other Storage Engine) code of SQL Server 2005
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search