January 16, 2014 at 5:27 pm
Hi,
I am planning to automate restoration process of all db's on test server with latest full, diff and log backups. Backup process is automated: means Full backup every 15 days, diff. backup every day at 10AM, log backup every half an hour.
Full backup path -- Eg: c:\fullbackup\dec\fullbackup_dmmyyyy.bak,
Diff backup path -- Eg: D:\Difbackup\Dec\Diffbackup_ddmmyyyy.bak,
Log backup path -- Eg: E:\Logbackup\Dec\Logbackup_ddmmyyyy.bak
Please help me to automate the db restoration through query. Thanks In Advance.
Regards,
January 18, 2014 at 5:16 am
The basic statements you need are the following:
restore database xy from disk = 'g: c:\fullbackup\dec\fullbackup_dmmyyyy.bak' with norecovery
restore database xy from disk = 'g: D:\Difbackup\Dec\Diffbackup_ddmmyyyy.bak' with norecovery
restore database xy from disk = 'E:\Logbackup\Dec\Logbackup_ddmmyyyy.bak' with recovery
Take care with the log backups. If there is more than 1 log backup after the differential backup, you need to restore ALL the log backups, one after another.
Each log backup has to be restored using "with norecovery", for the last restore use "with recovery".
Take a look at books online to get familiar with RESTORE DATABASE statement and its options.
January 20, 2014 at 1:59 am
sorry wrong post
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply