\\ 查询被锁的对象、来源、sid和serial
select object_name, machine, s.sid, s.serial#
from v$locked_object l, dba_objects o, v$session s
where l.object_id = o.object_id
and l.session_id = s.sid
\\ 杀死会话链接,SID和SERIAL 要对应上
alter system kill session ‘203,25461‘;
\\ 如果报错,则执行以下操作:
尽管报错了,但状态肯定已经变成了KILLED状态
select a.spid,b.sid,b.serial#,b.username
from v$process a,v$session b
where a.addr=b.paddr
and b.status=‘KILLED‘;
\\ 查询系统中的线程ID,即spid,查询到的spid
select b.spid,a.osuser,b.program
from v$session a,v$process b
where a.paddr=b.addr
and a.sid=SID
\\ 登录数据库系统OS,执行以下命令
kill -9 SPID
参考网址:
原文:https://www.cnblogs.com/eos666/p/11459407.html