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;



  1. Stop Microsoft® SQL Server.
  2. 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.
  3. Open SQL Server Management Studio and connect your database
  4. Select the New Query option

  5. Turn off the suspect flag on the database and set it to EMERGENCY

    • EXEC sp_resetstatus ‘db_name’;

    • ALTER DATABASE db_name SET EMERGENCY

  6. Perform a consistency check on the master database
    • DBCC CHECKDB (‘database_name’)
  7. Bring the database into the Single User mode and roll back the previous transactions 
    • ALTER DATABASE database_name SET SINGLE_USER WITH ROLLBACK IMMEDIATE 
  8. Attempt the Database Repair allowing some data loss
    • DBCC CHECKDB (‘database_name’, REPAIR_ALLOW_DATA_LOSS) 
  9. Bring the database into the Multi-User mode
    • ALTER DATABASE database_name SET MULTI_USER 
  10. Refresh the database server and verify the connectivity of database 



Some reasons this may occur is

  1. The system failed to open the device where the data or the log file resides.
  2. Cannot find the file specified during the creation or opening of the physical device.
  3. SQL server crashed or restarted in the middle of a transaction thus corrupting the transactions log.
  4. Cannot access data or log file while coming online, because of the installed antivirus.
  5. The database server was shut down improperly.
  6. Lack of Disk Space.
  7. SQL cannot complete a rollback or roll forward operation.
  8. Database files are being held by the operating system, third-party backup software, etc.