oracle查锁及解锁命令

--查询行锁语句

select sql_text from v$sql a,v$session b
where a.sql_id=b.sql_id and b.event='enq: TX - row lock contention';

--找到被锁定的表

SELECT object_name, machine, s.sid, s.serial#
FROM gv$locked_object l, dba_objects o, gv$session s
WHERE l.object_id = o.object_id
AND l.session_id = s.sid;

oracle查锁及解锁命令

--解锁命令

ALTER SYSTEM KILL SESSION '11,48547';
 oracle查锁及解锁命令

或者用以下命令查出来后执行ALTER SYSTEM KILL SESSION '''||s.sid||', '||s.serial#||

select     s.sid,s.machine,o.object_name,l.oracle_username,l.locked_mode,
'ALTER SYSTEM KILL SESSION '''||s.sid||', '||s.serial#||''';' Command
from v$locked_object l,v$session s,all_objects o
where l.session_id=s.sid and l.object_id=o.object_id;

oracle查锁及解锁命令

上一篇:Python发送邮件脚本


下一篇:Spark源码剖析 - SparkContext的初始化(四)_Hadoop相关配置及Executor环境变量