How To Repair A Suspect Database In MS SQL
You have a database in MS SQL that is tagged as (suspect) and you are unable to connect to the database.
- The database could have become corrupted.
- There is not enough space available for the SQL Server to recover the database during startup.
- The database cannot be opened due to inaccessible files or insufficient memory or disk space.
- The database files are being held by operating system, third party backup software etc.
- There was an unexpected SQL Server Shutdown, power failure or a hardware failure.
These steps require you to have Microsoft SQL Server Management Studio installed on your computer. If you do not have this installed please follow the steps outlined in the following article: How To Connect To Your MS SQL Database
Always back up the website before making any changes to the database . Shared hosting customers can do this through the Control Panel. Refer to Back Up Your Website Using Plesk. Dedicated server customers can back up the site either through the Control Panel, or through the Control Suite. Refer to How to Back Up a Domain Using Control Suite.
- Open Microsoft SQL Server Management Studio and connect to your database
- Click the New Query button
- Paste the following SQL script into your New Query page replacing [YourDatabase] with the name of your database.
DBCC CheckDB ([YourDatabase], REPAIR_ALLOW_DATA_LOSS)
- Click Execute
Your database should no longer be tagged as (suspect) and you should be able to access it.
Article ID: 398, Created: April 9, 2012 at 2:44 PM, Modified: August 26, 2014 at 9:15 AM