Sql-server – MSSQL error: consistency-based I/O error – can it be caused by an MSSQL or OS problem

sql serversql-server-2005

This is what I saw in the windows error log:

SQL Server detected a logical consistency-based I/O error:
incorrect checksum (expected: 0x19fedd20; actual: 0x19fed5e3).
It occurred during a read of page (1:1764) in database ID 6 at offset 0x00000000dc8000 in file
'D:\mssql\local_repository_pbdiffimport.mdf'.
Additional messages in the SQL Server error log or system event log may provide more detail.
This is a severe error condition that threatens database integrity and must be corrected immediately.
Complete a full database consistency check (DBCC CHECKDB). This error can be caused by many factors;
for more information, see SQL Server Books Online.

I ran

dbcc checkdb

which told me I should restore with option REPAIR_ALLOW_DATA_LOSS, so I eventually ran

DBCC CHECKDB (my_db_name, REPAIR_ALLOW_DATA_LOSS) WITH NO_INFOMSGS

But that resulted in about 2'000 rows being lost. I restored a backup but now I'm afraid this will happen again since we already had a consistency problem in the same database about 2 weeks ago but then it happened in an index (recreated indexes solved the problem).

We have investigated the discs – RAID5 looks good, no errors, and also none of the disc-check-utilities have revealed any hardware problem.

Can this be caused by OS (Windows Server 2003) or by MSSQL (MSSQL Server 2005)?

Best Answer

The consistency could be caused by any of the factors hardware or software. Look at the SQL logs to investigate what potentially caused the issue.

My suggestions:

  • Ensure that the Database option, Page_Verify is set to CHECKSUM. This verifies all writes before they happen and is the default setting on SQL Server 2005.
  • Backup daily or multiple times a day(depending on need)
  • Setup maintenance plans to check your database for consistency on a daily basis
  • Keep your Windows Server and Sql Server updated with patches, 3rd Software too.
  • Read "Top tips for effective database maintenance" as it explains most of my suggestions in greater detail.

I recommend this article a lot because it was written to help SysAdmins who don't know to manage a database server.

Related Topic