Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

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.

share|improve this question
    
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 at 19:22
    
Same error with added error The database is already fully recovered –  Tsukasa Feb 3 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 Feb 3 at 19:26

1 Answer 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.

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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