sql server

SQL Server database stuck in RESTORING

A
Desh-Duniya Team Author
| Published May 18, 2019

Sometimes the database is in a restoring state after restarting the machine or for some other reason. It usually happens with big databases when a long transaction is in progress and an unexpected server shutdown or restart occurs.

If you have this problem, try this first:

RESTORE DATABASE [databasename] WITH RECOVERY

If you receive an error that the database is in use, try to set the user to single user mode:

USE master;
GO

ALTER DATABASE Database_name
SET SINGLE_USER
WITH ROLLBACK IMMEDIATE;

Discussion (0)

Please sign in to participate in the discussion.
No comments yet. Be the first to join the conversation!