11g之前:
1 2 3 4 5 |
select spid, program from v$process where program!= 'PSEUDO' and addr not in (select paddr from v$session) and addr not in (select paddr from v$bgprocess ) and addr not in (select paddr from v$shared_server); |
11g之后:
1 |
select * from v$process where addr=(select creator_addr from v$session where sid=140); |
参考:
How To Find The Process Identifier (pid, spid) After The Corresponding Session Is Killed? (Doc ID 387077.1)
一条评论
–11G下我使用的脚本:
SELECT ‘kill -9 ‘ || spid kill_spid, program
FROM v$process
WHERE addr = (SELECT creator_addr
FROM v$session
WHERE status = ‘KILLED’);