Oracle数据库 - 在操作过程中,表被锁死怎么办?
程序员文章站
2023-02-20 14:47:09
首先,我们执行以下SQL查出锁死的对象SELECT l.session_id sid, s.serial#, l.locked_mode, l.oracle_username, l.os_user_name, s.machine, s.terminal, o.object_name, s.logon_time, p.SPID FROM v$locked_object l...
- 首先,我们执行以下SQL查出锁死的对象
SELECT l.session_id sid,
s.serial#,
l.locked_mode,
l.oracle_username,
l.os_user_name,
s.machine,
s.terminal,
o.object_name,
s.logon_time,
p.SPID FROM v$locked_object l,
all_objects o,
v$session s,
v$process p WHERE l.object_id = o.object_id AND l.session_id = s.sid AND s.paddr = p.addr ORDER BY sid,
s.serial#;
- 然后,使用以下SQL杀除锁死的对象,传入的参数即为查询结果的头2列
alter system kill session 'sid,serial#'
本文地址:https://blog.csdn.net/qq_21440541/article/details/107317096