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

From: Powell, Mark D <mark.powell_at_eds.com>
Date: Sun, 24 Feb 2008 15:05:55 -0500
Message-ID: <D1DC33E67722D54A93F05F702C99E2A911DFB8@usahm208.amer.corp.eds.com>


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# ? http://www.jlcomp.demon.co.uk/faq/sid_from_proc.html

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 [mailto:htmldeveloper_at_gmail.com] Sent: Sat 2/23/2008 10:11 AM
To: Powell, Mark D
Cc: oracle-l_at_freelists.org
Subject: Re: How to derive the process ID of its own session?  

On Fri, Feb 22, 2008 at 10:32 PM, Powell, Mark D <mark.powell_at_eds.com> 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?

--
http://www.freelists.org/webpage/oracle-l
Received on Sun Feb 24 2008 - 14:05:55 CST

Original text of this message