Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: How to find out who is running the procedure ?
sys_context('userenv','<blah>') returns pretty much of useful information
about the session - just substitute the <blah> with any of the following:
current_user = user who's privileges are in effect session_user = user who initiated the session (logged in)
os_user = client OS user name host = name of client host
-- Vladimir Zakharychev (bob@dpsp-yes.com) http://www.dpsp-yes.com Dynamic PSP(tm) - the first true RAD toolkit for Oracle-based internet applications. All opinions are mine and do not necessarily go in line with those of my employer. "Thomas Kyte" <tkyte_at_oracle.com> wrote in message news:a78pg802maa_at_drn.newsguy.com...Received on Wed Mar 20 2002 - 07:41:20 CST
> In article <a78lkf$cob$1_at_reader2.panix.com>, "R says...
> >
> >My VB app X.exe connects (RDO) and calls a stored procedure Y to run....
> >
> >How can I find out -exclusively- from WITHIN the procedure, W/O having VB
> >pass in any ID-related paramter, the username of the connected user running
> >this app ?
> >
>
> the_user := USER;
>
>
> >So if the session connection info is in v$session, how do I identify the
> >record for a
> >particular session ?
> >
>
>
> select * from v$session where sid = ( select sid from v$mystat where rownum =
> 1);
>
> the owner of the procedure must have direct SELECT granted on
> sys.v_$session
> sys.v_$mystat
>
> for that procedure to compile that query -- not a role, a direct grant.
>
>
> >Thanks
> >
> >Robert
> >
> >
>
> --
> Thomas Kyte (tkyte@us.oracle.com) http://asktom.oracle.com/
> Expert one on one Oracle, programming techniques and solutions for Oracle.
> http://www.amazon.com/exec/obidos/ASIN/1861004826/
> Opinions are mine and do not necessarily reflect those of Oracle Corp
>
![]() |
![]() |