SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 

Backup & Restoration Script

By Ashish Gilhotra, 2009/09/16

Total article views: 1063 | Views in the last 30 days: 138

As a SQL Server DBA, many time we takes backup's of our database and restore these backup's as a part of our dail maintanance plan or recovery plan. Sometimes we used to take backup's everyday and some times we forgot to take backup's of databses, so i just get into that thing as write a script for that which tells you about all the databases backup's and relatively there restore information, this script provides you useful information like backup date,how long it takes to run,who takes backup, backup type, size, is ever restored or not, restoration dat and some other very useful information for backup's and restoration process... so here we go with the script

This script takes Databse Name as a paramter by default it is NULL and script throws results for all of the databses but if you want to see the details for any specific database the provide Databse Name with this script.

Here are the little description of columns which we get from this script...

 

BS_Name = Name of BackUp
BS_UserName = Name of User from which BackUp had taken.
backup_start_date = Start Date Time of BackUp
backup_end_date = End Date Time of BackUp
BackUp Type = Type of BackUp
BackUp Size = Size of BackUp File
Dbname = Name of database
ServerName = Name of Server
Physical_Device_Name = name of Drive or Device where backup stored
Is Ever Restored = is BackUp Ever Restore(Yes/No)
Destination Db = Name of Database Restored By BackUp
Restore Path = Path from database restored
Restore type = Type of restoration
restore_date = Date when Database Restored
restore by = User by which database in restored
Time Taken = Total time taken to take Database BackUp

 

Hope this script will be useful for mant peoples who like to see the backup's and restoration details for their Databases.

By Ashish Gilhotra, 2009/09/16

Total article views: 1063 | Views in the last 30 days: 138
Your response
 
 
Related Articles
FORUM

DDL trigger for RESTORE DATABSE

DDL trigger for RESTORE DATABSE

FORUM

restoring a databse with change logs

restoring a databse with change logs

FORUM

Script to restore red gate backups automatically from a folder.

Restore of red gate backup files using a SQL Script

FORUM

Backup/restore

Backup/restore

FORUM

Restore with no backup

Database dropped, no backup. Need to restore

Tags
backup    
restore    
sql    
t-sql    
 
Contribute

Free registration required...

To read the rest of this article, and access thousands of other articles, we ask you to register on the site and subscribe to our newsletters.

Login (existing users)

Login

Email:   Password:   Remember me: Forgotten your password?

Register (new users)

Register

Email:   Password:
Confirm:

Subscribing to our newsletters gets you:

  • ALL of our content (thousands of articles, scripts, and forum postings)
  • A daily newsletter (example)
  • A weekly news round up (example)
  • The opportunity to ask and answer questions in our forums
  • A daily Question of the Day to test and help you increase your knowledge of SQL Server.

Steve Jones
Editor, SQLServerCentral.com