how to get client machine name and client osuser name
hello everybody,
the trigger shown below is working fine.But i want to get client machine name and client osuser name in the output of the same trigger shown below,how can i achieve this in the same trigger?any help higly appreciated .
thanks and regards.
trigger :
------------
CREATE TABLE logonaudit
(
user_id VARCHAR2(30),
sess_id NUMBER(10),
logon_time DATE,
host VARCHAR2(20));
Table created.
CREATE OR REPLACE
TRIGGER logon_audit
AFTER LOGON
ON DATABASE
DECLARE
V_program varchar2(120);
BEGIN
SELECT UPPER(program)
INTO v_program
FROM v$session
WHERE audsid = sys_context('USERENV','SESSIONID');
if (upper(v_program) like '%TOAD%' or upper(v_program) like '%SQLPLUS%')
then
INSERT
INTO logonaudit
VALUES(
user,
sys_context('userenv','sessionid'),
sysdate,
sys_context('userenv','host')
);
end if;
END;
the output showing sessionid,date,db user name,host as local server machine name.but i want client machine name and client osuser names as u all know clients login to database from their machines.how can i achieve this? any help highly appreciated.
Edited by: 938946 on Dec 25, 2012 12:15 AM