3

Running this SQL query:

   RESTORE DATABASE Demo 
   FROM DISK = 'C:\DBBackup\Demo_FULL_Sunday.bak' 
   WITH  NORECOVERY 

   RESTORE DATABASE Demo 
   FROM DISK = 'C:\DBBackup\Demo_Diff_Monday.bak' 
   WITH RECOVERY

I'm getting these errors:

Msg 3117, Level 16, State 4, 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.

I have also tried adding WITH REPLACE but no luck. This is meant to restore to a report server, not to the original server that the backup was taken from.

I have tried Googling, however everything I read just says to make sure you are using WITH NORECOVERY.

3
  • Have you tried changeing the "WITH RECOVERY" option to "WITH NORECOVERY" on the Diff, running it, and then running a RESTORE DATABASE Demo WITH RECOVERY?
    – KenWilson
    Feb 3, 2014 at 19:22
  • Same error with added error The database is already fully recovered
    – Tsukasa
    Feb 3, 2014 at 19:25
  • 2
    You are getting that error because you are restoring on an existing database. When you restore the database using full backup, use with norecovery, replace. That should help you.
    – Kin Shah
    Feb 3, 2014 at 19:26

1 Answer 1

1

Although you have WITH NORECOVERY on the 1st statement, the error is actually occurring since there is an existing database with the name Demo which cannot be overwritten without explicit instruction.

Try:

ALTER DATABASE Demo SET SINGLE_USER WITH ROLLBACK IMMEDIATE;

RESTORE DATABASE Demo 
FROM DISK = 'C:\DBBackup\Demo_FULL_Sunday.bak' 
WITH REPLACE, NORECOVERY; 

RESTORE DATABASE Demo 
FROM DISK = 'C:\DBBackup\Demo_Diff_Monday.bak' 
WITH RECOVERY;

Be aware this will totally destroy the existing database and replace it with the contents of the backup file. Ensure you do this on the correct server, since you will have no 2nd chances.

2
  • 1
    You meant restore .... with replace as opposed to overwrite :-)
    – Kin Shah
    Feb 3, 2014 at 20:34
  • Yes, @kin you're correct. I tested the ALTER DATABASE statement, and knew I should have tested the RESTORE as wel!
    – Hannah Vernon
    Feb 3, 2014 at 22:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.