当前位置:Gxlcms > mysql > oracle中查找锁住的表并解锁

oracle中查找锁住的表并解锁

时间:2021-07-01 10:21:17 帮助过:46人阅读

--查出所有被锁住的表 select b.owner TABLEOWNER, b.object_name TABLENAME, c.OSUSER LOCKBY, c.USERNAME LOGINID, c.sid SID, c.SERIAL# SERIAL from v$locked_object a,dba_objects b, v$session c where b.object_id = a.object_id AND a.SESSION_ID =c

--查出所有被锁住的表
select b.owner TABLEOWNER, b.object_name TABLENAME, c.OSUSER LOCKBY, c.USERNAME LOGINID, c.sid SID, c.SERIAL# SERIAL
from v$locked_object a,dba_objects b, v$session c
where b.object_id = a.object_id AND a.SESSION_ID =c.sid;

--通过SID, SERIAL解锁
alter system kill session 'SID, SERIAL'
;

锁表

lock table BSZ1_W_DOT010_PB01T252_wk2 in exclusive mode;


conn sys/orcl AS SYSDBA

Alter user hr identified by hr account unlock;

alter user scott account unlock;

人气教程排行