ORACLE 数据库 查询是否锁表 及解锁方法

--查询是否有锁表
select count(*) from v\(locked_object; select * from v\)locked_object;

--查询锁的对应表以及其他操作
select b.owner,b.object_name,a.session_id,a.locked_mode from v$locked_object a,dba_objects b where b.object_id = a.object_id;

--查询sid serial#
select b.username,b.sid,b.serial#,logon_time from v\(locked_object a,v\)session b where a.session_id = b.sid order by b.logon_time;

--杀掉进程 152为sid 21497为serial#
alter system kill session'152,21497' immediate;

posted @ 2021-03-19 15:43  R_Oasis  阅读(438)  评论(0编辑  收藏  举报