5

I tired to restore my database but I saw that I am restoring a wrong one, so I immediately kill the process. Unfortunately the database was in restoring state and is not accessible anymore.

Can anyone help me to return back to normal state?

Thanks in advance

Hadi
  • 36,233
  • 13
  • 65
  • 124
user3569267
  • 1,065
  • 3
  • 14
  • 27
  • 1
    [SQL Server: Database stuck in “Restoring” state](https://stackoverflow.com/questions/520967/sql-server-database-stuck-in-restoring-state) but if you restored with overwrite your unlikely to be able to return to the state prior to the aborted restore (without another restore) – Alex K. Nov 17 '17 at 18:31
  • Possible duplicate of [SQL Server: Database stuck in "Restoring" state](https://stackoverflow.com/questions/520967/sql-server-database-stuck-in-restoring-state) – Igor Nov 17 '17 at 19:05

1 Answers1

7

Try using the following query to return your database online

RESTORE DATABASE MyDatabase
WITH RECOVERY 

If it throws an exception so you need to restore from a latest backup

RESTORE DATABASE MyDatabase
FROM DISK = 'C:\MyDatabase.bak'
WITH REPLACE,RECOVERY
Hadi
  • 36,233
  • 13
  • 65
  • 124