RECOVERY_PENDING means SQL Server knows recovery is required but cannot start it, commonly because a database file is unavailable, the disk is full, permissions have changed, or the storage subsystem has failed. It does not automatically mean the database is corrupt.
USE master;
GO
SELECT
d.name,
d.state_desc,
d.user_access_desc,
d.recovery_model_desc,
d.log_reuse_wait_desc
FROM sys.databases AS d
WHERE d.name = N'myDatabase';
GO
USE master;
GO
SELECT
mf.file_id,
mf.type_desc,
mf.name AS logical_name,
mf.physical_name,
mf.state_desc,
mf.size * 8.0 / 1024 AS size_mb
FROM sys.master_files AS mf
WHERE mf.database_id = DB_ID(N'myDatabase');
GO
EXEC master.dbo.xp_readerrorlog
0,
1,
N'myDatabase';
GO
SSMS - Management - SQL Server Logs - Current
If the drive is full, add space or clear redundant files. If files/drives are missing, reconnect or restore. If permissions have changed, correct them. Then try:
ALTER DATABASE [myDatabase] SET ONLINE;
GO
Use this to monitor recovery...
SELECT
name,
state_desc,
recovery_model_desc,
log_reuse_wait_desc
FROM sys.databases
WHERE name = N'myDatabase';
GO
The transaction log for database 'myDatabase' is full due to 'LOG_BACKUP'.
If the error log contains 823, 824, 825, bad block, CRC, delayed write, device not ready, or I/O requests taking longer than 15 seconds, treat this as a storage incident.
Before attempting database repair:
Preserve the SQL Server and Windows event logs.
Have the Windows/storage team investigate the full I/O path.
Correct the hardware, filesystem, SAN, driver, or firmware issue.
Prefer restoration from a known-good backup if the database is damaged.
Microsoft advises resolving the underlying hardware or I/O problem before restoring or repairing a database.
If the error log indicates corruption or an unrecoverable log problem, the safest route is generally:
Preserve the damaged database files if storage permits.
Identify the last known-good full, differential, and log backups.
Restore to a new database name or alternate server first.
Run DBCC CHECKDB against the restored database.
Validate application data.
Switch over under your normal recovery procedure.
DBCC CHECKDB (N'myDatabase_Restored') WITH NO_INFOMSGS, ALL_ERRORMSGS;
GO
DBCC CHECKDB validates logical and physical integrity, but its repair options should not be the first response when a good backup is availableOnly consider the following if:
There is no usable backup
Storage problems have been resolved
You accept potential data loss
You have first copied the MDF/NDF/LDF files where possible
The business owner understands the risk
ALTER DATABASE [myDatabase] SET EMERGENCY;
GO
DBCC CHECKDB (N'myDatabase') WITH NO_INFOMSGS, ALL_ERRORMSGS;
GO
Avoid adding REPAIR_ALLOW_DATA_LOSS unless there is genuinely no restore route. It can deallocate damaged pages, remove records, and leave application-level inconsistencies
Stop before using the standalone recovery procedure. An AG database in RECOVERY_PENDING may need to be removed from the AG, restored/reseeded, and added back. A database that remains part of an Availability Group can have restrictions around restore and recovery operations.