Issue
CyberStation is unable to connect to the database.
ODBC test also fails when testing the connection to the database.
Product Line
Andover Continuum
Environment
- CyberStation
- SQL server
- SQL management studio
Cause
SQL server not on UPS.
Server shut down due to a power failure.
Looking at the ContinuumDB using the SQL Management Studio shows the database has been marked as suspect. ContinuumDB (SUSPECT)
The database may be marked suspect for the following reasons
- System Issues
- Transaction Log File is Missing
- SQL Server Crash
- Database Files are inaccessible
- SQL Server Database Operation Failures
- Due to Improper shut down of SQL Server System (as mentioned above)
- Due to Sudden Power Outage
- Low Disk Space Issues
- Hardware Failure
Resolution
The database may have been damaged by the ungracious shutdown.
The restore option is grayed out and must first be re-enabled before a restore operation can be allowed.
How to recover a database in suspect mode
- Clear the suspect mode of the database using sp_resetstatus DatabaseName. This will clear the suspect flag and make the database available online. The SQL Server must be stopped and re-started.
- Change the database status to Emergency using the following command.
ALTER DATABASE DatabaseName SET EMERGENCY; - Restrict database to single user by changing the access mode as mentioned below
ALTER DATABASE DatabaseName SET SINGLE_USER;
If the restore option is now enabled skip step 4 - Run the CHECKDB command with “REPAIR_ALLOW_DATA_LOSS” option. This option should be tried as the last option as it always behaves the way it is named. We are not sure of what data it removes.
DBCC CHECKDB (DatabaseName, REPAIR_ALLOW_DATA_LOSS) WITH NO_INFOMSGS, ALL_ERRORMSGS
If the repair operation is successful the database is now usable but if a recent backup is available it is strongly recommended to restore the database. - Restore the most recent backup of the Continuum database.
- Set the ContinuumDB owner using the query
SP_ChangeDBOwner 'Andover97'