您的位置:首页 > 博客中心 > 数据库 >

Attempt to fetch logical page (...) in database 2 failed. It belongs to allocation unit xxxx not to xxx

时间:2022-03-10 18:16

今天一个同事说在一个生产库执行某个存储过程,遇到了错误: Fatal error 605 occurred at jul 29 2014

我试着执行该存储过程,结果出现下面错误,每次执行该存储过程,得到的错误内容都不一样(page变化,还有就是allocation unit)变化

消息 605,级别 21,状态 3,过程 usp_xxxxxxxxx,第 228 行

Attempt to fetch logical page (7:121808) in database 2 failed. It belongs to allocation unit 8358680970783621120 not to 5332262008984567808.

 

消息 605,级别 21,状态 3,过程 usp_xxxxxxxxx,第 228 行

Attempt to fetch logical page (3:122376) in database 2 failed. It belongs to allocation unit 8574853753020284928 not to 5332262008984567808.

 

消息 605,级别 21,状态 3,过程 usp_xxxxxxxxx,第 228 行

Attempt to fetch logical page (7:394) in database 2 failed. It belongs to allocation unit 7782220197180997632 not to 1297036693380923392.

第一次遇到这个问题,首先我想到的是是否数据库tempdb是否有一致性错误问题,因为tempdb的database_id为2.于是我对tempdb数据库做了dbcc checkb 完整一致性检查,结果如下所示,没有发现任何问题。

于是搜索一些外文资料,结果在下面两篇文章了解了一下这个错误的原因 :

 

Attempt to fetch logical page (...) in database 2 failed. It belongs to allocation unit xxxx not to xxx是一个bug来的。虽然声称已经fix了,但是实际在SQL SERVER 2008 R2  SP1 、SP2都存在。而我这边的版本恰好是SQL SERVER 2008 R2 SP2

 

下面摘取文章里面讨论的内容。看来不少人在不同版本中遇到过这类错误

解决方法: 

    解决这个问题,只需要对临时表创建聚集索引。即可解决问题。我验证过了,对这个存储过程的临时表创建聚集索引后,上面错误就不见了。

 

参考资料:

Attempt to fetch logical page (...) in database 2 failed. It belongs to allocation unit xxxx not to xxx,布布扣,bubuko.com

热门排行

今日推荐

热门手游