How to derive the process ID of its own session?

From: Peter Teoh <>
Date: Fri, 22 Feb 2008 13:40:00 +0800
Message-ID: <>


How to derive the OS process ID of its OWN Oracle session? Assumption is that we have access to V$PROCESS.

In 10g, I solved it this way:

From userenv('PID') this get mapped to the PID field of V$PROCESS. So I just derived the OS process ID (which is in the V$PROCESS.SPID field) by searching through V$Process for the corresponding USERENV('PID'). But in 9iR2, userenv('PID') is not a valid parameter. So what is the equivalent parameter to be passed to userenv()?

Thank you very much.

Received on Thu Feb 21 2008 - 23:40:00 CST

Original text of this message