Microsoft SQL Server, Error: 823 一次真实的经历

1,Case Description

有Dev skype 我,说在使用SSMS 打开DB的时候,报错

“The operating system returned error 59(An unexpected network error occurred.) to SQL Server during a read at offset 0x00000000474000 in file ‘\\Serveryyy\\xxxx.ndf‘. 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. Complete a full database consistency check (DBCC CHECKDB). This error can be caused by many factors; for more information, see SQL Server Books Online. (Microsoft SQL Server, Error: 823)”

Error Number:823, 823错误说明Sql Server 在向OS申请某个页面的时候遇到 Windows 读取或写入请求失败。823错误是发出一个page 读写请求时发生的,和sql server 本身无关,通常是物理文件损坏导致此错误,如果真的是物理文件损坏,那就很难修复了。

这个Case 是由于 “An unexpected network error occurred” 导致的,我使用Windows Foler manger能够打开远程Serveryyy上的文件夹,这说明不是network的问题。错误消息中,已经提示使用DBCC CheckDB来 做一个database consistency check,我在做dbcc checkdb的时候,不能将db设置single user access mode,报的错误信息和上述相同,甚是棘手,无措ing。

2,查看Windows log, 在 Event Viewer中,看到在发生上述错误之前,Windows log 中还记录以下类型的错误

“The operating system returned error 2(The system cannot find the file specified.) to SQL Server during a read at offset 0x00000795e94000 in file ‘\\Serveryyy\\xxxx.ndf‘. 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. Complete a full database consistency check (DBCC CHECKDB). This error can be caused by many factors; for more information, see SQL Server Books Online.

唯一不同的是Error number和对error的描述,从Microsoft Support 中找到如下描述

SQL Server I/O and Windows API

SQL Server 2000 uses standard Windows API calls, such as ReadFile,   ReadFileScatter, WriteFile, and WriteFileGather, to perform I/O with its   database files. When SQL Server 2000 uses the Windows API calls, the file has   already been opened successfully, or SQL Server 2000 would not try to read from   it or write to it. Therefore, if a Windows API call is not successful and if   the error is anything other than the operating system error 6 ("Invalid   Handle"), the error is likely being raised in Windows or by a lower-level   software component, such as a device driver. Because the operating system error   6 is an invalid handle, the problem may occur if SQL Server is using an invalid   handle to make a Windows API call. However, this may still be a system problem.   
For example, if you encounter the following error message in the SQL   Server Errorlog file, SQL Server encountered operating system error 2 when it   uses a Windows API call to write to the tempdb primary database file:

Error: 823, Severity:   24, State: 4 I/O error 2(The system cannot find the file specified.)   detected during write at offset 0x00000000284000 in file ‘D:\Program   Files\Microsoft SQL Server\MSSQL\data\tempdb.mdf‘

Because SQL Server   has already successfully opened the file and did not receive an “Invalid   Handle” error, the error is likely being raised in a lower-level kernel   software component, such as the file system or a device driver. This problem does not indicate a problem in SQL Server, and it must be investigated as an   issue with the file system or a device driver that is associated with the file.

对Solution的描述模棱两可,“This problem does not indicate a problem in SQL Server”,查看msdb.dbo.suspect_pages,没有返回任何数据行,可能不是一个problem,稍感欣慰。

select *
from msdb.dbo.suspect_pages

The suspect_pages table is used for maintaining information about suspect pages, and is relevant in helping to decide whether a restore is necessary. The suspect_pages table resides in the msdb database and was introduced in SQL Server 2005.

A page is considered "suspect" when the SQL Server Database Engine encounters one of the following errors when it tries to read a data page:

  • An 823 error that was caused by a cyclic redundancy check (CRC) issued by the operating system, such as a disk error (certain hardware errors)
  • An 824 error, such as a torn page (any logical error)

我在windows Log 中看到 server 有一些update的,安装过一些更新包,如下图,

所以,我猜测server可能需要restart ,restart之后,问题解决。

参考文档:

https://support.microsoft.com/en-us/kb/828339

https://support.microsoft.com/en-us/kb/2015755

https://msdn.microsoft.com/en-us/library/ms191301(v=sql.110).aspx

时间: 2024-12-19 14:45:44

Microsoft SQL Server, Error: 823 一次真实的经历的相关文章

Invalid object name ‘sys.configurations’. (Microsoft SQL Server, Error: 208)

http://blogs.msdn.com/b/ramaprasanna/archive/2009/09/16/invalid-object-name-sys-configurations-microsoft-sql-server-error-208.aspx ---------- When you use Microsoft SQL Server Management Studio 2008 to access SQL Azure, if you get the following error

Microsoft SQL Server Version List(SQL Server 版本)

原帖地址 What version of SQL Server do I have? This unofficial build chart lists all of the known Service Packs (SP), Cumulative Updates (CU), patches, hotfixes and other builds of MS SQL Server 2014, 2012, 2008 R2, 2008, 2005, 2000, 7.0, 6.5 and 6.0 tha

Microsoft SQL Server 2012 附加数据库

今天闲来无事想看看以前的一个老旧的数据库,用Microsoft SQL Server 2012 附加数据库,结果悲剧了,出了一堆的错误,所幸经过几次尝试后终于解决了问题,错误信息如下,解决的方法也简单,以管理员身份运行SQL Server Management Studio,然后再附加数据库即可,写出来供大家参考. TITLE: Microsoft SQL Server Management Studio ------------------------------ Attach databas

SqlServer2005 provider: TCP 提供程序, error: 0 - 由于目标计算机积极拒绝,无法连接。) (Microsoft SQL Server,错误: 10061)问题解决

环境:win7 32位 数据库:sqlserver2005 报错过程: 按照sqlserver2005默认流程一步步安装的,以前启动一直正常, 今天启动本机安装的sqlserver2005,点击""登陆,时,报错:错误信息如下: 标题: 连接到服务器 ------------------------------ 无法连接到 XGL. ------------------------------ 其他信息: 在与 SQL Server 建立连接时出现与网络相关的或特定于实例的错误.未找到

Microsoft SQL Server,附加数据库 错误:Error 916解决方法

错误信息:错误提示:标题: Microsoft SQL Server Management Studio Express ——————————  无法为此请求检索数据. (Microsoft.SqlServer.Express.SmoEnum)  有关帮助信息,请单击: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&LinkId=20476  —————————— 其他信息:  执行 Transact-SQL 语句或批处

HOW TO CHECK FOR ACTIVE TRACE FLAGS ON MICROSOFT SQL SERVER

http://crashmag.net/how-to-check-for-active-trace-flags-on-microsoft-sql-server You check for active trace flags by running the following query. They may be global or they may be session based. Checking for active trace flags DBCC TRACESTATUS The out

P6 Professional Installation and Configuration Guide (Microsoft SQL Server Database) 16 R1

P6 Professional Installation and Configuration Guide (Microsoft SQL Server Database) 16 R1       May 2016 Contents About This Guide...................................................................................... 11 Shared Topics in This Guide .

Microsoft SQL Server 2016 RC3 安装

首先下载SQL Server 2016 RC3 安装iso 下载链接 ed2k://|file|cn_sql_server_2016_rc_3_x64_dvd_8566578.iso|2464823296|D648877A38C788E257C4F16AF62029CD|/ 来源:msdn.hk 第一步 运行安装文件向导,点击第一个选项进行安装sql服务器引擎,与其他版本安装步骤差不多. 安装前需要java jdk 1.7环境 第二步 安装ssms(Microsoft SQL Server Ma

【转】Microsoft® SQL Server® 2012 Performance Dashboard Reports

http://www.cnblogs.com/shanyou/archive/2013/02/12/2910232.html SQL Server Performance Dashboard Reports是一组Reporting Services的报表,和SQL Server Management Studio中所介绍的报表一起使用.这些报表允许数据库管理员快速地确定他们的系统中是否存在瓶颈,瓶颈是否正在发生,捕获这些附加的诊断数据可能会对解决问题更有帮助.例如,系统正在等待disk IO,这