Re: Q: Get OS Userid

From: Petri Pellinen <ppe_at_lk-hp-12.hut.fi>
Date: 20 Jun 94 10:14:17 GMT
Message-ID: <ppe.772107257_at_snakemail.hut.fi>


>In article <1994Jun19.162306.24152_at_ericsson.se>, ebcrbj_at_ebcw150.ericsson.se
>(BO/EBC/KX/RGFC Roger Bjaerevall 08-682 4851) writes:
>> Is it possible to get the OS userid of the current user (SUN OS)?

I use the following method obtained from Technical tips which Oracle mails from time to time:

  1. As SYS create a view create view OSUSER as select a.username,a.spid from v$process a,v$session b where userenv('SESSIONID')=b.audsid and b.paddr=a.addr;
  2. grant select on OSUSER to public;
  3. create public synonym OS_USER for SYS.OSUSER;
  4. Enjoy! (select * from OS_USER;)

This view gives the username and process # of current user process.

Hope this helps.

Petri Pellinen Petri.Pellinen_at_rvle.rvl.mailnet.fi DBA Administrator
Finnish Frontier Guard HQ
Part time student of Helsinki U of Tech: ppe_at_niksula.hut.fi Received on Mon Jun 20 1994 - 12:14:17 CEST

Original text of this message