Re: How to find OS username for a session??
Date: 1995/12/08
Message-ID: <4a9rcn$shp_at_cardinal.fs.com>#1/1
John Jones (john_at_iluvatar.tip.duke.edu) wrote:
: On 6 Dec 1995, Donna Kray wrote:
: > What view do I need to use to find the OS username for that paricular
: > session? I am using it in a trigger to update an "updated_by" field and I
: > want username *and* the OS username. Is v$session the correct view? And
: > if so, how do I get the data for only that particular session?
: >
: > SELECT USERNAME, OSUSER
: > FROM ????
: > [WHERE ????];
: not sure about the OSUSER, but for the USERNAME just:
: "select user from dual;"
: dual is a dummy table used for this type of select, user will return the
: person logged on at the time this is issued. If like in our case, you
: use OPS$ that will be on there. To get rid of that just use:
: select substr(user,5,10) from dual;
: >
: --------------------------------------------------------------------
: John Jones | my views are my own.........
: Oracle Consultant | no matter what company they are
: john_at_iluvatar.tip.duke.edu | coming from.
: --------------------------------------------------------------------
Try
Select osuser
from v$session
where audsid = userenv('SESSIONID');
to retrieve the os user.
-- --------------------------------------------------------------------------- Kannan Email: skannan_at_fs.com Mastech Systems Corporation The above are my own comments and opinion. They do not purport that of anybody else. ** Different is Not Better. Better is not Different. ** ---------------------------------------------------------------------------Received on Fri Dec 08 1995 - 00:00:00 CET