nop*_*pol 7 sql-server-2008 sql-server sql-server-2008-r2 corruption
我们最近将我们的 Intranet 生产数据库从 SQL Server 2008 迁移到了全新的 SQL Server 2008 R2 服务器。
由于 DBCC 错误(检查数据库完整性任务),备份作业自迁移以来一直失败。
昨天我尝试在生产数据库上使用 repair_rebuild 选项运行 DBCC CHECKDB,随后的 DBCC CHECKDB 没有显示任何错误。针对生产数据库的 DBCC CHECKDB 再次显示错误消息,备份已完成,但维护计划当然失败了:我有(一长串)以下错误消息:
Table error: page (1:1100029), whose header indicates that it is allocated to object ID 373210913, index ID 1, partition ID 72057701886525440, alloc unit ID 72057702118457344 (type In-row data), is allocated by another object.
Msg 2534, Level 16, State 2, Line 1
Table error: page (1:1100030), whose header indicates that it is allocated to object ID 373210913, index ID 1, partition ID 72057701886525440, alloc unit ID 72057702118457344 (type In-row data), is allocated by another object.
Msg 7965, Level 16, State 1, Line 1
Table error: Could not check object ID 373210913, index ID 1, partition ID 72057701886525440, alloc unit ID 72057702118457344 (type In-row data) due to invalid allocation (IAM) page(s).
Msg 2534, Level 16, State 2, Line 1
Table error: page (1:1100031), whose header indicates that it is allocated to object ID 373210913, index ID 1, partition ID 72057701886525440, alloc unit ID 72057702118457344 (type In-row data), is allocated by another object.
Msg 2534, Level 16, State 2, Line 1
Table error: page (1:1100200), whose header indicates that it is allocated to object ID 373210913, index ID 1, partition ID 72057701886525440, alloc unit ID 72057702118457344 (type In-row data), is allocated by another object.
Msg 2534, Level 16, State 2, Line 1
Table error: page (1:1100201), whose header indicates that it is allocated to object ID 373210913, index ID 1, partition ID 72057701886525440, alloc unit ID 72057702118457344 (type In-row data), is allocated by another object.
There are 14 rows in 3 pages for object "searchfull_dummy_1049".
CHECKDB found 0 allocation errors and 6 consistency errors in table 'searchfull_dummy_1049' (object ID 373210913).
DBCC results for 'foldersRecherche'.
There are 0 rows in 0 pages for object "foldersRecherche".
DBCC results for 'wf'.
There are 0 rows in 0 pages for object "wf".
DBCC results for 'searchfull_dummy_1663'.
Run Code Online (Sandbox Code Playgroud)
我尝试使用昨天的备份,使用新的数据库名称在同一台服务器上恢复数据库,并在数据库上运行 DBCC Update usage(0),然后 DBCC CHECKDB 在新恢复的数据库上不再显示错误。
我对生产数据库应用了相同的过程,但这并没有解决生产数据库上的问题。我收到与上述相同的错误。
如果顺序是:
您可能已经发生故障或阵列中的磁盘发生故障,或者 IO 子系统的某些其他组件损坏或损坏。就个人而言,我希望尽快关闭问题服务器!
附录:问题的根本原因:
事实证明,我发现当我们使用 Diskeeper 时,我们(出于公司原因)仍在使用旧版本:14.0.896。在这个版本中,我们会遇到如下消息:
The operating system returned error 1784(failed to retrieve text for this error. Reason: 15100) to SQL Server during a write at offset 0x000000010a4000 in file 'D:\Application-Data\MSSQL\Data\<Database>.mdf:MSSQL_DBCC17'. 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.
Msg 3313, Level 21, State 2, Server <Server>, Line 1
During redoing of a logged operation in database '<Database>', an error occurred at log record ID (2349664:1503:4). Typically, the specific failure is previously logged as an error in the Windows Event Log service. Restore the database from a full backup, or repair the database.
Msg 1823, Level 16, State 1, Server <Server>, Line 1
A database snapshot cannot be created because it failed to start.
Msg 1823, Level 16, State 2, Server <Server>, Line 1
A database snapshot cannot be created because it failed to start.
Msg 7928, Level 16, State 1, Server <Server>, Line 1
The database snapshot for online checks could not be created. Either the reason is given in a previous error or one of the underlying volumes does not support sparse files or alternate streams. Attempting to get exclusive access to run checks offline.
Msg 5030, Level 16, State 12, Server <Server>, Line 1
The database could not be exclusively locked to perform the operation.
Msg 7926, Level 16, State 1, Server <Server>, Line 1
Check statement aborted. The database could not be checked as a database snapshot could not be created and the database or table could not be locked. See Books Online for details of when this behavior is expected and what workarounds exist. Also see previous errors for more details
Run Code Online (Sandbox Code Playgroud)
在这里找到了 Paul Randal 博客上的解释
此处找到 DiskKeeper Fix 的链接
关于数据库碎片整理的有趣 Diskeeper 白皮书在这里