Wednesday, November 5, 2014

SQL Database Stuck in Restore State - SQL

Sometimes when a SQL Restore operation fails the database being restored can wind up stuck in a Restoring State. At this point, literally nothing can be done to the database, well almost nothing.

One common way this may occur is if a restore is attempted and the correct Recovery and Replace values are not selected by the user.

Doing a google.com search on the issue, I was directed to a stackoverflow. Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.


I referenced the article with an ulterior motive. You will note, if you review the link, there were a number of posts related to this issue, but only one is marked as a verified answer. Indeed this post resolved the issue. So when participating in forums, and asking questions, it is important to the community to mark any verified answer as helpful.

The best way to get a database out of the restore state is to complete the restore operation. To do this, use the correct restore options; see the query below:

RESTORE DATABASE YourDB
   FROM DISK = 'E:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Backup\YourDB.bak'
   WITH REPLACE,RECOVERY

1 comment:

  1. Thank you. this worked for me after a restore gone wrong.

    ReplyDelete