Quick Answer
SQL Server keeps working on a database in recovery. Check progress in the error log or a DMV before you act. Recovery has 3 phases, Analysis, Redo and Undo. Long transactions and many VLFs slow recovery down. Never detach the files or set EMERGENCY while progress moves. Test Accelerated Database Recovery to cut future waits.
SSMS shows a database in recovery after a restart or a crash. Microsoft calls this state transient. Your database comes online on its own when recovery succeeds.
Check the progress signals before you touch the files. This guide shows where to find them, what slows recovery down and when the state turns into Recovery Pending or Suspect.
What is a Database in Recovery State in SQL Server?
SQL Server starts crash recovery on every database when the instance starts. Microsoft splits the process into 3 phases that start from the last checkpoint.
| Phase | What SQL Server does | What you see |
|---|---|---|
| Analysis | Opens the log and builds the dirty page table and the active transaction table | Database unavailable |
| Redo | Rolls forward every logged edit that has no copy in the data files yet | Database unavailable |
| Undo | Rolls back the transactions that were open at the crash | Database online when Undo finishes |
Microsoft states the database remains unavailable until all 3 phases finish. Enterprise Edition can open it after Redo when the instance restarts. Microsoft calls this Fast Recovery.
Progress for every phase lands in the SQL Server error log. Our reading SQL Server transaction logs guide explains the log records that Redo and Undo process.
How do You Check the Recovery Progress?
Use one of 3 signals. Query the state first so you know the database is in recovery and not in another state.
SELECT name, state_desc FROM sys.databases WHERE name = N'YourDatabase';
Signal 1 is the error log. Search the current log for recovery messages. They show the percent finished and the seconds remaining for every phase.
EXEC sys.sp_readerrorlog 0, 1, N'Recovery of database';
Signal 2 is the request DMV. Microsoft support documented in 2010 that percent_complete shows the same value as the error log message.
SELECT session_id, command, percent_complete, estimated_completion_time
FROM sys.dm_exec_requests
WHERE command LIKE N'DB STARTUP%';
Signal 3 is the undo counters. Execute this query a few times. Record counts that fall and an undo LSN that moves mean the rollback of a long transaction is progressing.
SELECT DB_NAME(database_id) AS db,
database_transaction_log_record_count,
database_transaction_next_undo_lsn
FROM sys.dm_tran_database_transactions
WHERE database_id = DB_ID(N'YourDatabase');
Heads Up. We executed the state query and both DMV queries on a healthy SQL Server 2022 server. They returned no rows because no recovery was in progress. Our test could not create a stuck recovery.
Which Symptom Needs Which Action?
| What you see | What it means | What to do |
|---|---|---|
| Percent finished rises between checks | Recovery is progressing | Wait and check again later |
| Undo counters move | SQL Server is rolling back a large transaction | Wait. Recovery time follows the size of the longest open transaction |
| No messages for a long time | Microsoft support links this to a log with a huge number of VLFs, which slows work before the Analysis phase | Wait. Count the VLFs after the database is online and rebuild the log in a maintenance window |
| State shows RECOVERY PENDING | A resource problem blocks recovery | Fix the file or permission error. See our recovery pending state guide |
| State shows SUSPECT | Microsoft states the primary filegroup can be damaged | Restore from backup. See our suspect database reasons guide |
Which Permissions and Versions do the Checks Need?
These tables list what the checks need on your server.
System Specifications
| Component | Requirement |
|---|---|
| Server permission | sysadmin role for sp_readerrorlog. We executed every query as sysadmin |
| Access to the instance | A session in SSMS or sqlcmd that opens before the instance finishes startup. Open it early because logins to the database fail during recovery |
| Disk space | Free space on the volume with the LDF file. Recovery cannot grow a full log volume |
Software Specifications
| Item | Requirement |
|---|---|
| Progress through DMV | SQL Server 2008 and later according to Microsoft support. We executed the queries on SQL Server 2022 Express on Linux |
| Accelerated Database Recovery | Introduced in SQL Server 2019. Microsoft improved it in SQL Server 2022 and 2025. Our SQL Server 2022 Express test returned Msg 12128 |
| Client tool | SQL Server Management Studio or sqlcmd |
Which Actions Help and Which Make It Worse?
- Wait while progress moves. Microsoft states recovery time is roughly proportional to the longest transaction that was open at the crash.
- Do not detach the database or delete the LDF. Recovery needs the log. Microsoft states DBCC CHECKDB rebuilds a corrupt log in EMERGENCY mode only as a last resort and the rebuild gives no full ACID guarantee.
- Do not set EMERGENCY to speed things up. Microsoft describes EMERGENCY as a troubleshooting state that sets the database to READ_ONLY with logging disabled.
- Check disk space and file permissions. Full volumes and access denied errors on the MDF or LDF move the state to Recovery Pending.
- Test Accelerated Database Recovery. Microsoft states ADR makes recovery time roughly constant because Undo finishes almost at once.
ALTER DATABASE [YourDatabase] SET ACCELERATED_DATABASE_RECOVERY = ON;
Our Express test returned Msg 12128 Level 16 State 1 with the text Accelerated Database Recovery cannot be enabled on Express edition. Check your edition before you plan on ADR.
Which Recovery States Follow a Failed Startup?
Microsoft defines the recovery related states like this. Failed recovery ends in Suspect.
| State | Microsoft definition in short | Your next step |
|---|---|---|
| RECOVERING | Transient state. The database comes online if recovery succeeds and becomes suspect if recovery fails | Check progress and wait |
| RECOVERY PENDING | A resource related error stopped recovery. Files can be missing and the database is not damaged | Fix the missing file, the permission or the resource limit |
| SUSPECT | Microsoft states the primary filegroup can be damaged and the database cannot recover at startup | Restore from a backup |
| EMERGENCY | Set by a sysadmin for troubleshooting. READ_ONLY with logging disabled | Use it only to extract data or as a last resort |
FAQs
How Long does a Database Remain in Recovery?
No fixed time exists. Recovery time follows the longest transaction that was open at the crash. Accelerated Database Recovery makes the time roughly constant.
Can You Use a Database in Recovery?
No. Microsoft lists the database as unavailable until recovery finishes. Enterprise Edition can open it after Redo when the instance restarts.
Does Recovery Lose Committed Data?
No. Redo rolls forward committed edits and Undo rolls back only transactions that were open at the crash.
Which Log Messages Show the Progress?
SQL Server writes the percent finished and the seconds remaining for every phase to its error log. Search the log for recovery of the database name.
Should You Restart SQL Server While a Database is in Recovery?
No, not while progress moves. Crash recovery starts again for every database after a restart. Restart only when the error log shows no progress for a long time.
Does Accelerated Database Recovery Work on Express?
Not in our test. SQL Server 2022 Express rejected the ALTER DATABASE statement with Msg 12128.
About this guide. Andrew Jackson is a SQL Server DBA and blogger. He writes about transaction logs, database recovery and SQL Server errors. We checked this guide against Microsoft documentation on 30 Nov 2026 for SQL Server 2019, 2022 and 2025. We executed the state query, both DMV queries and the ADR statement on SQL Server 2022 Express on Linux but could not reproduce a database stuck in recovery.
Microsoft documents the phases on its restore and recovery overview page and the states on its database states page. Microsoft lists the supported versions on its accelerated database recovery page.
