Article 3.6.1S : How to fix Recovery Pending State in SQL Server Database?

Article 3.6.1S : How to fix Recovery Pending State in SQL Server Database?

Manual way to fix “SQL server recovery pending” state

There are 2 manual ways to start Recovering Pending State in SQL Server database that has been marked in recovery pending state:

Solution 1: Mark database in Emergency mode and initiate forceful Repair

  1. Execute the following set of queries

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

  1. EMERGENCY mode marks the database as READ_ONLY, disables logging, and grants access only to system administrators.
  2. This should resolve any corruption and bring the database online. The database will come out of EMERGENCY mode automatically.

Solution 2: Mark database in Emergency mode, detach the main database and re-attach it

  1. Execute the following set of queries:

ALTER DATABASE [DBName] SET EMERGENCY;

ALTER DATABASE [DBName] set multi_user

EXEC sp_detach_db ‘[DBName]’

EXEC sp_attach_single_file_db @DBName = ‘[DBName]’, @physname = N'[mdf path]’

  1. These commands will cause the server to get rid of the corrupt log and build a new one automatically.

kindly find attachmnet.