查找ORA-04021等待超时

第一步知道sid

select session_id sid, owner, name, type,
mode_held held, mode_requested request
from dba_ddl_locks
where name = '&存储过程名称'  ;

第二步:通过sid查找
select b.sid,b.serial#,b.machine,b.terminal,b.program,b.process,b.status from v$lock a , v$session b
where a.SID = b.SID and b.sid in (178,152);

select b.serial#,a.* from v$session_wait a,v$session b where a.sid = b.sid and b.sid in (178,152);

通过电脑名称查找
select V$SESSION.*
  from v$lock,
       V$SESSION
 where v$lock.sid = v$session.sid
   and V$SESSION.MACHINE = '电脑名称';

原文地址:https://www.cnblogs.com/ZJ199012/p/13607214.html