Open main menu

Matrix Wiki β

Forum - Recovering DB from Suspect Mode

Overview > Matrix Access Control & Time-Attendance > Database Related Issues > Recovering DB from Suspect Mode
[#4]
DB in Suspect Mode.jpg


Possible reasons of the database going into suspect mode are:

  1. Log files or data files
  2. Due to lack of disk space, suspect mode like issue crops up in SQL Server database.
  3. Due to improper shutdown of DB server
  4. Inability of SQL Server to Roll-back operation or Roll-forward operation

Solution:

  1. To recover the database from the suspect mode, we need to connect SQL Server Management studio using ‘sa’ login credentials
  2. Run this following query one by one:


EXEC sp_resetstatus ‘COSEC';


Step 1.jpg


ALTER DATABASE COSEC SET EMERGENCY


Step 2.jpg


DBCC checkdb ('COSEC')


Step 3.jpg


ALTER DATABASE COSEC SET SINGLE_USERWITH ROLLBACK IMMEDIATE


Step 4.jpg


DBCC CheckDB ('COSEC', REPAIR_ALLOW_DATA_LOSS)


Step 5.png


ALTER DATABASE COSEC SET MULTI_USER


Step 6.jpg


Now DB is online:


Step 7.jpg

Posted by Admin (administrator) on 7 January 2019 at 07:06.
Edited by Admin (administrator) on 8 January 2019 at 11:20.