BI SQL # 120 : SQL Server DBA Scripts : How to Verify Backup before restoring it !
Hi Geeks,
In this article we are going to cover How to Verify Backup before restoring it !
In this post we are going to discuss following points:
- Problem Statement of SQL Script:
- Description of SQL Script:
- Input Parameter of SQL Script
- SQL Script Code
- SQL Script Output Screenshot
- User Level to execute
Problem Statement of SQL Script:
How to Verify Backup?
Description of SQL Script:
Verify backup- There are some script to check and verify existing database before restoring. SQL Server has provided some Keywords that are mentioning below:-
Verifyonly
Headeronly
Filelistonly
Labelonly
Input Parameter of SQL Script
Back Up File Name : @BackUpFileName
SQL Script Code
DECLARE @BackUpFileName VARCHAR(500) SET @BackUpFileName = 'C:\test.bak' -- - Checks to see that the backup set is complete and that all volumes
are readable RESTORE verifyonly FROM DISK = @BackUpFileName ---Returns a result set containing all the backup header information for all
backup sets on a particular backup device RESTORE headeronly FROM DISK = @BackUpFileName --- Returns a result set containing a list of the database and log files
contained in the backup set. RESTORE filelistonly FROM DISK = @BackUpFileName --sample for error message: RESTORE verifyonly FROM DISK = @BackUpFileName --ingormation and software version information RESTORE LABELONLY FROM DISK = @BackUpFileName
SQL Script Output Screenshot (Exceled and SQL Output)
User Level to execute
100
Hope you will like How to Verify Backup before restoring it !
If you really like reading my blog and understood at least few thing then please don’t forget to subscribe my blog.
If you want daily link and analysis or interesting link go to following website which will give @ your inbox please subscribe our following link resource blog :
For More information related to BI World visit my Mentalist Blog
SQL Server Mentalist >> SQL Learning Blog
Business Intelligence Mentalist >> BI World
Infographic Mentalist >> Image worth explaining thousand Words
Microsoft Mentalist >> MVC,ASP.NET, WCF & LinQ
DBA Mentalist >>Advance SQL Server Blog
Microsoft BI Mentalist >> MS BI Development Update
Connect With me on