> 
> Hi,
> Can U tell me how do I find out as which OSUSER(Operating system User)
> an SQL statement is being executed in the oracle database.
> 
> I have tried looking into v$session and v$session_connect_info but both
> return multiple OSUSER.
> 
> The situation is like this  ---
> We have one dbuser which is being used by different persons in the
> organization. I want to know exactly who is making the changes in the
> database. That I can do only when I know the OSUSER.
> 
> Thanks for Your time.
> Mayank ( mayankn@mach-usa.com )
> 
Mayank,

You can issue the following query:

SELECT SQL_TEXT
FROM V$SQLAREA
WHERE (ADDRESS, HASH_VALUE) IN
      (SELECT SQL_ADDRESS, SQL_HASH_VALUE
       FROM V$SESSION
       WHERE SID = &sid_number)
/

You will be prompted for the Oracle SID.
You can get user information from the following SQL:

SELECT USERNAME, OSUSER, TERMINAL, SID, SERIAL#,
       PROCESS, PROGRAM
FROM V$SESSION
ORDER BY OSUSER
/

Best of luck,


-Ari Kaplan
Independent Oracle DBA Consultant

<-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><->
<-> For 160+ Oracle tips, visit my Web Page:                      <->
<->                                                               <->
<->             www.arikaplan.com                                 <->
<->                                                               <->
<->             email: akaplan@interaccess.com                    <->
<-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><->

Back to Ari Kaplan's Home Page ex.htm"> Back to Ari Kaplan's Home Page