关于kill数据库进程的问题
我在session里可以查到运行的sid和serial,但是要查哪个表的哪个字段才能知道sql在linux数据库中运行的id呢,因为有的时候kill锁表搞不定,想把数据库代表那进程的id给kill掉,高手指导下
------解决方案--------------------select s.audsid AUDSID,
s.SID,
s.SERIAL#,
l.os_user_name "OS Username",
l.oracle_username "Username",
l.process "Process",
p.spid "SPID",--进程ID
o.owner "Owner",
o.object_name "Object",
decode(l.locked_mode, 1,'No Lock', 2,'Row Share', 3,'Row Exclusive',
4,'Share', 5,'Share Row Excl', 6,'Exclusive',null) "Lock Mode",
substr(s.status,1,8) "Status"
from v$locked_object l, all_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
and s.status <> 'KILLED';
kill session:
alter system kill session 'sid,serial#';
kill process:
KILL -9 'SPID'
------解决方案--------------------查询v$process