Tuesday, February 5, 2008

SID's PID's and SPID's

Match a sid to a pid or a spid
The following query will help us match a Oracle session ID to a server process ID. You can either use the Oracle SID to find the server process or visa versa.
select s.sid, s.serial#, p.pid orapid, p.spid srvpid, p.pname, p.username from v$session s, v$process p where p.addr = s.paddr and s.sid = ### -- oracle sid --and p.spid = #### -- server pid
If using Oracle apps, If the session belongs to apps user, we can find out the PID for the SID.
select pid, sid from v$process, v$session where v$process.addr = v$session.paddr and sid = ###;

***************************
keyword sid pid lock spid
***************************

No comments: