Deleting database hangs...

  • We've copied a SQL 2005 database to a different server during a recent application upgrade. We took this "old" database offline a few weeks ago just to make sure there were no surprises. This database is on a fairly busy server and we wanted to reclaim the space. Today we used the SQL Client tools to select and delete this SQL 2005 database. The process started and continued, and continued and eventually the CPU usage got stuck at 97%. This lasted for about 2 hours and then the server suddenly rebooted. Nice. Once we got everyhing running again nothing appears to be corrupted and the "old/disabled" database is still there.

    Now we're afraid to try again. It doesn't make sense to keep an old, large, useless DB around but the stress level goes too high. Is there some secret to this process? Is SQL creating a log of every table, row and stored procedure deleted? Is there a better way to do this?

    Any advice is appreciated.

  • What command did you run?

    If you run DROP DATABASE there's no log of deletion, you just get rid of the DB and free the disk space.

    If you selected the database in SSMS and chose "Delete" from the menu, that's the command you run.

    -- Gianluca Sartori

  • How about trying detaching the database and deleting it, as your main aim is to get space.

  • Might not be the cause, but might help speed it up - try unticking 'delete backup and restore history information' otherwise it will sit chuntering away for a while before the database disappears.

    Otherwise I'd go with the poster above and detach / delete

  • Thanks - good advice all around! I appreciate the suggestions and I will be braver at the beginning of the week rather than the end. Don't need another "emergency" today. I will be trying the detach and I will let you know how well that works for me.

Viewing 5 posts - 1 through 4 (of 4 total)

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