This article describes how to recover a database from suspect Mode with SQL.
- Switch the database to the Emergency Mode.
- Start the Microsoft SQL Server Management Studio and connect your database.
- Choose "New Query".
- Turn off the suspect flag on the database and switch it to EMERGENCY.
- EXEC sp_resetstatus 'db_name';
- ALTER DATABASE db_name SET EMERGENCY
- Perform the function Consistency Check on the Master Database.
- DBCC CHECKDB ('database_name')
- Bring the database into Single User Mode, and then roll back the previous transactions.
- ALTER DATABASE database_name SET SINGLE_USER WITH ROLLBACK IMMEDIATE
- Back up the database since the next operation may cause data loss.
- Execute Database Repair allowing some data loss.
- DBCC CHECKDB ('database_name', REPAIR_ALLOW_DATA_LOSS)
- Change the database into Multi-User Mode.
- ALTER DATABASE database_name SET MULTI_USER
- Refresh the SQL database server and check the connectivity of the database.
Comments
Article is closed for comments.