How to Recover Database in SUSPECT Mode?

Resolved SQL
CM
Community Member
August 11, 2015
2 replies
715 views
Reviewed by moderators

I try to run DBCC CHECKDB with repair option it says "Attempt to BEGIN TRANSACTION in database 'testdb' failed because database is in BYPASS RECOVERYmode"

If I try to reset the status, the database again goes in Suspect state and it seems DBCC commands don't run on database in Suspect state.

Does anybody know how to recover the database in this Mode? Is there any other way to repair it?

2 Answers
Accepted Answer
Verified by Edwin J. Hoffer, Expert · Reviewed August 2015

copy the data out of that database into a new one, vigorously check the logical consistency of the tables then discard the original database. n

use this script to recover database from suspect modenn

EXEC sp_resetstatus ' yourDBname' nALTER DATABASE yourDBname SET EMERGENCYnDBCC checkdb(' yourDBname')nALTER DATABASE yourDBname SET SINGLE_USER WITH ROLLBACK IMMEDIATEnDBCC CheckDB (' yourDBname', REPAIR_ALLOW_DATA_LOSS)nALTER DATABASE yourDBname SET MULTI_USER
nn