Oracle数据库锁表排查
--oracle查询哪些表被谁锁住了
select sess.sid,
sess.serial#,
lo.oracle_username,
lo.os_user_name,
ao.object_name,
lo.locked_mode,
sess.LOGON_TIME,
sess.machine
from v$locked_object lo, dba_objects ao, v$session sess
where ao.object_id = lo.object_id
and lo.session_id = sess.sid
order by sess.logon_time desc;
--解除数据库中被锁住的表(SID,SERIAL)
alter system kill session '#SID,#SERIAL';
欢迎关注微信号【Java小灶台】,一起学习
人生有几个十年呢?点点滴滴,用文字记录