Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Fails to restore with NO RECOVERY option

Status
Not open for further replies.

sqlturbo

IS-IT--Management
Mar 11, 2002
67
US
An e-commerce database went 'OFFLINE' after the data server (the server storing the .mdf and the .ldf file for the database was rebooted). It won't show up in EM/Query Analyzer. I tried to restore the database from a full database backup using the 'NO RECOVERY' option. While it was trying to restore it that way, the database status was 'Loading' (as seen in EM). After 12 hours it still was. I killed the restore and tried it again, this time using the 'RECOVERY' option. That restored the database but what I don't understand is why didn't the 'NO RECOVERY' option work. Could it be due to some corrupted data?

Thanks for any input that you may have.
 
when no_recovery is specified on a database restore, it indicates that a subsequent transaction log(s) will also be forth coming. If a series of transaction logs will be applied, only the last one should be applied with 'RECOVERY' all other should be applied with NO_RECOVERY

It is not necessary to do a complete restore to rest the (Loading) condition after you ran the restore with no_recovery, you cna just execute the command
restore database my_db with RECOVERY to get it rolling again.

Be sure to 'Refresh' EM to see the change of state.

\0
 
WITH NO RECOVERY means that you have other files to restore and until those files are restored the database can't recover because it's waiting for you to tell it what other files you are restoring.

WITH NO RECOVERY is normally used when you have differential or transaction log backups to restore.

If you only have the full backup to restore, use WITH RECOVERY or leave the option off since default is WITH RECOVERY.

-SQLBill
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top