Categories
Software

Recovery Pending

We had a couple of databases stuck in the “Recovery Pending” state. The fix is straightforward:

ALTER DATABASE [DBName] SET EMERGENCY;
GO

ALTER DATABASE [DBName] SET SINGLE_USER
GO

DBCC CHECKDB ([DBName], REPAIR_ALLOW_DATA_LOSS) WITH ALL_ERRORMSGS;
GO 

ALTER DATABASE [DBName] SET MULTI_USER
GO