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/