oracle 查看锁表进程和解锁

查看锁表进程和解锁
(1)方式一:


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;

(2)方式二:
select * from v$session t1, v$locked_object t2 where t1.sid = t2.SESSION_ID;


(3)进程解锁
如有记录则表示有锁,记录下SID和serial# ,将记录的ID替换下面的SID, serial,即可解除LOCK
alter system kill session ‘SID,serial‘;

oracle 查看锁表进程和解锁,布布扣,bubuko.com

oracle 查看锁表进程和解锁

上一篇:JDBC批量删除某一用户下的触发器


下一篇:H5基础标签