How To Get the username that is currently Proxy To [message #674664] |
Thu, 07 February 2019 15:04 |
wtolentino
Messages: 421 Registered: March 2005
|
Senior Member |
|
|
how can i get the username of the proxy that is currently connected to the database.
for example DemoTest connects to a database using proxy to DemoProxy.
sqlplus DemoTest[DemoProxy]/TempPwd123@dbDevelopment
i need to see on the query that it is the DemoTest that is proxied as DemoProxy.
i tried using the v$session and v$session_connect_info in the hope of seeing the DemoTest will appear as the one who is using the DemoProxy but it is not.
select *
from v$session join V$SESSION_CONNECT_INFO using (sid, serial#)
where authentication_type = 'PROXY';
example of results/output:
SID SERIAL# USERNAME STATUS SCHEMANAME OSUSER MACHINE TERMINAL
------- ------- --------------- -------------- ---------------- --------------- --------------- -----------
1348 79436 DEMOPROXY INACTIVE DEMOPROXY scott ORAMacIOS ORAMacIOS
1348 79436 DEMOPROXY INACTIVE DEMOPROXY scott ORAMacIOS ORAMacIOS
1348 79436 DEMOPROXY INACTIVE DEMOPROXY scott ORAMacIOS ORAMacIOS
what i see on the result of the query is that the username is DEMOPROXY and schemaname is DEMOPROXY.
our purpose is to see all of the current users who are using a proxy. we would like to see the actual username who is using the proxy or connected to the proxy.
please help.
thank you.
|
|
|
Re: How To Get the username that is currently Proxy To [message #674666 is a reply to message #674664] |
Fri, 08 February 2019 03:49 |
John Watson
Messages: 8960 Registered: January 2010 Location: Global Village
|
Senior Member |
|
|
You can do this,orclx>
orclx> conn scott[system]/tiger
Connected.
orclx> select sys_context('userenv','proxy_user') from dual;
SYS_CONTEXT('USERENV','PROXY_USER')
--------------------------------------------------------------------------------------------------------------
SCOTT
orclx> but I don't think it is possible to extract this from any v$ view vecause is session information, stored in the PGA, not something the SGA would know about.
|
|
|
Re: How To Get the username that is currently Proxy To [message #674671 is a reply to message #674666] |
Fri, 08 February 2019 07:13 |
wtolentino
Messages: 421 Registered: March 2005
|
Senior Member |
|
|
is there any tables or views that i can use to get a list of users who are using proxies?
for example:
SID SERIAL# USERNAME STATUS PROXYTO OSUSER MACHINE TERMINAL
------- ------- --------------- -------------- ---------------- --------------- --------------- -----------
1348 79436 DEMOTEST INACTIVE DEMOPROXY scott ORAMacIOS ORAMacIOS
1349 79438 SCOTT INACTIVE DEMOPROXY scott ORAMacIOS ORAMacIOS
1355 79439 BILL INACTIVE DEMOPROXY bill ORAWinOS ORAWinOS
we would like to see a list of users who are using proxies. thanks.
|
|
|
|
|
|
Re: How To Get the username that is currently Proxy To [message #674721 is a reply to message #674678] |
Tue, 12 February 2019 08:34 |
wtolentino
Messages: 421 Registered: March 2005
|
Senior Member |
|
|
thanks so much saw some that might help. then found the dba_audit_trail might help with the use of column action_name = 'PROXY AUTHENTICATION ONLY'. from that table there is a column sessionid where can I link this column to other tables that might help me get the username, userid, or any user info? I tried to look but not sure.
|
|
|
|