Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Verify a database backup using T-SQL


Verify a database backup using T-SQL

Author
Message
Nakul Vachhrajani
Nakul Vachhrajani
SSCommitted
SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)

Group: General Forum Members
Points: 1824 Visits: 2127
Comments posted to this topic are about the item Verify a database backup using T-SQL

Thanks & Regards,
Nakul Vachhrajani.
http://nakulvachhrajani.com
Be courteous. Drive responsibly.

Follow me on
Twitter: @sqltwins
Google Plus: +Nakul
david.wright-948385
david.wright-948385
Ten Centuries
Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)

Group: General Forum Members
Points: 1059 Visits: 963
No criticism of the article, but I would argue that the only way to verify a backup properly is to restore it fully and perform the usual checks on the restored database. Assuming of course that you can restore it before the next backup arrives :-)
Nakul Vachhrajani
Nakul Vachhrajani
SSCommitted
SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)

Group: General Forum Members
Points: 1824 Visits: 2127
david.wright-948385 (7/11/2011)
No criticism of the article, but I would argue that the only way to verify a backup properly is to restore it fully and perform the usual checks on the restored database. Assuming of course that you can restore it before the next backup arrives :-)


I completely agree. This script is best used to eliminate I/O issues. If the backup file structure is logically corrupt, no point in even attempting a restore. Once we know that no I/O issues exist, then I am with you on the point that the next step should always be a restore followed by the usual checks.

Thanks & Regards,
Nakul Vachhrajani.
http://nakulvachhrajani.com
Be courteous. Drive responsibly.

Follow me on
Twitter: @sqltwins
Google Plus: +Nakul
Shawn Melton
Shawn Melton
Ten Centuries
Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)

Group: General Forum Members
Points: 1099 Visits: 3495
Nakul Vachhrajani (7/11/2011)This script is best used to eliminate I/O issues. If the backup file structure is logically corrupt, no point in even attempting a restore. Once we know that no I/O issues exist, then I am with you on the point that the next step should always be a restore followed by the usual checks.

Using the script RESTORE VERIFYONLY does not eliminate I/O issues or verify the backup file structure. As it states on BOL "RESTORE VERIFYONLY does not attempt to verify the structure of the data contained in the backup volumes". I would think that alone would be it does not eliminate I/O issues.

Even though you are giving it a file to move to, does it actually validate the backup file for I/O consistency? If I give a false path to the MOVE statement you included in your script. It will simply tell me that it cannot use the file path but still gives the message "The backup set on file 1 is valid". If I give it a legit path that does exist it still gives me the same message, "The backup set on file 1 is valid".

How the structure of the data is written during the backup is where your I/O issue can exist, I would think. Following Paul Randal's advice (24p) the best way to confirm your restore is consistent, short of doing an actual restore, is to use VERIFYONLY + WITH CHECKSUM. This will provide a more deeper consistency check on that backup file to see if it is good or not. However you would have to have taken the backup WITH CHECKSUM in order for it to do that check as well.

Shawn Melton
PS C:\>(Find-Me).TwitterURL
@wsmelton
PS C:\>(Find-Me).BlogURL
meltondba.wordpress.com
Iwas Bornready
Iwas Bornready
SSCrazy Eights
SSCrazy Eights (8.7K reputation)SSCrazy Eights (8.7K reputation)SSCrazy Eights (8.7K reputation)SSCrazy Eights (8.7K reputation)SSCrazy Eights (8.7K reputation)SSCrazy Eights (8.7K reputation)SSCrazy Eights (8.7K reputation)SSCrazy Eights (8.7K reputation)

Group: General Forum Members
Points: 8654 Visits: 885
Thanks for the script.
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