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 find out who is running the procedure ?

Re: How to find out who is running the procedure ?

From: Thomas Kyte <tkyte_at_oracle.com>
Date: 19 Mar 2002 17:43:36 -0800
Message-ID: <a78pg802maa@drn.newsguy.com>


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 
Received on Tue Mar 19 2002 - 19:43:36 CST

Original text of this message

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