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

屬性Attribute Value
產品名稱Product Name SQL ServerSQL Server
事件識別碼Event 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 的資料庫識別碼 %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 Basics, Chapter 2 (第 2 章 Microsoft SQL Server I/O 基本概念)。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. 這些檢查包括總和檢查碼、損毀頁、短傳輸、錯誤頁面識別碼、過時讀取、頁面稽核失敗。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 CHECKDB 報告的資料庫一致性錯誤進行疑難排解 (機器翻譯) 中的指引。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)