Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: how to get serial# of current session or OS user_name

Re: how to get serial# of current session or OS user_name

From: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: Sun, 21 Apr 2002 22:04:34 +0200
Message-ID: <uc90sn6fi7c442@corp.supernews.com>

"Blaze" <b_kwiatkowski_at_poczta.onet.pl> wrote in message news:a9v4m4$jj0$1_at_news.tpi.pl...
> Hi!
> I'm trying to get a serial# or OS user name of current session.
> Thanks in advance for help
> Blaze
>
>

And no version of course, and this answer like many others is version-dependent.
For 8i and upwards, check the sys_context function in your SQL language reference manual
For all versions (with the restriction that users with SYSDBA privilege all have audsid 0)
select sid, serial#, osuser
from v$session
where audsid = userenv('sessionid')

Hth

--
Sybrand Bakker
Senior Oracle DBA

to reply remove '-verwijderdit' from my e-mail address
Received on Sun Apr 21 2002 - 15:04:34 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US