Skip to content

Commit b23e5b9

Browse files
Merge pull request #36720 from haywoodsloan/9866-update-error-823
AB#9866: Add OS error 21 example to SQL error 823 page
2 parents 46739a3 + 5357b07 commit b23e5b9

1 file changed

Lines changed: 50 additions & 27 deletions

File tree

Lines changed: 50 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
---
2-
title: "MSSQLSERVER Error 823 | mssqlserver_823"
3-
description: A description and some common solutions to Microsoft SQL Server Error 823 (mssqlserver_823), which is a severe system-level error condition that threatens database integrity and must be addressed immediately.
4-
author: MashaMSFT
5-
ms.author: mathoma
6-
ms.reviewer: randolphwest
7-
ms.date: 05/30/2025
2+
title: MSSQLSERVER_823 - Database Engine error
3+
description: Learn about Microsoft SQL Server Error 823 (MSSQLSERVER_823), a severe system-level error condition that threatens database integrity and must be addressed immediately, and find common solutions.
4+
author: rwestMSFT
5+
ms.author: randolphwest
6+
ms.reviewer: mathoma
7+
ms.date: 03/09/2026
88
ms.service: sql
99
ms.subservice: supportability
10-
ms.topic: "reference"
10+
ms.topic: reference
1111
helpviewer_keywords:
1212
- "823 (Database Engine error)"
1313
---
@@ -18,7 +18,7 @@ helpviewer_keywords:
1818
## Details
1919

2020
| Attribute | Value |
21-
| :--- | :--- |
21+
| --- | --- |
2222
| Product Name | SQL Server |
2323
| Event ID | 823 |
2424
| Event Source | MSSQLSERVER |
@@ -28,47 +28,70 @@ helpviewer_keywords:
2828

2929
## Explanation
3030

31-
SQL Server uses Windows APIs (for example, [ReadFile](/windows/win32/api/fileapi/nf-fileapi-readfile), [WriteFile](/windows/win32/api/fileapi/nf-fileapi-writefile), [ReadFileScatter](/windows/win32/api/fileapi/nf-fileapi-readfilescatter), [WriteFileGather](/windows/win32/api/fileapi/nf-fileapi-writefilegather)) to perform file I/O operations. After SQL Server performs these I/O operations, it checks for any error conditions associated with these API calls. If the API calls fail with an Operating System error, then SQL Server reports Error 823.
31+
SQL Server uses Windows APIs, such as [ReadFile](/windows/win32/api/fileapi/nf-fileapi-readfile), [WriteFile](/windows/win32/api/fileapi/nf-fileapi-writefile), [ReadFileScatter](/windows/win32/api/fileapi/nf-fileapi-readfilescatter), and [WriteFileGather](/windows/win32/api/fileapi/nf-fileapi-writefilegather), to perform file I/O operations. After SQL Server performs these I/O operations, it checks for any error conditions associated with these API calls. If the API calls fail with an operating system (OS) error, SQL Server reports Error 823.
3232

3333
The 823 error message contains the following information:
3434

3535
- The database file against which the I/O operation was performed.
36-
- The offset within the file where the I/O operation was attempted. This is the physical byte offset from the start of the file. Dividing this number by 8,192 gives you the logical page number that is affected by the error.
36+
37+
- The offset within the file where the I/O operation was attempted. This offset is the physical byte offset from the start of the file. Dividing this number by 8,192 gives you the logical page number that the error affects.
38+
3739
- Whether the I/O operation is a read or write request.
38-
- The Operating System error code and error description in parentheses.
3940

40-
**Operating system error:** A read or write Windows API call isn't successful, and SQL Server encounters an operating system error that is related to the Windows API call. The following message is an example of an 823 error:
41+
- The operating system error code and error description in parentheses.
42+
43+
### Errors generated by the operating system
44+
45+
An operating system error occurs when a read or write Windows API call isn't successful, and SQL Server encounters an operating system error related to the Windows API call. The following message is an example of an 823 error:
4146

4247
```output
4348
Error: 823, Severity: 24, State: 2.
44-
2010-03-06 22:41:19.55 spid58 The operating system returned error 1117 (The request could not be performed because of an I/O device error.) to SQL Server during a read at offset 0x0000002d460000 in file 'e:\program files\Microsoft SQL Server\mssql\data\mydb.MDF'. Additional messages in the SQL Server error log and system event log may provide more detail. This is a severe, system-level error condition that threatens database integrity and must be corrected immediately. It is recommended to complete a full database consistency check (DBCC CHECKDB). This error can be caused by many factors; for more information, see SQL Server Books Online.
49+
The operating system returned error 1117 (The request could not be performed because of an I/O device error.) to SQL Server during a read at offset 0x0000002d460000 in file 'E:\Program Files\Microsoft SQL Server\MSSQL\Data\mydb.MDF'. Additional messages in the SQL Server error log and system event log may provide more detail. This is a severe, system-level error condition that threatens database integrity and must be corrected immediately. It is recommended to complete a full database consistency check (DBCC CHECKDB). This error can be caused by many factors; for more information, see SQL Server Books Online.
4550
```
4651

47-
You might see errors from the DBCC CHECKDB statement on the database that is associated with the file in the error message. You can run the DBCC CHECKDB statement when you see an 823 error. If the DBCC CHECKDB statement doesn't report any errors, you probably have an intermittent system problem or a disk problem.
52+
### Errors generated by DBCC CHECKDB
4853

49-
Additional diagnostic information for 823 errors might be written to the SQL Server error log file when you use trace flag 818.
50-
For more information, see [SQL Server diagnostics detects unreported I/O problems due to stale reads or lost writes](/troubleshoot/sql/database-engine/database-file-operations/diagnostics-for-unreported-io-problems).
54+
You might see errors from the `DBCC CHECKDB` statement on the database associated with the file in the error message. You can run the `DBCC CHECKDB` statement when you see an 823 error. If the `DBCC CHECKDB` statement doesn't report any errors, you probably have an intermittent system problem or a disk problem.
55+
56+
You can see more diagnostic information for 823 errors in the SQL Server error log file by using [trace flag 818](../../t-sql/database-console-commands/dbcc-traceon-trace-flags-transact-sql.md#tf818). For more information, see [SQL Server diagnostics detects unreported I/O problems due to stale reads or lost writes](/troubleshoot/sql/database-engine/database-file-operations/diagnostics-for-unreported-io-problems).
5157

5258
## Cause
5359

54-
The 823 error message usually indicates that there's 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. For a file read, SQL Server has already retried the read request four times before it returns 823. If the retry operation succeeds, the query doesn't fail, but message [MSSQLSERVER_825](mssqlserver-825-database-engine-error.md) is written into the ERRORLOG and Event Log.
60+
The 823 error message usually indicates that there's a problem with the underlying storage system, or the hardware or a driver that's 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. For a file read, SQL Server retries the read request four times before it returns 823. If the retry operation succeeds, the query doesn't fail, but message [MSSQLSERVER_825](mssqlserver-825-database-engine-error.md) is written into the ERRORLOG and Event Log.
5561

5662
## User action
5763

58-
- Review the [suspect_pages](../system-tables/suspect-pages-transact-sql.md) table in `msdb` for other pages that are encountering this problem (in the same database or different databases).
64+
- Review the [suspect_pages](../system-tables/suspect-pages-transact-sql.md) table in `msdb` for other pages that encounter this problem (in the same database or different databases).
5965

60-
- Check the consistency of databases located on the same volume (as the one reported in the 823 message) using DBCC CHECKDB command. If you find inconsistencies from the DBCC CHECKDB command, use the guidance from [How to troubleshoot database consistency errors reported by DBCC CHECKB](/troubleshoot/sql/database-engine/database-file-operations/troubleshoot-dbcc-checkdb-errors).
66+
- Check the consistency of databases located on the same volume (as the one reported in the 823 message) using the `DBCC CHECKDB` command. If you find inconsistencies from the `DBCC CHECKDB` command, use the guidance from [How to troubleshoot database consistency errors reported by DBCC CHECKB](/troubleshoot/sql/database-engine/database-file-operations/troubleshoot-dbcc-checkdb-errors).
6167

62-
- 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're related to this error in some manner, address those errors first. For example, apart from the 823 message, you might 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.
68+
- Review the Windows Event logs for any errors or messages reported from the *operating system*, a *storage device*, or a *device driver*. If they're related to this error in some manner, address those errors first. For example, apart from the 823 message, you might 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 need to evaluate if this file is present on this device and then correct those disk errors.
6369

64-
- Use the [Use the SQLIOSim utility to simulate SQL Server activity on a disk subsystem](/troubleshoot/sql/tools/sqliosim-utility-simulate-activity-disk-subsystem) utility to find out if these 823 errors can be reproduced outside of regular SQL Server I/O requests. The SQLIOSim utility ships with SQL Server 2008 and later versions so there's no need for a separate download. You can typically find it in your `C:\Program Files\Microsoft SQL Server\MSSQLxx.MSSQLSERVER\MSSQL\Binn` folder.
70+
- Use the [SQLIOSim](/troubleshoot/sql/tools/sqliosim-utility-simulate-activity-disk-subsystem) utility to find out if these 823 errors can be reproduced outside of regular SQL Server I/O requests. The SQLIOSim utility ships with SQL Server 2008 and later versions so there's no need for a separate download. You can typically find it in your `C:\Program Files\Microsoft SQL Server\MSSQLxx.MSSQLSERVER\MSSQL\Binn` folder.
6571

66-
- Work with your hardware vendor or device manufacturer to ensure
67-
- The hardware devices and configuration conform to the I/O requirements of SQL Server
68-
- The device drivers and other supporting software components of all devices in the I/O path are up to date
72+
- Work with your hardware vendor or device manufacturer to ensure:
73+
- The hardware devices and configuration conform to the I/O requirements of SQL Server.
74+
- The device drivers and other supporting software components of all devices in the I/O path are up to date.
6975

70-
- If the hardware vendor or device manufacturer provided you with any diagnostic utilities, use them to evaluate the health of the I/O system
76+
- If the hardware vendor or device manufacturer provided you with any diagnostic utilities, use them to evaluate the health of the I/O system.
7177

7278
- Evaluate if there are [filter drivers](/troubleshoot/sql/database-engine/performance/performance-consistency-issues-filter-drivers-modules) that exist in the path of these I/O requests that encounter problems.
73-
- Check if there are any updates to these filter drivers
74-
- Can these filter drivers be removed or disabled to observe if the problem that results in the 823 error goes away?
79+
80+
- Check if there are any updates to these filter drivers.
81+
82+
- Can you remove or disable these filter drivers to observe if the problem that results in the 823 error goes away?
83+
84+
### Example with OS error 21
85+
86+
In this case, the underlying OS error 21 indicates that the disk device is offline and not available for the OS and SQL Server to use.
87+
88+
```output
89+
Error: 823, Severity: 24, State: 2.
90+
The operating system returned error 21 (The device is not ready.) to SQL Server during a read at offset 0x0000002d460000 in file 'E:\Program Files\Microsoft SQL Server\MSSQL\Data\mydb.MDF'. Additional messages in the SQL Server error log and system event log may provide more detail. This is a severe, system-level error condition that threatens database integrity and must be corrected immediately. It is recommended to complete a full database consistency check (DBCC CHECKDB). This error can be caused by many factors; for more information, see SQL Server Books Online.
91+
```
92+
93+
#### Resolution
94+
95+
If you encounter a similar scenario, address the underlying OS error. In this case, work with your system administrator and hardware vendor to ensure that the disk device is online and functioning properly. Make sure there are no errors or damage reported.
96+
97+
An unstable network connection can also cause this error, for example when database files are stored on a network-attached storage (NAS) or SAN device accessed over the network. In cases like this one, you might have to check the physical integrity of the databases once the disk device is restored by running [DBCC CHECKDB](../../t-sql/database-console-commands/dbcc-checkdb-transact-sql.md). If database damage is reported, restore a last known good database backup.

0 commit comments

Comments
 (0)