Oracle表被锁以及如何解锁的语句
程序员文章站
2022-06-11 19:24:24
...
1.查看表是否被锁定的语句
select a.object_name,b.session_id,c.serial#,c.program,
c.username,c.command,c.machine,c.lockwait
from all_objects a,v$locked_object b,v$session c
where a.object_id=b.object_id and c.sid=b.session_id;
2.查看被锁定的表的信息
select l.session_id sid,
s.serial#,
l.locked_mode,
l.oracle_username,
s.user#,
l.os_user_name,
s.machine,
s.terminal,
a.sql_text,
a.action
from v$sqlarea a, v$session s, v$locked_object l
where l.session_id = s.sid
and s.prev_sql_addr = a.address
order by sid, s.serial#;
3.解锁表
alter system kill session '19';#这里的19是session_id
上一篇: 浅谈:造成SEO不利影响的八大成份
下一篇: 对python 自定义协议的方法详解