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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cannot properly restore or delete a database 2

Status
Not open for further replies.

dmcub

MIS
Nov 1, 2002
3
US
Yesterday, I tried to restore a DB, and I am not able to see any objects under it. Enterprize manager shows this database grayed out and says "loading)". It cannot be loading for 2 days, especially since the job history says that the job succeeded.

I tried to restore the DB under a different name, with the same results. The job type is TSQL and the command was
"restore database DBNAME from disk = "e:\download\DBNAME.BAK" with norecovery go"

Can anyone help restore this DB successfully (so that I can access it)?

Second problem: when trying to delete this database, the following error come up: "error 3724: Cannot drop the database 'DBNAME' because it is being used for replication'. I never set replication on through...

Please help

Thank you very much!
 
If I remember correctly, when you use the "WITH NORECOVERY" option it means that your DB has been restored but it is still "loading" (and therefore unaccessible) because you use this option when you are restoring a DB and then one (or more) transaction logs. When you restore your last transaction log, you would change the option to "WITH RECOVERY" (which is the default value so it really does not need to be typed)

restore database DBNAME from disk = "e:\download\DBNAME.BAK"
 
Thanks, I'll do it again w/o the norecovery option. What can I do to delete the DB though, since there are no logs to restore?

Any help will be appreciated.
 
Does anyone know how to delete the DB? I'm running into the same problem.
 
First try this in Query Analyzer:

RESTORE DATABASE dbname WITH RECOVERY

-SQLBill
 
Thanks a lot, that worked and then I was able to delete it. I was really stressing over this. Thank you.
 
I'm curious....didn't you want to be able to USE your database? My code should have finished the RESTORE so the database would then be usable. Why did you delete it?

-SQLBill
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top