mutley1
MIS
- Jul 24, 2003
- 909
I have a script that reads the msdb database and compiles the T-SQL for a restore to the last backup (using full / diffs and tran logs). I think many of you would have seen it around - it's Glen Larsen's one kindly posted on databasejournal.com. Quick question (having a blonde moment) - but why does the differential backup have a "replace" command in there?
Cheers,
M.
Cheers,
M.
Code:
RESTORE DATABASE MYDATABASE
from disk =
'C:\MYDATABASE\MYDATABASE_FULL_24_Nov_2006_114913.bak'
WITH
REPLACE, NORECOVERY
go
RESTORE DATABASE MYDATABASE
from disk =
'C:\MYDATABASE\MYDATABASE_DIFF_27_Nov_2006_0945.bak'
WITH REPLACE,
NORECOVERY
go
RESTORE LOG MYDATABASE
FROM DISK =
'C:\MYDATABASE\MYDATABASE_Log_BackUp_27_Nov_2006_094502.bak'
WITH
NORECOVERY
go
RESTORE LOG MYDATABASE
FROM DISK =
'C:\MYDATABASE\MYDATABASE_Log_BackUp_27_Nov_2006_095000.bak'
WITH
RECOVERY
go