My SQL server went to "Recovery Pending" state after I mistakenly enabled folder compression for the folder where the database files are residing.
To recover,
- Stop SQL services
- Disable folder compression in the folder where SQL database files are stored
- Start SQL services
- Execute below recovery steps if still having trouble to use the DB. in case the DB went to single user mode, just the last step from below is needed
ALTER DATABASE [SQL-DB-Name] SET EMERGENCY;
GO
ALTER DATABASE [SQL-DB-Name] set single_user
GO
DBCC CHECKDB ([SQL-DB-Name], REPAIR_ALLOW_DATA_LOSS) WITH ALL_ERRORMSGS;
GO
ALTER DATABASE [SQL-DB-Name] set multi_user
GO