dbTalk Databases Forums  

Delete or detach a Suspect database

comp.databases.ms-sqlserver comp.databases.ms-sqlserver


Discuss Delete or detach a Suspect database in the comp.databases.ms-sqlserver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
rdraider
 
Posts: n/a

Default Delete or detach a Suspect database - 09-20-2007 , 12:02 PM






Everything I read about sp_resetstatus says you must restart SQL after. Is
there a way around that (don't want to shut down production). The suspect
db is just an empty db that is not needed. I need to create another db with
the same name.
Thanks.



Reply With Quote
  #2  
Old   
Erland Sommarskog
 
Posts: n/a

Default Re: Delete or detach a Suspect database - 09-20-2007 , 04:25 PM






rdraider (rdraider (AT) sbcglobal (DOT) net) writes:
Quote:
Everything I read about sp_resetstatus says you must restart SQL after.
Is there a way around that (don't want to shut down production). The
suspect db is just an empty db that is not needed. I need to create
another db with the same name.
I may be missing something, but what about DROP DATABASE? I made a quick
test on SQL 2000 where I created a database, stopped SQL Server, deleted
the log file to make the database suspect, and restarted SQL Server.
DROP DATABASE worked just fine.


--
Erland Sommarskog, SQL Server MVP, esquel (AT) sommarskog (DOT) se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx


Reply With Quote
  #3  
Old   
rdraider
 
Posts: n/a

Default Re: Delete or detach a Suspect database - 09-20-2007 , 08:22 PM



No queries would work since this database did not exist in
Master.sysdatabases. Not sure why. Attempting to detach from Enterprise
Manager produced an error. Then I simply closed and reopened EM and it was
gone! Odd.



"Erland Sommarskog" <esquel (AT) sommarskog (DOT) se> wrote

Quote:
rdraider (rdraider (AT) sbcglobal (DOT) net) writes:
Everything I read about sp_resetstatus says you must restart SQL after.
Is there a way around that (don't want to shut down production). The
suspect db is just an empty db that is not needed. I need to create
another db with the same name.

I may be missing something, but what about DROP DATABASE? I made a quick
test on SQL 2000 where I created a database, stopped SQL Server, deleted
the log file to make the database suspect, and restarted SQL Server.
DROP DATABASE worked just fine.


--
Erland Sommarskog, SQL Server MVP, esquel (AT) sommarskog (DOT) se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx



Reply With Quote
  #4  
Old   
Erland Sommarskog
 
Posts: n/a

Default Re: Delete or detach a Suspect database - 09-21-2007 , 02:14 AM



rdraider (rdraider (AT) sbcglobal (DOT) net) writes:
Quote:
No queries would work since this database did not exist in
Master.sysdatabases. Not sure why. Attempting to detach from Enterprise
Manager produced an error. Then I simply closed and reopened EM and it was
gone! Odd.
The last thing you should believe is a graphical tool. But they usually
offer a Refresh option to handle such situations.


--
Erland Sommarskog, SQL Server MVP, esquel (AT) sommarskog (DOT) se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.