Alexander Anikin's blog

My personal blog

SQL Server Database in Suspect Mode

leave a comment »

I had a strange issue on one of my old SQL Server 2005 Express.

My application database was marked as SUSPECT.

My great fault was no backups and I need solution without great data looses.

Big thanks to CodeProject.

SQL:

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

Advertisements

Written by Alex Anikin

February 28, 2011 at 1:45 pm

Posted in Databases

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: