ITPub博客

首页 > 数据库 > Oracle > 分区表索引失效导致业务异常

分区表索引失效导致业务异常

原创 Oracle 作者:lmxx2020 时间:2024-03-22 15:41:46 0 删除 编辑

业务无法正常进行,查看数据库后台进程,发现有大量阻塞

QL_ID        WAIT_CLASS      EVENT                    

 ------------- --------------- -------------------------

 1cpk7srb6cr0r User I/O        db file scattered read   

 279knu21n06x6 Cluster         gc cr request            

 299g1dh65yqju User I/O        db file scattered read   

 3atq0m749xxpa User I/O        db file scattered read   

 4x1pcvd0uhntu User I/O        db file sequential read  

 5pt83gw45jkb6 User I/O        db file scattered read   

 6cx5uwt35qp2j User I/O        db file scattered read   

 71anz6u0540a6 User I/O        db file scattered read   

 88jwdgh03ddjp User I/O        db file parallel read    

 948rgusp8c1fn User I/O        read by other session    

 988qxv7ufqgqh User I/O        db file scattered read   

 9vdwzq1gucrfk User I/O        db file parallel read    

 a6jw0kdm1aucb User I/O        read by other session    

 a6jw0kdm1aucb User I/O        read by other session    

 a6jw0kdm1aucb User I/O        db file sequential read  

 a6jw0kdm1aucb User I/O        read by other session    

 a6jw0kdm1aucb User I/O        db file sequential read  

 a6jw0kdm1aucb User I/O        read by other session    

 a6jw0kdm1aucb User I/O        db file sequential read  

 a6jw0kdm1aucb User I/O        db file sequential read  

 a6jw0kdm1aucb User I/O        read by other session    

 a6jw0kdm1aucb User I/O        db file sequential read  

 a6jw0kdm1aucb User I/O        db file sequential read  

 a6jw0kdm1aucb User I/O        db file sequential read  

 a6jw0kdm1aucb User I/O        db file sequential read  

 a6jw0kdm1aucb User I/O        read by other session    

 a6jw0kdm1aucb User I/O        db file sequential read  

 a6jw0kdm1aucb User I/O        db file sequential read  

 a6jw0kdm1aucb User I/O        read by other session    

 a6jw0kdm1aucb User I/O        db file sequential read  

 a6jw0kdm1aucb User I/O        db file sequential read  

 csukjwu2761t3 User I/O        db file scattered read   

 d6cd1gh6xft0b User I/O        db file sequential read  

排查出造成阻塞的源头sql,该条sql语句与分区表相关
核查该sql语句执行慢的原因,分析其执行计划发生了变动,出现了全表扫描。频繁对400G的大表进行一个全表扫描,导致数据库卡死。


为了确保业务快速恢复,最快的解决方式就是先通过手动绑定对的执行计划,恢复sql的执行效率
找出历史的awrsqrpt报告中的正确执行计划如下:


绑定执行计划后发现,并没有执行正确的索引扫描。排查数据库索引状态
可以看到新分区表部分索引状态出现了异常
TERM_TRAN_LOG_TBL_IND7_ONLTM      INVALID

开始修复状态异常的索引
alter index BUSBIKE.TERM_TRAN_LOG_TBL_IND7_ONLTM rebuild online parallel 8;
alter index BUSBIKE.TERM_TRAN_LOG_TBL_IND7_ONLTM noparallel;
修复索引完毕后,业务sql恢复效率

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/22967847/viewspace-3009857/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2024-01-09

  • 博文量
    106
  • 访问量
    90386