Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Determining your own session ID
MarkP28665 wrote:
>
> Tim Witort wrote:
> >
> > Is there a way to determine your own session ID in
> > a SQL*Plus session?
>
> From: Chrysalis <cellis_at_iol.ie>
> If you simply want the sessionid as a unique number (for example to
> identify your own rows in a shared work table, the inbuilt function
> userenv('sessionid') will return it for you in any SQL (or PL/SQL)
> statement.
Actually, userenv('sessionid') returns 0 if the PL/SQL is being run via the SNP processes controlling jobs submitted with dbms_job. Is there any way around this?
> I would like to add the the sid returned by userenv is the audsid column
> in v$session and as such can be used by the active session to obtain
> current session information from v$process, v$session_io, v$transaction
> etc....
>
> Mark Powell -- The only advise that counts is the advise that you follow
> so follow your own advise
Cheers,
Finn
-- -------------------------------------------------------------------------------- Finn Ellebaek Nielsen Oracle Associated Senior Consultant Ellebaek Consulting E-mail: ellebuk_at_post3.tele.dk Niels Ebbesens Vej 9, 3. th. Mobile Phone: +45 20 32 49 25 DK-1911 Frederiksberg C Mobile Phone SMS: 20324925_at_sms.tdm.dk (Subject) Denmark Private Phone: +45 33 25 34 50 -------------------------------------------------------------------------------- "Life is a beach and then you dive" "Divers do it deeper"Received on Tue Apr 29 1997 - 00:00:00 CDT