6

Oracle故障处理-Truncate表方式清库导致查询报ORA-03113和ORA-7445

 2 years ago
source link: https://blog.51cto.com/xiaozc/5327725
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Oracle故障处理-Truncate表方式清库导致查询报ORA-03113和ORA-7445

原创

客户反馈,当使用plsql登录数据库执行一个多表联合查询时直接报错,报错内容:ora-03113 end-of-file on communication。奇怪的是大部分业务语句都可以正常执行,与客户沟通是否做过业务变更,客户告知由于现在处于业务上线前测试阶段,产生了很多测试数据,所以使用truncate表的方式进行了一次清库,其他地方并没有进行过任何改动。目前使用的是database version是oracle 19.11.0.0,os system version是redhat 7.3。

拿到报错语句直接通过操作系统权限登录数据库,执行语句报错依旧复现ora-03113,使用adrci进行报错查看,发现每执行一次触发报错的语句,就会产生一个ora-7445的incident(事件)。

根据事件ID查询事件的详细报错,show incident -mode detail -p "incident_id=xxxxxx";

Oracle故障处理-Truncate表方式清库导致查询报ORA-03113和ORA-7445_truncate table

随后对trace文件进行查询,trace文件也有明显报错提示,提示如下:

ORA-07445: [kkeEqJoinSel()+8324] [SIGSEGV] [ADDR:0x8] [PC:0x128A8FE4] [Address not mapped to object] []

本来想采用set autotrace trace跟踪的方式进行查看,但是只要一执行语句就执行断开,只有tracewe文件生成一个ORA-7445的报错没有其他任何提示信息。

对sql语句分段执行,发现sql语句中关联的任何一个表单独查询都可以被执行成功,只要联合查询就会断开与数据库的连接,现象比较奇怪。在mos上沟通有人提到在低版本中遇见过统计信息被破坏出现类似情况,原文如下:

But at times some of the older bugs could resurface. Are the stats current on the objects involved in the SQL? I have seen such symptoms on lower version when the stats were corrupted. See if you can reproduce the same errors after gathering fresh stats of those objects.

根据描述查询sql语句中关联到的表所属的用户,为收集统计信息做准备,使用sysdba权限查询表属主语句如下:

Oracle故障处理-Truncate表方式清库导致查询报ORA-03113和ORA-7445_数据库统计信息_02

对相关表进行统计信息的收集,使用sysdba权限收集表统计信息语句如下:

Oracle故障处理-Truncate表方式清库导致查询报ORA-03113和ORA-7445_数据库统计信息_03

再次执行报错的sql语句,报错消失,语句可以被正常执行。此次故障根因是truncate表清理数据库导致了表的统计信息被破坏,重新收集统计信息查询报错问题得到解决。

  • 收藏
  • 评论
  • 分享
  • 举报

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK