Monday 14 November 2016

Database: Query to get current session ID, Process ID & Client Process ID

SELECT b.sid,
b.serial#,
a.spid processid,
b.process clientpid
FROM v$process a, v$session b
WHERE a.addr = b.paddr AND b.audsid = USERENV ('sessionid');

1) V$SESSION.SID AND V$SESSION.SERIAL# is database process id
2) V$PROCESS.SPID is shadow process id on this database server
3) V$SESSION.PROCESS is client PROCESS ID

1 comment:

  1. Great, I wanted to check SID from PID and finally get it.

    ReplyDelete