SQL Server: Database stuck in “Restoring” state

前端 未结 26 2034
后悔当初
后悔当初 2020-11-28 17:09

I backed up a database:

BACKUP DATABASE MyDatabase
TO DISK = \'MyDatabase.bak\'
WITH INIT --overwrite existing

And then tried to restore it

26条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-11-28 17:39

    What fixed it for me was

    1. stopping the instance
    2. creating a backup of the .mdf and .ldf files in the data folder
    3. Restart the instance
    4. delete the database stuck restoring
    5. put the .mdf and.ldf files back into the data folder
    6. Attach the instance to the .mdf and .ldf files

提交回复
热议问题