Sql-server 2005 Database File Recovery: Conformance-based logical I/O errors detected

Source: Internet
Author: User
Tags execution log microsoft sql server sql server books mssql server error log

Today the Sql-server database suddenly complains:

SQL Server has detected a consistent, logical I/O error checksum (should be: 0x7c781313, but actually: 0X67A313C9). In the file ' C:\Program Files\Microsoft SQL Server\mssql.1\mssql\data\e_block_db.mdf ', the offset is 0x00000000a34000 to the page in database ID 5 (1 : 1306 This error occurred during read execution. The SQL Server error log or other messages in the System event log may provide more detailed information. This is a serious error condition that threatens the integrity of the database and must be corrected immediately. Please perform a complete database consistency check (DBCC CHECKDB). This error can be caused by a number of factors; For more information, see SQL Server Books Online.

Toss for a long time, the solution is as follows:

Step one: Create a database with the same name, stop SQL SERVER2005, and overwrite the. mdf database files and. ldf files that cannot be opened to two files in the newly created F database

Step Two: Restart the database

Step three: Run the following code in Query Analyzer:

Alter DB database name set emergency-set database to a critical state

Use master

DECLARE @databasename varchar (255)

Set @databasename = ' database name '-Your. mdf file name

exec sp_dboption @databasename, n ' single ', n ' true '-set the target data base to Single-user state

DBCC CHECKDB (@databasename, Repair_allow_data_loss)

DBCC CHECKDB (@databasename, Repair_rebuild)

exec sp_dboption @databasename, n ' single ', n ' false '-set target data base to multiuser state

Fourth step: Execution appears "The other files of the database do not match the database main file ..." error, do it again.

See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/database/SQLServer/

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.