From: mh on
How can I programmatically get the SID and SERIAL# for my connection
from a client side program?

Many tia!
Mark

--
Mark Harrison
Pixar Animation Studios
From: Michel Cadot on

<mh(a)pixar.com> a �crit dans le message de news: U914l.8677$W06.8173(a)flpi148.ffdc.sbc.com...
| How can I programmatically get the SID and SERIAL# for my connection
| from a client side program?
|
| Many tia!
| Mark
|
| --
| Mark Harrison
| Pixar Animation Studios

SID can be gotten with SYS_CONTEXT('USERENV','SID')
As far as I know there is no way to get SERIAL# unless you have priviledge on V$SESSION.

Regards
Michel


From: Laurenz Albe on
mh(a)pixar.com wrote:
> How can I programmatically get the SID and SERIAL# for my connection
> from a client side program?

With the following SQL query:

SELECT dbms_debug_jdwp.current_session_id sid,
dbms_debug_jdwp.current_session_serial serial#
FROM dual;

Yours,
Laurenz Albe
From: Mark D Powell on
On Dec 23, 3:35 am, "Michel Cadot" <micadot{at}altern{dot}org> wrote:
> <m...(a)pixar.com> a écrit dans le message de news: U914l.8677$W06.8...(a)flpi148.ffdc.sbc.com...
> | How can I programmatically get the SID and SERIAL# for my connection
> | from a client side program?
> |
> | Many tia!
> | Mark
> |
> | --
> | Mark Harrison
> | Pixar Animation Studios
>
> SID can be gotten with SYS_CONTEXT('USERENV','SID')
> As far as I know there is no way to get SERIAL# unless you have priviledge on V$SESSION.
>
> Regards
> Michel

I would just use:
UT1 > l
1 select username, sid, serial#
2 from v$session
3* where sid = (select sid from v$mystat where rownum = 1)
UT1 > /

USERNAME SID SERIAL#
------------------------------ ---------- ----------
MPOWEL01 57 32395

This should work back down to at least version 8.1.7.

HTH -- Mark D Powell --
From: Mark D Powell on
On Dec 23, 3:43 am, Laurenz Albe <inv...(a)spam.to.invalid> wrote:
> m...(a)pixar.com wrote:
> > How can I programmatically get the SID and SERIAL# for my connection
> > from a client side program?
>
> With the following SQL query:
>
> SELECT dbms_debug_jdwp.current_session_id sid,
>        dbms_debug_jdwp.current_session_serial serial#
> FROM dual;
>
> Yours,
> Laurenz Albe

Hey, I learned something new. thanks Laurenz.

-- Mark D Powell --