Database file Corruption Repair

Source: Internet
Author: User

"Scene":
Only the database name in the Object Browser, the database does not open, view the log "the log cannot be rebuilt because the database is not completely shut down." , presumably because the server is abnormally shut down, causing the database not to write data properly.

"Processing method": Repair the data, discard the exception data.
DBCC CHECKDB (MyDB, Repair_allow_data_loss), if you want to use a single user

"Complete Processing Method":

The ALTER database [mydb] SET emergency--emergency state is marked as READ_ONLY, disables logging, and is accessible only to members of the sysadmin fixed server role. EMERGENCY is primarily used for troubleshooting. ALTER DATABASE [MYDB] set SINGLE_USERDBCC CHECKDB (MyDB, REPAIR_ALLOW_DATA_LOSS) ALTER DATABASE [MYDB] set Multi_user

Note
If the above execution is unsuccessful, proceed as follows:
1, Database MyDB offline
2. Copy the MDF file to the new location
3, delete the original database MyDB
4, create a new library MyDB
5, Offline MyDB
6. Overwrite the backed-up MDF file with the new library
7, online new library, this is the suspect status
8. Perform "Complete processing"

Database file Corruption Repair

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.