Retrieving OS user ID for the session
518838Jun 25 2009 — edited Jun 25 2009Hi,
We're working on a pl/sql application which will pick the OS user of the person executing the procedure and will log it to a table. The query we're using for it is:
select OSUSER
from V$SESSION
where AUDSID = SYS_CONTEXT('userenv','sessionid')
and rownum=1
If we execute above query inside windows from sqlplus, it will return the correct OS user. But problem comes when we run it on Oracle server using connectivity on UNIX box. In that case, system always return the OS user as "Oracle".
Please suggest any way to retrieve the correct OS user ID even when the query is executed from UNIX Box.
Thanks in advance
Deepak