oracle数据库锁表解决方案
程序员文章站
2022-06-02 16:49:02
...
1.获取锁表的session id
SELECT object_name, machine, s.sid, s.serial# ,o.owner
FROM gv$locked_object l, dba_objects o, gv$session s
WHERE l.object_id = o.object_id
AND l.session_id = s.sid;
2.获取系统进程号
select distinct s.sid,s.serial#,p.spid as 系统进程号
from v$locked_object l , dba_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;
3.1 杀掉进程(navicat操作)
alter system kill session '1434, 2425';
放入步骤1里面的 sid,serial 两个值
3.2 杀掉进程(命令行操作)
kill -9 3568 2536 2172 1712