Welcome to bytebang » The blog about all and nothing » MSSQL 2012 - Database in Recovery Pending State

MSSQL 2012 - Database in Recovery Pending State

Aug 19 2014

Recently after a VMware recovery of a database server i found my database in the "Recovery Pending" state. In this state nobody could connect to the db - which renders it pretty useless. After some googling i found here the simple and working solution.

Start the MSSQL Server Management Studio, connect to the server and run the following statements

ALTER DATABASE [DB_Name] SET  SINGLE_USER WITH NO_WAIT;
ALTER DATABASE [DB_Name] SET EMERGENCY;
DBCC checkdb ([DB_Name], REPAIR_ALLOW_DATA_LOSS);
ALTER DATABASE [DB_Name] SET online;
ALTER DATABASE [DB_Name] SET  Multi_USER WITH NO_WAIT;

After that it was possible to bring the database online again and it worked like a charm.

The parameter "REPAIR_ALLOW_DATA_LOSS" does exactly what it says. Even if the database is up and running again it could be that there is some data missing.

Get Social


(c) 2024, by bytebang e.U. - Impressum - Datenschutz / Nutzungsbedingungen
-