Oracle 根据等待事件 enq: TX - index contention 查找对象

当前会话查询

bash 复制代码
with tmp_table_index as (
  select di.owner||'.'||di.index_name as index_name_with_owner,
         di.table_owner||'.'||di.table_name as table_name_with_owner
    from dba_indexes di
)
select sysdate,dh.sql_id,dh.ROW_WAIT_OBJ#,
       (select t0.table_name_with_owner 
         from dba_objects do ,tmp_table_index t0 
         where do.object_id=dh.ROW_WAIT_OBJ# and do.owner||'.'||do.object_name =  t0.index_name_with_owner) as table_name_with_owner,
       (select t0.index_name_with_owner 
         from dba_objects do ,tmp_table_index t0 
         where do.object_id=dh.ROW_WAIT_OBJ# and do.owner||'.'||do.object_name =  t0.index_name_with_owner) as index_name_with_owner,
       dh.event,dh.program,dh.machine
from gv$session dh
where 1=1
and dh.event in ('enq: TX - index contention')
;

历史信息查询

bash 复制代码
with tmp_table_index as (
  select di.owner||'.'||di.index_name as index_name_with_owner,
         di.table_owner||'.'||di.table_name as table_name_with_owner
    from dba_indexes di
)
select dh.sample_time,dh.sql_opname,dh.sql_id,dh.current_obj#,
       (select t0.table_name_with_owner 
         from dba_objects do ,tmp_table_index t0 
         where do.object_id=dh.current_obj# and  do.owner||'.'||do.object_name =  t0.index_name_with_owner) as table_name_with_owner,
       (select t0.index_name_with_owner 
         from dba_objects do ,tmp_table_index t0 
         where do.object_id=dh.current_obj# and  do.owner||'.'||do.object_name =  t0.index_name_with_owner) as index_name_with_owner, 
       dh.event,dh.program,dh.machine
from gv$active_session_history dh
     --dba_hist_active_sess_history dh
where 1=1
and dh.event in ('enq: TX - index contention')
and dh.sample_time between to_date('2026-03-25 00:00:00','yyyy-mm-dd hh24:mi:ss')
                       and to_date('2026-03-25 23:59:59','yyyy-mm-dd hh24:mi:ss')
;
相关推荐
minebmw71 天前
Oracle 19.29 中 ORA-00600 [4193] 错误完全解析与恢复指南
数据库·oracle
风子杨yxf7711 天前
linux下oracle开机自启动以及关机自关闭数据库,并发送邮件通知
linux·运维·数据库·oracle·自启动·发邮件·自关闭
数厘2 天前
2.18 sql排序查询(ORDER BY、ASC、DESC)
数据库·sql·oracle
oradh2 天前
Oracle数据库完整性约束概述
数据库·oracle·数据库基础·数据库入门·oracle数据完整性·oracle数据库约束类型
IT邦德2 天前
Update Advisor:Oracle MAA架构下数据库补丁管理
数据库·oracle·架构
oradh2 天前
Oracle数据库索引簇表和哈希簇表概述
oracle·哈希算法·oracle基础·oracle数据库基础·索引簇表·哈希簇表
minebmw72 天前
Oracle 19.29 中 ORA-00600 [4000] 错误完全解析
数据库·oracle
战族狼魂2 天前
40x40 矩阵控制系统
jvm·oracle·矩阵
fly spider2 天前
MySQL之优化
数据库·mysql·oracle
老苏畅谈运维2 天前
服务器重启后数据库无法打开,记一次ORA-00600 [2252]故障修复记
数据库·oracle