Steps for Recovering Detached Database to Suspected State
- Create a DB with Same Name as the Lost DB.
- Stop SQL Server Service.
- Replace the .mdf & .ldf files with Old Files(Lost DB).
- Start SQL Server Service.
Query For Recovering Suspected Database to ONLINE State
EXEC sp_resetstatus 'yourDBname';
ALTER DATABASE 'yourDBname' SET EMERGENCY
DBCC checkdb('yourDBname')
ALTER DATABASE yourDBname SET
SINGLE_USER WITH
ROLLBACK IMMEDIATE
DBCC CheckDB ('yourDBname',
REPAIR_ALLOW_DATA_LOSS)
ALTER DATABASE
yourDBname SET MULTI_USER
Such a wonderful post.
ReplyDeletehttps://michlstechblog.info/blog/virtualbox-no-boot-after-snapshot-efail-0x80004005/