From: "Sybrand Bakker" <postbus@sybrandb.demon.nl>
Subject: Re: PL/SQL and v$session
Date: 2000/07/07
Message-ID: <962978542.10868.1.pluto.d4ee154e@news.demon.nl>#1/1
X-NNTP-Posting-Host: sybrandb.demon.nl:212.238.21.78
References: <yFi95.104$m12.3341@news.get2net.dk> <962969400.6780.1.pluto.d4ee154e@news.demon.nl> <d4k95.138$m12.4146@news.get2net.dk>
X-Trace: news.demon.nl 962978542 pluto:10868 NO-IDENT sybrandb.demon.nl:212.238.21.78
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600
Newsgroups: comp.databases.oracle.misc
X-Complaints-To: abuse@nl.demon.net


V$session as a synonym on a view. You obviously can't select from a synonym.
No, not that I know of. Actually, the sid will be reused frequently, the
audsid won't (increments sequentially). So if you use the SID, you should
make sure your data is deleted as soon as the session completes.

Regards,

Sybrand Bakker, Oracle DBA


"Peter Smed Vestergaard" <Peter_Vestergaard@saxotech.com> wrote in message
news:d4k95.138$m12.4146@news.get2net.dk...
> Thanks... I thought it might have something to do with privileges, but why
> can't I do a select on v$session without having select rights to
 v_$session?
>
> One of my colleagues needs the sessionid to temporarily store somthing in
> tye database which is invalidated when the session finishes.
>
> Any other way to store information in the database, visible for thoer
> sessions but "a gonner" when the session ends?
>
> Peter
>
> EMail: Peter_Vestergaard@saxotech.com
>
> Remove xxx on reply
>
> > Why so complicated?
> > Why don't you use
> >
> > select sid
> > from v$session
> > where audsid = userenv('sessionid')
> >
> > This will work for all users, except for sys.
> > Also, the v$session is a synonym for a view you have privilege on using
 a
> > role. You'll need direct privilege, or the use the invokers right pragma
 in
> > 8i.
> > Grant select on v$_session to <your user>
>
>




