Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 How do i restore differential database backup

Author  Topic 

rudba
Constraint Violating Yak Guru

415 Posts

Posted - 2009-05-08 : 16:54:28

Hello Everybody,

I have following script to full database backup, differential database and transaction log backup.

I can restore full database backup but i can not restore differential database. How do i restore differential database? My full backup script runs a week and differential database runs twice a week.

I got the following errower while restore differential database:

Msg 3117, Level 16, State 1, Line 1
The log or differential backup cannot be restored because no files are ready to rollforward.
Msg 3013, Level 16, State 1, Line 1
RESTORE DATABASE is terminating abnormally.




--Full Backup
BACKUP DATABASE [dbPCInfo] TO DISK = N'D:\Db\MyDb_Full.BAK' WITH NOFORMAT, NOINIT, NAME = N'MyDb-Full Database Backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10
GO
--Diff Differential
BACKUP DATABASE [MyDb] TO DISK = N'D:\Db\MyDb_05062009_Diff.BAK' WITH DIFFERENTIAL , NOFORMAT, NOINIT, NAME = N'MyDb-Differential Database Backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10
GO
--Transaction Log Backup
BACKUP LOG [dbPCInfo] TO DISK = N'D:\Db\MyDb_05062009_.TRN' WITH NOFORMAT, NOINIT, NAME = N'MyDb-Transaction Log Backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10
GO
--Restore Full Backup
RESTORE DATABASE [dbPCInfo] FROM DISK = N'D:\Db\MyDb_Full.BAK' WITH FILE = 1, NOUNLOAD, STATS = 10
GO

--Restore Differential Backup
RESTORE DATABASE [MyDb] FROM DISK = N'D:\Db\MyDb_05062009_Diff.BAK' WITH FILE = 1, NOUNLOAD, REPLACE, STATS = 10
GO

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2009-05-08 : 18:03:36
Restore Full Backup in NORECOVERY MODE
Restore Diff Backup with RECOVERY MODE.
Go to Top of Page
   

- Advertisement -