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')
;
相关推荐
van久3 小时前
Day32:项目性能优化(EF Core + 分页 + 全异步)
数据库·oracle·性能优化
六月雨滴6 小时前
块(Block)管理
数据库·oracle·dba
许彰午7 小时前
# Oracle数据库无备份强制恢复:SCN不一致、oradebug与ORA-600[2662]
数据库·oracle
六月雨滴7 小时前
Oracle 数据库 ASM 自动存储管理
数据库·oracle·dba
jimy18 小时前
Oracle云e2.1.micro优化tailscale的exit模式网速
linux·服务器·oracle
wen_zhufeng8 小时前
python-dotenv 使用文档
数据库·python·oracle
阿坤带你走近大数据9 小时前
什么是 REDO LOG,它在 Oracle 数据库中的作用是什么?
数据库·oracle
东风破1379 小时前
DM8搭建同构(dm-dm)及异构数据库(dm-oracle,dm-mysql)的dblink
数据库·mysql·oracle
六月雨滴12 小时前
CDB/PDB 多租户存储架构(12c+)
数据库·oracle·dba
六月雨滴12 小时前
Oracle 存储体系架构概述
数据库·oracle