select s.username,s.sid,s.serial#,p.spid,s.status,s.program,s.terminal,
'alter system kill session '||''''||s.sid||','||s.serial#||''';' oracle_kill,
'kill -9 '||p.spid unix_kill,
'orakill '||i.instance_name||' '||p.spid windows_kill
from v$session s,v$process p,v$instance i
where s.paddr=p.addr
and s.type='USER'
and s.sid='298'
and s.username is not null
转载于:https://www.cnblogs.com/hanyun/archive/2012/08/13/2636838.html