MSSQLSERVER_824MSSQLSERVER_824

适用于:Applies to: 是SQL ServerSQL Server(所有支持的版本)yesSQL ServerSQL Server (all supported versions) 适用于:Applies to: 是SQL ServerSQL Server(所有支持的版本)yesSQL ServerSQL Server (all supported versions)

详细信息Details

AttributeAttribute Value
产品名称Product Name SQL ServerSQL Server
事件 IDEvent ID 824824
事件源Event Source MSSQLSERVERMSSQLSERVER
组件Component SQLEngineSQLEngine
符号名称Symbolic Name B_HARDSSERRB_HARDSSERR
消息正文Message Text SQL Server 检测到基于一致性的逻辑 I/O 错误: %ls。SQL Server detected a logical consistency-based I/O error: %ls. 在文件 '%ls' 中、偏移量为 %#016I64x 的位置对数据库 ID %d 中的页 %S_PGID 执行 %S_MSG 期间,发生了该错误。It occurred during a %S_MSG of page %S_PGID in database ID %d at offset %#016I64x in file '%ls'. SQL Server 错误日志或系统事件日志中的其他消息可能提供了更详细信息。Additional messages in the SQL Server error log or system event log may provide more detail.

症状Symptom

如果读取或写入数据库页后逻辑一致性检查失败,你可能会在 SQL Server 错误日志或 Windows 应用程序事件日志中看到以下错误消息:You might encounter the following error message in the SQL Server error log or the Windows Application event log if a logical consistency check fails after reading or writing a database page:

2009-11-02 15:46:42.90 spid51      Error: 824, Severity: 24, State: 2.
2009-11-02 15:46:42.90 spid51      SQL Server detected a logical consistency-based I/O error: incorrect pageid (expected 1:43686; actual 0:0). It occurred during a read of page (1:43686) in database ID 23 at offset 0x0000001554c000 in file 'H:\MSSQL.SQL2008\MSSQL\DATA\my_db.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.

如果应用程序在查询或修改数据时遇到此消息,则会将错误消息返回给应用程序并终止数据库连接。If an application encounters this message while querying or modifying data, the error message is returned to the application and the database connection is terminated.

原因Cause

此错误表明 Windows 报告已从磁盘成功读取页,但 SQL ServerSQL Server 检测到页中存在错误。This error indicates that Windows reports that the page is successfully read from disk, but SQL ServerSQL Server has discovered something wrong with the page. 此错误与错误 823 类似,只是 Windows 检测不到此错误。此错误通常表示 I/O 子系统出现了问题,如磁盘驱动器故障、磁盘固件问题、设备驱动程序故障等。This error is similar to error 823 except that Windows did not detect the error and usually indicates a problem in the I/O subsystem, such as a failing disk drive, disk firmware problems, faulty device driver, and so on. 有关 I/O 错误的详细信息,请参阅 Microsoft SQL Server I/O 基础知识,第 2 章For more information about I/O errors, see Microsoft SQL Server I/O Basics, Chapter 2.

SQL Server 使用 Windows API(例如 ReadFile、WriteFile、ReadFileScatter、WriteFileGather)执行 I/O 操作。SQL Server uses Windows APIs, e.g., ReadFile, WriteFile, ReadFileScatter, WriteFileGather] to perform the I/O operations. 执行这些 I/O 操作后,SQL Server 检查所有与这些 API 调用相关联的错误条件。After performing these I/O operations, SQL Server checks for any error conditions associated with these API calls. 如果这些 API 调用因操作系统错误而失败,则 SQL Server 报告错误 823。If these API calls fail with an Operating System error, then SQL Server reports the Error 823. 在某些情况下,Windows API 调用确实成功了,但 I/O 操作传输的数据可能已经遇到逻辑一致性问题。There can be situations where the Windows API call actually succeeds but the data transferred by the I/O operation might have encountered a logical consistency problem. 这些逻辑一致性问题通过错误 824 报告。These logical consistency problems are reported through Error 824.

824 错误包含下列信息:The 824 error contains the following information:

  • I/O 操作面向的数据库文件The database file against which the I/O operation is performed
  • 在其中尝试执行 I/O 操作的文件的偏移The offset with the file where the I/O operation was attempted
  • 此文件所属的数据库The database to which this file belongs
  • I/O 操作中涉及的页码The page number that was involved in the I/O operation
  • 操作是读取还是写入操作Was the operation a read or write operation
  • 有关失败的逻辑一致性检查的详细信息(用于此检查的检查类型、实际值和预期值)Details about the logical consistency check that failed [The type of check, actual value and expected value used for this check]

这些逻辑一致性检查是 SQL Server 执行的附加完整性检查,用于确保在整个 I/O 操作期间维护数据传输中涉及的数据的某些关键方面。These logical consistency checks are additional integrity checks performed by SQL Server to ensure certain key aspects of the data that was involved in the data transfer was maintained throughout the I/O Operation. 检查内容包括校验和、残缺页、短传输、页面 ID 错误、读取过时、页面审核失败。The checks include checksum, Torn Page, Short Transfer, Bad Page ID, Stale Read, Page Audit Failure. 根据数据库和服务器级别的不同配置选项,执行的检查的性质有所不同。The nature of the checks performed vary depending on different configuration options at the database and server level.

824 错误消息通常指示基础存储系统或硬件出现问题,或 I/O 请求路径中的驱动程序出现问题。The 824 error message usually indicates that there is a problem with underlying storage system or the hardware or a driver that is in the path of the I/O request. 如果文件系统中存在不一致,或者数据库文件已损坏,则可能遇到此错误。You can encounter this error when there are inconsistencies in the file system or if the database file is damaged.

解决方法Resolution

如果遇到错误 824,可以尝试以下解决方法:If you encounter error 824, you can try the following resolutions:

  • 查看 msdb 中的 suspect_pages 表,检查(同一数据库或不同数据库中的)其他页是否遇到此问题。Review the suspect_pages table in msdb to check if other pages [in the same database or different databases] are encountering this problem.
  • 使用 DBCC CHECKDB 命令检查位于同一卷(824 消息中所报告的卷)上的数据库的一致性。Check the consistency of the databases that are located in the same volume [as the one reported in the 824 message] using DBCC CHECKDB command. 如果发现 DBCC CHECKDB 命令不一致,请使用知识库文章如何解决 DBCC CHECKB 报告的数据库一致性错误中的指南。If you find inconsistencies from the DBCC CHECKDB command, use the guidance from Knowledge Base article How to troubleshoot database consistency errors reported by DBCC CHECKDB.
  • 如果遇到这些 824 错误的数据库没有启用“PAGE_VERIFY CHECKSUM”数据库选项,请立即执行此操作。If the database that encounters these 824 errors does not have the PAGE_VERIFY CHECKSUM database option turned on, do so immediately. 824 错误可能由于校验和失败以外的其他原因发生,但 CHECKSUM 提供了在页写入磁盘后验证其一致性的最佳选项。824 errors can occur for other reasons than a checksum failure but CHECKSUM provides the best option to verify consistency of the page after it has been written to disk.
  • 查看 Windows 事件日志中是否存在从操作系统或存储设备/设备驱动程序中报告的错误或消息。Review the Windows Event logs for any errors or messages reported from the Operating System or a Storage Device or a Device Driver. 如果它们与此错误有某种关联,请先解决这些错误。If they are related to this error in some manner, please address those errors first. 例如,除了 824 消息以外,你还可能会注意到事件日志中的磁盘源报告的“驱动程序检测到 \Device\Harddisk4\DR4 上的控制器错误”之类的事件。For example, apart from the 824 message, you may also notice an event like "The driver detected a controller error on \Device\Harddisk4\DR4" reported by the Disk source in the Event Log. 在这种情况下,你须评估此设备上是否存在此文件,然后先更正这些磁盘错误。In that case, you have to evaluate if this file is present on this device and then first correct those disk errors.
  • 使用 SQLIOSim 实用工具确定这些 824 错误是否可在常规 SQL Server I/O 请求之外重现。Use the SQLIOSim utility to find out if these 824 errors can be reproduced outside of regular SQL Server I/O requests. SQLIOSim 随 SQL Server 2008 进行装配,因此不需要在此版本或更高版本上单独下载。SQLIOSim ships with SQL Server 2008 so there is no need for a separate download on this version or later.
  • 与硬件供应商或设备制造商合作,确保:Work with your hardware vendor or device manufacturer to ensure:
    • 硬件设备和配置符合 SQL Server 的 I/O 要求The hardware devices and configuration conforms to the I/O requirements of SQL Server.
    • I/O 路径中所有设备的设备驱动程序和其他支持软件组件都是最新的。The device drivers and other supporting software components of all devices in the I/O path are updated.
  • 如果硬件供应商或设备制造商为你提供了一些诊断实用工具,请用这些实用工具评估 I/O 系统的运行状况。If the hardware vendor or device manufacturer provided you with any diagnostic utilities, use them to evaluate the health of the I/O system.
  • 评估在遇到问题的这些 I/O 请求的路径中是否存在筛选器驱动程序。Evaluate if there are Filter Drivers that exist in the path of these I/O requests that encounter problems.
    • 检查这些筛选器驱动程序是否有任何更新Check if there are any updates to these filter drivers
    • 能否删除或禁用这些筛选器驱动程序,以观察导致 824 错误的问题是否消失Can these filter drivers be removed or disabled to observe if the problem that results in the 824 error goes away
  • 如果出现的问题与硬件无关,并且已知的干净备份可用,则请从备份中还原数据库。If the problem is not hardware-related and a known clean backup is available, restore the database from the backup.

另请参阅See Also

管理 suspect_pages 表 (SQL Server)Manage the suspect_pages Table (SQL Server)