RE: How to derive the process ID of its own session?

From: Powell, Mark D <>
Date: Sun, 24 Feb 2008 15:05:55 -0500
Message-ID: <>

If you are interested in the OS foreground process then see the following article:

Is there a way to trace a unix process id to a SID and SERIAL# ?

The article is going the other way, from pid to sid, but the information you need is identified in the covered material.

HTH -- Mark D Powell --

-----Original Message-----
From: Peter Teoh [] Sent: Sat 2/23/2008 10:11 AM
To: Powell, Mark D
Subject: Re: How to derive the process ID of its own session?  

On Fri, Feb 22, 2008 at 10:32 PM, Powell, Mark D <> wrote:
> Note if the complete query that errored with ORA-01427 was something
> like
> select paddr from v$session
> where sid = (select sid from v$mystat where rownum = 1)
> It can be fixed by adding
> and rownum =1
> as the third line
> Normally, if dedicated sessions are used, only one session will exist
> for a specific process however Oracle will use a second session to run
> recursive SQL so you can sometimes get two sessions for a background
> process.
> -- Mark D Powell --
> Phone (313) 592-5148

Thank you for the answer, it is more surprising than I thought. But the spid I was looking for was the foreground OS process which I thought should not be shared right? Ie, different foreground process using the same background process in a shared server scenario - correct?

Received on Sun Feb 24 2008 - 14:05:55 CST

Original text of this message