SQL server数据库MSG 8646错误

如果自己搞不定可以找诗檀软件专业SQL SERVER数据库修复团队成员帮您恢复!

诗檀软件专业数据库修复团队

服务热线 : 13764045638   QQ号:47079569    邮箱:[email protected]

 

8646
Unable to find index entry in index ID %d, of table %d, in database '%.*ls'. 
The indicated index is corrupt or there is a problem with the current update plan. 
Run DBCC CHECKDB or DBCC CHECKTABLE. If the problem persists, contact product support.

 

从SQL SERVER 2008开始当使用NOLOCK选项运行复杂的update语句时,可能导致非簇索引的损坏。如下面的错误日志:

 

Error: 8646, Severity: 21, State: 1.
Unable to find index entry in index ID XX, of table XX, in database ‘<DatabaseName>’. 
The indicated index is corrupt or there is a problem with the current update plan. 
Run DBCC CHECKDB or DBCC CHECKTABLE. If the problem persists, contact product support.
Using ‘dbghelp.dll’ version ‘4.0.5’
**Dump thread – spid = 0, EC = 0x0000000XX000000
***Stack Dump being sent to 
CPerIndexMetaQS::ErrorAbort – Index corruption

原因

其原因可能时因为使用了NOLOCK HINT导致查询读取表数据时读到的数据不正确从而导致索引损坏。

 

解决方案

可以通过打SQL SERVER补丁来避免再次发生此类问题。但是无法修复已经发生的问题。一般来说该类问题可以通过重建索引来解决:

 

直接重建rebuild index:

 

ALTER INDEX  [INDEX_NAME] ON [TABLE_NAME]  rebuild

go

 

或者先把索引drop掉,然后再运行create index也是一种解决方案。

运行以上解决方案后建议 再次运行dbcc checkdb操作来检测全库。

 


Posted

in

by

Tags:

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *