Delete or detach a Suspect database

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • rdraider

    Delete or detach a Suspect database

    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.


  • Erland Sommarskog

    #2
    Re: Delete or detach a Suspect database

    rdraider (rdraider@sbcgl obal.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@sommarsk og.se

    Books Online for SQL Server 2005 at

    Books Online for SQL Server 2000 at

    Comment

    • rdraider

      #3
      Re: Delete or detach a Suspect database

      No queries would work since this database did not exist in
      Master.sysdatab ases. 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@sommars kog.sewrote in message
      news:Xns99B1EF3 C598D6Yazorman@ 127.0.0.1...
      rdraider (rdraider@sbcgl obal.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@sommarsk og.se
      >
      Books Online for SQL Server 2005 at

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

      Comment

      • Erland Sommarskog

        #4
        Re: Delete or detach a Suspect database

        rdraider (rdraider@sbcgl obal.net) writes:
        No queries would work since this database did not exist in
        Master.sysdatab ases. 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@sommarsk og.se

        Books Online for SQL Server 2005 at

        Books Online for SQL Server 2000 at

        Comment

        Working...