欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Oracle锁表 解锁sql

程序员文章站 2022-06-11 19:26:58
...

今天又遇到了Oracle数据库的表被误操作锁住了,在此记录下使用的锁表语句

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;

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;
 
alter system kill session '31,71';