SQL Server 2005/2008 database is marked as "suspect" workaround

Source: Internet
Author: User
Tags microsoft sql server mssqlserver management studio microsoft sql server management studio sql server management sql server management studio

When working with SQL Server 2005 relational databases on a daily basis, it is sometimes unusual for a database (such as SharePoint site configuration database name Sharepoint_config) to stop the database for no reason, such as when the database is read and write, resulting in SQL Server 2005 the database is not properly interrupted, when the database is opened again will find some database will be marked as "suspicious" (suspect), that is, the database name with a yellow exclamation point, the database can no longer be opened, but the structure of the database and data content are still there.
Workaround:
When this operation failure occurs in the database, follow the steps below to resolve the problem, open the SQL Query Editor window in the database and run the following command.
1, modify the database for emergency mode

1 ALTER DATABASE sharepoint_config SET EMERGENCY

2. Turn the database into single-user mode

1 ALTER DATABASE sharepoint_config SET single_user

3. Repair the database log rebuild, this command checks the allocation, structure, logical integrity and errors in all database objects. When you specify "Repair_allow_data_loss" as the DBCC CHECKDB command parameter, the program examines and fixes the reported errors. However, these fixes may cause some data loss.

1DBCC CheckDB (sharepoint_config, Repair_allow_data_loss)

The following warning may appear after the command execution is complete:

Warning: The Log for database ' Sharepoint_config ' has been regenerated. The consistency of the transaction has been lost. The RESTORE chain is broken and the server no longer has the context of the previous log files, so you need to know what they are. You should run DBCC CHECKDB to verify physical consistency. The database has been placed in dbo-only mode. When you are ready to make the database available, you need to reset the database options and remove any extra log files.

At this point, you can turn off Microsoft SQL Server Management Studio by ignoring this warning.

4. Reopen Microsoft SQL Server Management Studio to turn the database back into multi-user mode

1ALTER DATABASE sharepoint_config SET multi_user

5. Start-to-run input cmd-> open the DOS command window and enter the following command to restart the database service
Net stop MSSQLSERVER--stop service
Net start MSSQLSERVER--Start service
Again, when you open SQL Server 2005, the database that is marked as "suspect" is restored to its normal state.

SQL Server 2005/2008 database is marked as "suspect" workaround

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.