Wednesday, June 17, 2009

Suspect WSS search database

Had my normal search database for wss (not SSExpress 2008) go suspect for some reason

Found this


As usual I was doing things on my VPC and I noticed that one of my SQL database was marked suspect. After some thought I guessed that the reason for the database to be marked suspect is because of me turning off my VPC without proper shutdown. The same reason why a DB can be marked suspect after a power failure. Now I was in a fix because I didn't had backup (Another dumb thing to miss on my part). So what should I do now? Well some research brought me good results, ended up framing following query:

EXEC sp_resetstatus ‘DBname’;
ALTER DATABASE DBname SET EMERGENCY
DBCC checkdb(’DBname’)
ALTER DATABASE DBname SET SINGLE_USER WITH ROLLBACK IMMEDIATE
DBCC CheckDB (’DBname’, REPAIR_ALLOW_DATA_LOSS)
ALTER DATABASE DBname SET MULTI_USER

So all you have to do is copy and paste above query in query analyzer and replace DBName with your database name. And you are good to go now!

1 comment:

AshishChotalia said...

This really helped to fix the issue. Thank you.