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

业务无法正常进行,查看数据库后台进程,发现有大量阻塞
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恢复效率

  • 7
    点赞
  • 20
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值