Droping the Database in emergency mode

  • I have a Database in suspect state and i have changed it to emergency mode and  copied all the data  and i am trying to delete it or renaming it so that i can recreate the db with the old name as my aplication will be looking for that database name.

    When i tried to drop the database it says its in use and cannot be dropped.

    And when I tried to rename it It gives me the follwoing message.

    To change the NAME, the database must be in state in which a checkpoint can be executed.

    Please advise me .

    Thanks.

  • When the db was in "suspect" mode, did you run the "sp_resetstatus" stored procedure?


    Don't count what you do, do what counts.

    SQL Draggon

  • Yes,But it didn't work for me,So I have set the database to emergency mode.But how can i drop this database.I have created another DB with all the Data base objects But nnow the problem is that how can i drop or rename that existing DB.If I can do that i can rename the new DB to the old DB.

     

    Thanks.

  • Have you tried sp_detach_db or taking it offline in Enterprise Manager?

  • Yep, I could not do it either.

  • How about

    DBCC DBREPAIR(database_name, dropdb)

    Steve

  • I'm sorry to say that now the DB is in emergency mode so i can't drop it.

    How can i drop when its in emergency mode.

    Thanks.

  • When you tried to drop the database, you say the message was that it is 'in use'. You aren't doning anything silly like leaving Query Analyser linked to the database, are you? 

    Run 'sp_who' in Query Analyser to check if any process is linked to the database.

    Peter

  • I tried that also,But I have a connection which is an application user for that DB. So How can disconnect forcibly that user from th DB.I guess if i can disconnect the user then i can drop the DB.

     

    Thanks.

  • In enterprise manager:

    go to Management - current Activity- Processes Info

    then right click on the process you want to get rid of and select kill Process.

    Peter

Viewing 10 posts - 1 through 9 (of 9 total)

You must be logged in to reply to this topic. Login to reply