If TheOrderExchange database is in suspect mode or if it is trying to recover the TOE system will have issues when trying to login in the front end. In this scenario the database need to be recovered. Try the following steps;
- Stop Microsoft® SQL Server.
- Backup the corrupted file(s) (mdf/ldf) before proceeding with any recovery activities. Use reliable non-local media such as CD or network drive to store backups.
- Open SQL Server Management Studio and connect your database
Select the New Query option
Turn off the suspect flag on the database and set it to EMERGENCY
EXEC sp_resetstatus ‘db_name’;
ALTER DATABASE db_name SET EMERGENCY
- Perform a consistency check on the master database
- DBCC CHECKDB (‘database_name’)
- Bring the database into the Single User mode and roll back the previous transactions
- ALTER DATABASE database_name SET SINGLE_USER WITH ROLLBACK IMMEDIATE
- Attempt the Database Repair allowing some data loss
- DBCC CHECKDB (‘database_name’, REPAIR_ALLOW_DATA_LOSS)
- Bring the database into the Multi-User mode
- ALTER DATABASE database_name SET MULTI_USER
- Refresh the database server and verify the connectivity of database
Some reasons this may occur is
- The system failed to open the device where the data or the log file resides.
- Cannot find the file specified during the creation or opening of the physical device.
- SQL server crashed or restarted in the middle of a transaction thus corrupting the transactions log.
- Cannot access data or log file while coming online, because of the installed antivirus.
- The database server was shut down improperly.
- Lack of Disk Space.
- SQL cannot complete a rollback or roll forward operation.
- Database files are being held by the operating system, third-party backup software, etc.