How to fix a suspicious error in SQL Server database

Source: Internet
Author: User

First, the main database appears suspicious repair method:

The first method:

When this operation failure occurs in the database, you can do this by following the steps below, open the SQL Query Editor window in the database and run the following command:

Modify the database to emergency mode

ALTER Database name SET EMERGENCY

? Make the database single-user mode

ALTER Database name SET single_user

? fix database log rebuild, this command checks the allocation, structure, logical integrity, and the objects in all databases are incorrect. When you specify "Repair_allow_data_loss" as the DBCC CHECKDB command parameter, the program checks and corrects the report incorrectly. However, these fixes may result in some data loss.

DBCC CheckDB (database name, Repair_allow_data_loss)

Change the database back to multi-user mode

ALTER Database name SET multi_user

A database that is marked as "suspect" is restored to a healthy state when you restart SQL Server

The second method:

If you have a database full backup, build a database with the same name as the suspect database on other SQL Server machines, restore the full backup to the pre-built database, and then copy the LDF and MDF files from the new database to the directory that can be database.

Second, the msdb system database is suspicious

To install SQL Server 2005 from a different machine stop the SQL Servers service

Copy the Msdbdata.mdf and msdblog.ldf from the C:\Program Files\Microsoft SQL Server\MSSQL\Data to your computer and overwrite it, and start the SQL Server service from the new one. This solves the problem. (Recommended to put your original msdbdata.mdf and msdblog.ldf back under)

If the copy comes from a single user, then right-click the library's properties-options-restrict access to multi_user on it, there is no problem, it is recommended to try after backup

How to fix a suspicious error in SQL Server database

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.