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小灶台】,一起学习

posted @ 2022-04-01 18:08  鸟不拉诗  阅读(144)  评论(0编辑  收藏  举报