Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Verify a database backup using T-SQL Expand / Collapse
Author
Message
Posted Saturday, July 9, 2011 11:51 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Friday, September 12, 2014 2:30 AM
Points: 1,422, Visits: 1,838
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
Post #1139349
Posted Monday, July 11, 2011 3:29 AM
SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Saturday, September 13, 2014 4:06 AM
Points: 988, Visits: 804
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
Post #1139615
Posted Monday, July 11, 2011 3:39 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Friday, September 12, 2014 2:30 AM
Points: 1,422, Visits: 1,838
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
Post #1139625
Posted Monday, July 11, 2011 7:11 AM


SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Today @ 7:17 PM
Points: 884, Visits: 2,489
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
Post #1139725
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse