Wednesday, March 22, 2006

SQL: SQL Server marks DB as Suspect.

I hope it won't happen to you often, but it may occur you see a database in the Enterprise Manager marked as suspect. When so, you won't be able to open it or drop it. When a reboot of SQL server doesn't help, you can try the following:

use master
go
exec sp_resetstatus msdb -- replace msdb with your database name


Restart SQL server and you should be able to access the database again.

Run DBCC NEWALLOC, DBCC TEXTALL, and DBCC CHECKDB.

If you still can't access the DB, try the following:
Bypass (Emergency) mode and DUMP TRANSACTION WITH NO_LOG

No comments: