根据表名查询sid
SELECT object_name, machine, s.sid, s.serial#
FROM gv$locked_object l, dba_objects o, gv$session s
WHERE l.object_id = o.object_id
AND l.session_id = s.sid and object_name='表名';
关闭锁定
ALTER system kill session '1628, 63727';
若是报错 ORA-00030: 用户会话 ID 不存在 查询进程号 关闭进程
根据sid 查询进程号 spid
select * from gv$process
where addr in (
select paddr from gv$session where sid =1628
);
select spid,oSUSEr,s.program from v$session s,v$process p
where s.paddr=p.addr and s.sid=&sid;