SQL SERVER – Database Stuck in Restoring State
SQL SERVER – Database Stuck in Restoring State
Here is one of the very common questions I keep on getting via email.
“I just restored all the backup files of my database, however, my database is still stuck in restoring state. How do I fix it?”
Well, if you have already restored all the databases, you can execute the following code and it will bring your database from recovery to an operational state.
RESTORE DATABASE NameofDatabase
WITH RECOVERY
If due to any reason, the above query returns an error about restoring log files or any other file and you do not have that file in your hand, you can run the following command.
Remember above command will roll forward your database and you will be not able to restore any other database after that.
RESTORE DATABASE NameofDatabase
WITH RECOVERY,REPLACE
If you are not sure what to do, leave a comment and I will help you out with your situation.
Comments
Post a Comment