GET PID for SID

SELECT P.SPID, S.SID, S.SERIAL#
FROM V$PROCESS P, V$SESSION S
WHERE P.ADDR = S.PADDR
AND S.SID = 405;

col "SID/SERIAL" format a10
col username format a15
col osuser format a15
col program format a40
select     s.sid || ',' || s.serial# "SID/SERIAL"
,     s.username
,     s.osuser
,     p.spid "OS PID"
,     s.program
from     v$session s
,     v$process p
Where     s.paddr = p.addr
and s.sid=405
order      by to_number(p.spid)
/

Leave a Reply

%d bloggers like this: