How to derive the process ID of its own session?

  • From: "Peter Teoh" <htmldeveloper@xxxxxxxxx>
  • To: "oracle-l@xxxxxxxxxxxxx" <oracle-l@xxxxxxxxxxxxx>
  • Date: Fri, 22 Feb 2008 13:40:00 +0800

Requirements:

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.
--
//www.freelists.org/webpage/oracle-l


Other related posts: