手动修改某表的记录,弹出以下错误:
然后尝试用PL/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 登录数据库时间
FROM v$locked_object l, all_objects o, v$session s
WHERE l.object_id = o.object_id
AND l.session_id = s.sid
ORDER BY sid, s.serial#;
杀掉该锁对象:
模板:
alter system kill session 'sid,serial#' immediate;
实例:alter system kill session '7,223' immediate;