Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: Accessing Unique Session ID
Sybrand Bakker wrote:
>
> Use
> userenv('sessionid')
>
> This will return the auditing sessionid (audsid).
> This is not the same number as the unique session id, but it is unique and
> does increase monotously.
>
> Hth,
>
> Sybrand Bakker, Oracle DBA
>
> "Mary" <mdellamalva_at_cetec.com> wrote in message
> news:8i3r6c$ejg_at_journal.concentric.net...
> > Hello Everyone,
> >
> > I need to access the unique session id for each and every session that
> > connects to my Oracle (7.3.4) Database at the time of connection. I have
> > been trying to tap into the DBMS_Session function: unique_session_id,
> > however it does not appear to have the pragma restrict_references set. I
> > keep getting the following ORA Error: ORA-06571: Function
UNIQUE_SESSION_ID
> > does not guarantee not to update database.
> >
> > Does anyone know how to set the pragma restrict_references for this built
in
> > function external to the function itself? Or, is there another way of
> > accessing the unique sessionid for a specific connection without
referencing
> > the userid which will remain the same for multiple connections?
> >
> > Any help would be appreciated
> >
> > Mary
> > mdellamalva_at_cetec.com
> >
> >
> >
> >
> >
Interesting one - I tried to access userenv('sessionid') within an database logon trigger and got '0' all the time...
Can anyone else reproduce ?
Cheers
-- =========================================== Connor McDonald http://www.oracledba.co.uk We are born naked, wet and hungry...then things get worseReceived on Tue Jun 13 2000 - 00:00:00 CDT
![]() |
![]() |