HiveBrain v1.2.0
Get Started
← Back to all entries
snippetsqlCritical

How do you stop, take offline, and delete a SQL Server database in recovery?

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
youdeletesqltakeserverstopofflinedatabaserecoveryhow

Problem

I have a development database which has entered recovery mode on restart, and has been recovering for the last hour or so.

I need to either stop the recovery, or kill it in some way.

I don't care one bit about the database or any of the data, I have deployment scripts.

Any ideas?

Solution


  • Stop SQL Server



  • Delete MDF + LDF



  • Start SQL Server



  • Restore (may need to drop first, comes up suspect)



If the MDF and LDF are present on service start up, it will go into rollforward/rollback recovery. You have to drop them to prevent this.

Context

StackExchange Database Administrators Q#11175, answer score: 53

Revisions (0)

No revisions yet.