问题描述;
SQL 错误 [54] [61000]: ORA-00054: 资源正忙, 但指定以 NOWAIT 方式获取资源, 或者超时失效
sql
select session_id from v$locked_object;
查看这些 session_id 对应的会话的详细信息,包括用户名、机器名、程序等,9596等是select session_id from v$locked_object获取到的 session_id 9596、11086、14798 代表了当前锁定数据库对象的会话
sql
SELECT
s.sid,
s.serial#,
s.username,
s.osuser,
s.machine,
s.program,
s.status,
s.event,
l.object_id,
o.object_name,
o.owner
FROM
v$session s
JOIN
v$locked_object l ON s.sid = l.session_id
JOIN
dba_objects o ON l.object_id = o.object_id
WHERE
s.sid IN (9596, 11086, 14798);
杀掉锁定会话
sql
ALTER SYSTEM KILL SESSION 'sid,serial#';
有多少id就杀几次
sql
ALTER SYSTEM KILL SESSION '9596,8520';