Assuming that the application "knows" the real username, let the first thing that the app does is call dbms_application_info.set_client_info passing the real username as a parameter.  This sets v$session.client_info to the real username. 
 
T10-PARTS> select client_info from v$session
  2  where sid = (select sid from v$mystat where rownum = 1) ;
 
CLIENT_INFO
----------------------------------------------------------------
 

T10-PARTS> execute dbms_application_info.set_client_info('REAL_USER_NAME');
 
PL/SQL procedure successfully completed.
 
T10-PARTS> select client_info from v$session
  2  where sid = (select sid from v$mystat where rownum = 1) ;
 
CLIENT_INFO
----------------------------------------------------------------
REAL_USER_NAME
 
T10-PARTS> select userenv('CLIENT_INFO') from dual;
 
USERENV('CLIENT_INFO')
----------------------------------------------------------------
REAL_USER_NAME
 
T10-PARTS> select sys_context('userenv', 'client_info') from dual;
 
SYS_CONTEXT('USERENV','CLIENT_INFO')
--------------------------------------------------------------------------------
REAL_USER_NAME
 
 
Hope this helps
 
Paul 

 -----Original Message-----
From: Bunyamin K. Karadeniz [mailto:[EMAIL PROTECTED]]
Sent: Friday, April 05, 2002 4:16 PM
To: Multiple recipients of list ORACLE-L
Subject: very interesting problem with V$SESSION and web applications....

Dear Gurus , I have a comic question . ?
We have a db and ias and portal . users log in by using portal login page .
The problem is : because application server connects to db , in v$session the machines are all the application server machine .
Although the users are db users , when you login from portal , the usernames are portal30 and portal30_sso ..
 
So how will I know which user is which session ? V$session gives no help ...
 
May be comic :) But can not find an answer .. Investigating portal for writing into v$session as the real username ..But no other thing comes into my mind ....
 
Any idea please ...
 
 
 
 
 
Bunyamin K. Karadeniz          
Oracle DBA / Developer
Civilian IT Department
Havelsan A.S. Eskisehir yolu
7.km Ankara Turkey
Phone: +90 312 2873565 / 1217
Mobile : +90 535 3357729
 
The degree of normality in a database
is inversely proportional to that of its DBA.

Reply via email to