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

Get your favorite SSC scripts directly in SSMS with the free SQL Scripts addin. Search for scripts directly from SSMS, and instantly access any saved scripts in your SSC briefcase from the favorites tab.
Download now (direct download link)

Verify a database backup using T-SQL

By Nakul Vachhrajani,

The RESTORE command provides the facility to very easily validate a backup (taken via SQL Server, not via 3rd party utilities like SQLLite). This T-SQL code can help in ensuring that the backup file is structurally consistent, and therefore helps rule out I/O issues.

The checks performed by RESTORE VERIFYONLY include (per Books On Line):

  • That the backup set is complete and all volumes are readable
  • Some header fields of database pages, such as the page ID (as if it were about to write the data)
  • Checksum (if present on the media)
  • Checking for sufficient space on destination devices

This script has also been published on my blog at: http://beyondrelational.com/blogs/nakul/archive/2011/04/18/a-script-to-verify-a-database-backup.aspx

 

Before running the script, please substitute the backup location and the code for the database files to suit your database configuration.

 

Thank-you,

Nakul Vachhrajani,

Be courteous. Drive responsibly.

http://beyondrelational.com/blogs/nakul/default.aspx

Total article views: 1742 | Views in the last 30 days: 2
 
Related Articles
ARTICLE

Powershell Database Backup Script

Learn how to write a script for regular database backups using Powershell and SMO.

FORUM

xmla script for automate ssas database backup

xmla script for automate ssas database backup

SCRIPT

Script to Check the Database Backup duration

Script to Check the Database Backup duration of entire instances

SCRIPT

Backup & Restoration Script

This script provides very useful information about database backup and restoration.

SCRIPT

Database Backup Information Scripts

Scripts used to validate the backups information as below 1) Database Backups for all databases F...

Tags
administration    
backup/restore    
diagnostic    
script    
t-sql    
 
Contribute