Oracle查詢被鎖的表及被鎖的儲存過程
阿新 • • 發佈:2019-01-27
查詢鎖表的Session
select sess.sid,
sess.serial#,
lo.oracle_username,
lo.os_user_name,
ao.object_name,
lo.locked_mode
from v$locked_object lo,
dba_objects ao,
v$session sess
where ao.object_id = lo.object_id and lo.session_id = sess.sid;
--殺死程序 'sid,serial#'
alter system kill session '470,12791';
查詢DDL 操作被鎖
select b.SID,b.SERIAL#,a.name
From dba_ddl_locks a,v$session b Where a.session_id = b.SID
and a.name = 'PKG_EQU_MARGIN_VALUE';
--殺死程序 'sid,serial#'
alter system kill session '632,53';