"SQL Server" "Recover pending Solution" prompt when attaching files "The log cannot be rebuilt because there is an open transaction/user when the database shuts down, the database does not have checkpoints, or the database is read-only. "Database Recovery"

Source: Internet
Author: User

Summary article: Http://www.cnblogs.com/dunitian/p/4822808.html#tsql

Paste Error First:

Spit on the trough for a moment:

Go to the Chase:

Create a new database with the same name

Stop MSSQL Service

Replacing database files

Re-enable MSSQL service

See:

Setting up the database for emergency mode

ALTER DATABASE bigdata_testinfo SET emergency

Quick fix (if there is a problem please try, [repair_rebuild-rebuild Index and fix] and [repair_allow_data_loss-allow lost data repair method])

--DBCC CHECKDB usage (Manual Repair Database)--Check Database Integrity--dbcc checkdb (' database name ')--go--quick fix--dbcc checkdb (' database name ', repair_fast)-- go--rebuild the index and fix--dbcc checkdb (' database name ', repair_rebuild)--go--if necessary to allow loss of data repair--DBCC checkdb (' database name ', Repair_allow_data_loss)- -go

Restore to multi-user mode after successful repair ( turn off other query windows if an error occurs )

ALTER DATABASE Bigdata_testinfo set Multi_user

You refresh the database and you find out, okay ~

Scared to the point, quickly check the data there is no problem (formerly)

The size of the wood is also changed

Expand:

Someone attached to the time found ... Tips for rejecting xxx

Uh.. is actually not open permission:

Leave the current user's permission open and OK.

If you are a multi-user and you are afraid of trouble, set everyone's permissions

It's time to finish this.

Quick fix and set user back to multi-user mode

"SQL Server" "Recover pending Solution" prompt when attaching files "The log cannot be rebuilt because there is an open transaction/user when the database shuts down, the database does not have checkpoints, or the database is read-only. "Database Recovery"

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.