The server shuts down directly, then turns on, the database is broken when the hard restart, the status is "suspicious" solution

Source: Internet
Author: User

Server put the website is normal, is remote connect not, anxious pity dorado things, let the machine room person to restart the server, there is generally directly shut down, then boot, hard restart.

There have been no anomalies before, but today after the hard restart, found that the site error, a look at the original database status of "suspicious", can not be used, it was a surprise to me, the first time encountered this problem.

Search on the Internet, find a solution, it works, very good, record a bit.

Home IIS and some database services to stop, 80 and 1433 ports in the firewall is also forbidden to connect, meaning is not to allow access, not to affect the speed of execution.

Replace the dbname with the bad database name, the current database selected master, the steps are as follows:

1, modify the database for emergency mode
ALTER DATABASE DbName SET EMERGENCY

2. Turn the database into single-user mode
ALTER DATABASE DbName 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.
DBCC CheckDB (DbName, Repair_allow_data_loss)

4. Turn the database back into multi-user mode
ALTER DATABASE DbName SET multi_user

It takes only four steps to get there.

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.