SQL Server error 922 means the database you are trying to open is still in the middle of its recovery process, so SQL Server is not ready to let you use it yet. The fix is almost always to wait for recovery to finish, then check that the database comes online. If it never finishes, you need to investigate the recovery state and the error log rather than force the database open.
What You'll Need
- Access to SQL Server Management Studio (SSMS) or another client that can run T-SQL queries.
- Permission to view the SQL Server error log and query system views (typically a member of the sysadmin role or someone with VIEW SERVER STATE).
- The name of the affected database.
- Patience: recovery can take seconds on a small database and much longer on a large one or after an unexpected shutdown.
Step-by-Step
- Confirm the error is 922. Connect to the instance and try to open the database. If you see message 922, note the database name. Do not repeatedly retry in a loop; each attempt adds load.
- Check the database state. Run
SELECT name, state_desc FROM sys.databases WHERE name = 'YourDatabase';. A state of RECOVERY means recovery is in progress. ONLINE means it is ready. Other states (RECOVERY_PENDING, SUSPECT, OFFLINE) point to a different problem. - Watch the SQL Server error log. In SSMS, expand Management > SQL Server Logs and open the current log. Look for messages about recovery progress, completion, or errors. Labels can differ slightly by SSMS version, so look for the SQL Server Logs node under Management.
- Wait for recovery to complete. For a database that was cleanly shut down, recovery is usually quick. After a crash or power loss, SQL Server may need to roll back uncommitted transactions, which can take time proportional to the amount of log to process. Leave the instance running and avoid restarting the service unless you have a reason.
- Re-check the state. Run the query from step 2 again. When state_desc shows ONLINE, try opening the database. The 922 error should be gone.
- If recovery is stuck or the database stays in RECOVERY for an unusually long time, check the error log for messages about long-running recovery, I/O errors, or corruption. Note the time recovery started and compare it with the size of the database and the last time it was cleanly shut down. If there are I/O errors, address the storage problem first.
- If the database will not come online, do not detach, drop, or force it online. Instead, take a backup of the database files if possible and contact your DBA or Microsoft support. Forcing a database online can cause consistency problems.
Common Mistakes
- Restarting SQL Server repeatedly. A restart can interrupt recovery and make the next recovery take longer. Let recovery finish.
- Detaching and reattaching the database. Detaching a database in recovery can fail or leave it in a worse state. Wait for recovery first.
- Assuming the database is corrupt. Error 922 is a status message, not proof of corruption. Check the error log for real errors before taking drastic action.
- Running
ALTER DATABASE ... SET EMERGENCYorSET ONLINEwithout understanding the consequences. These are recovery actions for specific situations and can cause data loss if misused. - Ignoring storage problems. Slow or failing disks make recovery take much longer. Check the Windows event log and storage health if recovery seems stuck.
Tips
- Recovery time depends on the amount of transaction log that needs to be processed, not just database size. A large database with little recent activity can recover quickly.
- Keep the SQL Server error log open in a second window while you wait so you can see progress messages.
- If you need to stop SQL Server for maintenance, use a clean shutdown so the next startup does not require crash recovery.
- Monitor disk latency and free space on the volume holding the database and log files; recovery writes to both.
- For very large databases, plan for recovery time during patching or failover testing.
Troubleshooting
If the database remains in RECOVERY for hours with no progress in the error log, check for I/O errors or disk space issues. Run SELECT name, state_desc, recovery_model_desc FROM sys.databases WHERE name = 'YourDatabase'; to confirm the state. If the error log shows corruption messages, restore from a known-good backup rather than forcing the database online. If you are not the DBA, escalate to the person responsible for the instance with the error log timestamps and the database state. Do not delete the database or its files as a troubleshooting step.
Frequently Asked Questions
How long does recovery take?
It varies with the amount of transaction log to process and the speed of storage. Small databases often recover in seconds; large ones after a crash can take much longer. Watch the error log for completion messages.
Can I use the database while it is in recovery?
No. SQL Server blocks access until recovery finishes, which is why you see error 922.
Will restarting SQL Server fix error 922?
It can restart recovery, but it does not guarantee a faster fix and may lengthen the process. Wait for recovery to complete unless you have a specific reason to restart.
Is error 922 the same as a suspect database?
No. A suspect database has a different state (SUSPECT) and usually indicates corruption or a failed recovery. Error 922 is specifically about recovery in progress.
What if the database stays in recovery forever?
Check the error log for I/O or corruption errors, verify disk health and free space, and involve your DBA or Microsoft support. Do not force the database online or delete files.
Can I back up a database that is in recovery?
No. Backup requires the database to be online or in a state that allows access. Wait until recovery completes.