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

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

相关推荐

  1. 什么情况下导致索引失效

    2024-03-26 08:48:15       21 阅读
  2. 循环业务异常外部处理导致的问题

    2024-03-26 08:48:15       33 阅读
  3. 为什么数据库字符编码不一致会导致索引失效

    2024-03-26 08:48:15       12 阅读
  4. Git分支合并导致文件异常

    2024-03-26 08:48:15       31 阅读
  5. v-if 导致 elementui 单校验失效问题解决

    2024-03-26 08:48:15       31 阅读
  6. 索引失效的情况

    2024-03-26 08:48:15       35 阅读

最近更新

  1. TCP协议是安全的吗?

    2024-03-26 08:48:15       19 阅读
  2. 阿里云服务器执行yum,一直下载docker-ce-stable失败

    2024-03-26 08:48:15       20 阅读
  3. 【Python教程】压缩PDF文件大小

    2024-03-26 08:48:15       20 阅读
  4. 通过文章id递归查询所有评论(xml)

    2024-03-26 08:48:15       20 阅读

热门阅读

  1. MD5加密

    MD5加密

    2024-03-26 08:48:15      19 阅读
  2. 【ES6】Set和Map数据结构

    2024-03-26 08:48:15       18 阅读
  3. SQL语言: 内外连接

    2024-03-26 08:48:15       16 阅读
  4. vue json字符串和Hex互转

    2024-03-26 08:48:15       15 阅读
  5. 蓝桥杯 付账问题

    2024-03-26 08:48:15       19 阅读
  6. 制作一个简单的HTML个人网页

    2024-03-26 08:48:15       17 阅读
  7. 贪心算法的习题答案

    2024-03-26 08:48:15       14 阅读
  8. es相关面试题

    2024-03-26 08:48:15       20 阅读