SQL

How to Fix SQL Database Stuck in Restoring State

8 min read

SQL database stuck in restoring state needs one command to fix in most cases. Execute RESTORE DATABASE with WITH RECOVERY and SQL Server brings the database online when every backup is applied.

Users see (Restoring…) next to the database in Object Explorer and every connection fails. This guide explains the causes, the checks that save you from a wrong move and five fixes in the order you should try them.

SQL Server database showing the Restoring state in SSMS Object Explorer

Quick SummarySQL database stuck in restoring state needs one RECOVERY command. Check the restore progress before you act. Apply every remaining backup if the sequence is open. Close sessions that stop the restore. Force exclusive access when users remain connected. Restore with REPLACE as the last step. Test the backup with RESTORE VERIFYONLY. Confirm state_desc shows ONLINE. Execute DBCC CHECKDB after the fix.

Why Is a SQL Database Stuck in Restoring State?

SQL Server marks a database as RESTORING while a restore sequence is open. Users cannot open the database until a restore statement uses RECOVERY.

  • NORECOVERY on the last backup. This is the most common cause. The restore ended and nobody executed WITH RECOVERY.
  • Unfinished restore sequence. A differential or log backup is still waiting to be applied.
  • Cancelled or failed restore. Low disk space, a lost connection or a stopped session puts the database in a half restored state.
  • Open connections. Another session uses the database and the restore cannot get exclusive access.
  • Standby role. Log shipping, mirroring and availability group secondaries sit in this state by design.

Do You Know?Restoring is a normal state for a database in the middle of a restore. It becomes a problem only when no restore session is active and no backup is left to apply.

What Should You Check Before Fixing a Database Stuck in Restoring State?

Check the state and the restore progress first. Restores of large databases take hours and a wrong command at that point destroys the work already done.

-- Database state
SELECT name, state_desc FROM sys.databases WHERE name = N'PayrollDB';

-- Active restore sessions and progress
SELECT session_id, command, percent_complete,
       estimated_completion_time / 60000 AS minutes_left
FROM sys.dm_exec_requests
WHERE command LIKE N'RESTORE%';

-- Backup health
RESTORE VERIFYONLY FROM DISK = N'D:\Backups\PayrollDB_Full.bak';

Rows with a rising percent_complete mean the restore is alive. Wait for it to finish. No row means no restore session is active and you can start the fixes below.

Restores that fail with an error message need that error fixed first. Fix SQL Server Error 3154 and Fix SQL Server Error 3201 Cannot Open Backup Device cover two common ones.

How to Fix SQL Database Stuck in Restoring State?

Try the methods in this order. Every example uses the database PayrollDB and the folder D:\Backups. Replace the names with your own values.

Method 1: Execute RESTORE DATABASE WITH RECOVERY

Use this method when the last restore used NORECOVERY and no more backups exist. SQL Server rolls back uncommitted transactions and opens the database with committed data intact. Full sequence details sit in the restore database with NORECOVERY post.

RESTORE DATABASE PayrollDB WITH RECOVERY;

SELECT name, state_desc FROM sys.databases WHERE name = N'PayrollDB';

Method 2: Apply the Remaining Backups

Restore the differential and log backups in order when the sequence is not finished. Use NORECOVERY on every statement except the last one.

RESTORE DATABASE PayrollDB FROM DISK = N'D:\Backups\PayrollDB_Diff.bak' WITH NORECOVERY;
RESTORE LOG PayrollDB FROM DISK = N'D:\Backups\PayrollDB_Log1.trn' WITH NORECOVERY;
RESTORE LOG PayrollDB FROM DISK = N'D:\Backups\PayrollDB_Log2.trn' WITH RECOVERY;

Method 3: Close the Session That Stops the Restore

Find the session in sys.dm_exec_requests when percent_complete shows the same value for a long time. According to Microsoft, KILL ends a connection and stops its transactions. Add WITH STATUSONLY to see rollback progress without ending anything.

KILL 57;
KILL 57 WITH STATUSONLY;

Start the restore again after the session ends. Method 1 or Method 2 then completes the restore.

Heads UpNever kill a restore session that shows a rising percent_complete. You lose the progress and start from the full backup again.

Method 4: Force Exclusive Access Before the Restore

Restores over an existing database need exclusive access. Open connections stop the restore and the database ends in a half restored state. Switch the database to single user mode and roll back every other connection.

USE master;
GO
ALTER DATABASE [PayrollDB] SET SINGLE_USER WITH ROLLBACK IMMEDIATE;
GO
RESTORE DATABASE PayrollDB FROM DISK = N'D:\Backups\PayrollDB_Full.bak' WITH REPLACE, RECOVERY;
GO
ALTER DATABASE [PayrollDB] SET MULTI_USER;
GO

Wrap hyphenated names in square brackets, for example [Payroll-DB]. Execute the three statements in one session.

Method 5: Restore Again With REPLACE

Restore the full backup again when the database is damaged and Methods 1 to 4 fail. REPLACE overwrites the existing database and RECOVERY brings the new copy online.

RESTORE DATABASE PayrollDB
FROM DISK = N'D:\Backups\PayrollDB_Full.bak'
WITH REPLACE, RECOVERY, STATS = 10;

Heads UpTest the backup with RESTORE VERIFYONLY before you overwrite anything. Do not drop the database first because a damaged backup then gives you nothing to fall back on.

Confirm the result after any method. Query sys.databases and check that state_desc shows ONLINE. Execute DBCC CHECKDB on PayrollDB to confirm no corruption.

Is a Restoring State Normal for Log Shipping, Mirroring and Always On?

Yes. Log shipping secondaries, mirror databases and availability group secondaries wait in the restoring state by design. Do not execute WITH RECOVERY on them because that breaks the setup and forces you to configure it again.

Check the role of the database in the high availability tool first. Fix only the databases that should be online.

What Should You Do When the MDF File Is Corrupt and No Backup Works?

Restoring needs a healthy backup. When every backup fails verification and the MDF file is the only copy, use a recovery tool that reads the file directly.

SQL Recovery scans the MDF file in Advanced Scan mode, previews the tables, views, triggers, rules, functions and stored procedures and exports them. SQL Recovery auto detects the SQL Server version and works with versions from 2000 to 2022. Deleted records come back too and table data exports to CSV or SQL scripts.

Download SQL Recovery Buy SQL Recovery

  1. Install SQL Recovery and select Add File.

Add MDF file option in SQL Recovery

  1. Browse to the MDF file, select Advanced Scan and confirm the SQL Server version. Tick the deleted records option.

Advanced Scan and SQL Server version options in SQL Recovery

  1. Open the preview and check the database components.

Preview of recovered SQL database objects in SQL Recovery

  1. Select Export and save the objects to SQL Server or to CSV files.

Export options in SQL Recovery

What Are the Software and System Specifications of SQL Recovery?

Check both tables before you install SQL Recovery on the server or on a separate workstation.

Software Specifications

Attribute Detail
Software name SQL Recovery
Version 14.0
File types MDF and NDF
SQL Server versions 2025, 2022, 2019, 2017, 2016, 2014, 2012, 2008 R2, 2008, 2005 and 2000
Scan modes Quick Scan and Advanced Scan
Export options SQL Server database, SQL scripts and CSV
SQL Server installation Needed only for export to a live server
Demo limit Preview of every item and export of 25 records per table and 5 other objects

System Specifications

Component Requirement
Processor Intel Core 2 Duo E4600 at 2.40 GHz or equivalent
RAM 4 GB
Hard disk space 100 MB free
Operating system Windows 7, 8 and 10 (32 or 64 bit), Windows 11 (64 bit), Windows Server 2008, 2012 R2, 2016, 2019, 2022 and 2025
Framework Microsoft .NET Framework 4.5 or later
Permission Launch SQL Recovery as administrator

Frequently Asked Questions

Does a SQL Database Stuck in Restoring State Mean the Data Is Corrupt?

No. That state shows only that a restore sequence is open. Data remains intact unless the backup file or the MDF file is damaged.

Can You Access a Database in Restoring State?

No. SQL Server rejects every connection to a RESTORING database. Execute RESTORE DATABASE WITH RECOVERY to open it.

How Long Does a Restore Take Before It Counts as Stuck?

No fixed time exists. Rising percent_complete values in sys.dm_exec_requests mean the restore is working and flat values over a long period mean it is stuck.

Can You Fix a Database in Restoring State Without Any Backup File?

Yes, when the full restore already finished. Execute RESTORE DATABASE WITH RECOVERY and SQL Server opens the database with the data it has.

Does RESTORE WITH RECOVERY Delete Any Data?

No. It rolls back uncommitted transactions and retains committed data. Backups you did not apply remain outside the database.

Can You Check That the Database Is Healthy After the Fix?

Yes. Confirm that state_desc shows ONLINE in sys.databases. Execute DBCC CHECKDB to find corruption.

Does RESTORE With REPLACE Overwrite the Current Database?

Yes. REPLACE overwrites the existing database with the backup. Transactions written after the backup are lost unless you saved them in a tail log backup.

Final Words on SQL Database Stuck in Restoring State

Most restoring problems come from a restore that never received its final RECOVERY step. Check the progress first and apply the five fixes from the lightest to the heaviest.

Verify your backups before every restore and confirm the final state in sys.databases.

Key Takeaways

  • Most restoring problems need WITH RECOVERY on the last restore step.
  • Rising percent_complete values mean the restore is working. Wait for it.
  • Log shipping and availability group secondaries remain in restoring state by design.
  • RESTORE WITH REPLACE overwrites the database. Test the backup first.