oracle lock相关的v$视图

–查询目前被阻塞的session

select sid, blocking_session_status, blocking_session, sql_text
from v$session inner join v$sql on v$session.sql_id = v$sql.SQL_ID
where blocking_session is not null
order by blocking_session;

–阻塞进程的相关信息

select *
from v$session_wait;
where wait_class <> 'Idle';

–查询lock及对应数据库对象

select * from v$lock;

select * from v$locked_object;

当前事务,及关联的session

select t1.xidusn, t1.used_urec, t1.used_ublk
from v$transaction t1 inner join v$session
t2 on t1.SES_ADDR = t2.SADDR;

Comments are closed.