SQL Server 2016 – Resolving Database Stuck on DB STARTUP

sql serversql-server-2016

I have a ~300 GB database on a development server (SQL Server 2016 SP2 – Developer) that is stuck on DB STARTUP. I am unable to restore over or drop the database. Would shutting down the SQL Server service, deleting the files, and restarting the service work to bring the instance back online and leave me able to restore the database from a backup?

Backstory: After a failed application level data import the database was left in an inconsistent state. I restarted the SQL Server service and all other database except this one came back online. This is a development instance to I was able to leave it alone to see if the process ever completed. Two weeks later when I run sp_who2 there is still an entry for this database with the command DB STARTUP and ever increasing CPUTime and DiskIO. I now need to make this database available. Would deleting the files directly work or are there other options?

Best Answer

Stopping SQL Server and deleting the files will most likely cause the database to go into "recovery pending" at next startup, and my experience is that I've never had any problems dropping a database in that state.

Of course assuming that this is indeed an OK operation for you (restore from prior backup).