Summary: | Things that can cause a database to go into Suspect mode:
- Improper shutdown of the SQL Server Service (like "End Task" of the service, hard restart of machine)
- Hardware failure
- Not enough disk space
- Various corruptions of db file (mdf or ldf)
- The transaction log has been corrupted, deleted etc.
Steps to recover database from SUSPECT: Logon to your server and ensure that you have sufficient disk space for data and log. Ensure your hard drives are healthy. Before proceeding the cause of failure needs to be resolved.
- Login to SQL Server using "System Administrator" account
Figure 1: Database LINKSOFT showing as SUSPECT
- Reset the status of SUSPECT
EXEC sp_resetstatus 'LINKSOFT';
Figure 2: Reset database status
- Set database to Emergency mode
ALTER DATABASE LINKSOFT SET EMERGENCY
Figure 3: Database mode set to Emergency
- Set database to single user mode
ALTER DATABASE LINKSOFT SET SINGLE_USER WITH ROLLBACK IMMEDIATE
Figure 4: Database set to Single User
- Check db for errors and allow for auto repair
dbcc checkdb('LINKSOFT',REPAIR_ALLOW_DATA_LOSS)
Figure 5: Check database with allow auto repair
- Set database to multi user mode
ALTER DATABASE LINKSOFT SET MULTI_USER
Figure 6: Database mode changed to Multi User
At this point the database should be operational. |