SQL 2K5 Suspect Mode Database (EMERGENCY MODE)
Now Fix the database:
USE master;
GO
---configure database set option: ONLINE:OFFLINE:EMERGENCY.
---Emergency: allows access to the database for data moving.(Read Only Mode)
ALTER DATABASE sandbox SET EMERGENCY
GO
--- EMERGENCY MODE ALLOWS FOR DBCC CHECKDB, Allow data loss option requires single user mode.
ALTER DATABASE sandbox SET SINGLE_USER
GO
/*
if this statement succeeds the database is brought back online.
you'll need to set it to multi-user mode.
if it fails, there's no way to recover. You'll need to restore from backup.
NO_INFOMSGS : Suppresses all informational messages (Severity 10) and the report of space used.*/
DBCC CHECKDB (sandbox, REPAIR_ALLOW_DATA_LOSS) WITH NO_INFOMSGS;
GO
--- use my db.
USE sandbox
GO
--- Checks the allocation and structural integrity of all the objects in the specified database.
DBCC CHECKDB WITH NO_INFOMSGS;
SQL 2K5 Suspect Mode Database (EMERGENCY MODE)
There are many reasons a database could become suspect. A quick fix option.