How to resolve SQL Server database in recovery pending state?

When the SQL Server database is in a recovery pending state, you can try the following methods to resolve the issue:

  1. Check the disk space of the database: If the disk space where the database resides is insufficient, it may cause the database to hang. Please ensure that the disk where the database is located has enough available space.
  2. Check the size of the database log files: If they are too large, it could cause the database to hang. You can try reducing their size by backing up and truncating the log files.
  3. Check database integrity: If there are issues with the integrity of the database, it could cause the database to hang. You can run the command DBCC CHECKDB to check the integrity of the database and attempt to fix any issues that are found.
  4. Check the locking status of the database: If there are other sessions holding locks on the database that have not been released, it may cause the database to hang. You can use either sp_who2 or sys.dm_tran_locks view to see the current locking situation and try to release any unnecessary locks.
  5. Restart the SQL Server service: If the above methods are unable to resolve the issue, you can try restarting the SQL Server service to eliminate any possible issues causing the database to hang.

Please note that it is highly recommended to back up the database before performing any actions to ensure the safety of the data.

bannerAds