Hi,
Normaly you should always have backups of your databases, restoring suspected databases is not a good option, but I think at some point in time, in some situation you’ll want to do it anyway.
So today I set up a test case for this. I mirrored one of our database servers and made it crash, badly.
Two databases were corrupted, and went to the "suspect state".
Microsoft SQL Server started throwing errors in our general direction like:
"Database cannot be opened. It has been marked SUSPECT by recovery."
Not good, but just what we wanted…
So how would it be possible to recover these databases?
First, set them to emergency mode, this way you will be able to retrieve control.
In emergency mode you can actually open the database:
alter database "test-database" set emergency;
Second, put them in single mode (needed for the check we will be performing):
alter database "test-database" set single_user;
Then, check the database (this repair allows data-loss, since I’m sure some data will have to be lost in my scenario):
dbcc checkdb ('test-database', REPAIR_ALLOW_DATA_LOSS);
Finally, if the check succeeded, you can re-enter multi-mode:
alter database "test-database" set multi_user;
And there you go, the database is restored…
Not a best practice, but it may save some time once. So if you ever have a problem on your dedicated server database hosting, you know this might to the trick.