Today Sql-server database suddenly error:
SQL Server detected a consistency-based logical I/O error checksum is incorrect (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 in the location of the page in database ID 5 (1 : 1306) The error occurred during read execution. Additional messages in the SQL Server error log or 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 full database consistency check (DBCC CHECKDB). This error can be caused by many factors; For more information, see SQL Server Books Online.
For a long time, the solution is as follows:
First step: Establish a database with the same name, stop SQL SERVER2005, overwrite the. mdf database file and the. ldf file that cannot be opened, overwriting the two files of the newly created F database
Step Two: Restart the database
Step three: Run the following code in Query Analyzer:
ALTER DATABASE name set emergency-sets the database to a state of emergency
Use master
DECLARE @databasename varchar (255)
Set @databasename = ' database name '-Your. mdf file filename
exec sp_dboption @databasename, n ' single ', n ' true '-set the target database 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 the target data base to multi-user state
Fourth step: Perform the "Database other files do not match the database Master file ..." error, and then execute again.