Friday, 20 May 2011

SQL Server: Database marked as suspect

If SQL Server thinks there is something wrong with a database - it will mark it as suspect to prevent any further damage, and refuse to mount it.

There are a couple of things we can to get things up and running again.

1. Instruct the server to mount the DB. This is done using the Query Analyser and feeding instructions to the server.
2. Check the database for corruption.
3. Put the system into production once we are sure the DB is 100%.

Refer to this for step 1:

The reset command is:

sp_resetstatus @dbname = "db_name")

* replace db_name with the database name.

For the DBCC checks:

The check command is:

DBCC CHECKDB('db_name')

* replace db_name with the database name.

No comments:

Post a Comment