SELECT USER,SID,SERIAL#,UTL_INADDR.GET_HOST_ADDRESS AS HOST,SYS_CONTEXT('USERENV','IP_ADDRESS') AS LOCAL,SYSDATE FROM V$SESSION WHERE AUDSID=SYS_CONTEXT('USERENV','SESSIONID');
查看所有链接Oracle的客户端的IP等信息:
step1: 查看每个oracle帐户的连接总数:
select username,count(username) from v$session where username is not null group by username;
create or replace trigger on_logon_trigger after logon on database
begin
dbms_application_info.set_client_info(sys_context('userenv', 'ip_address'));
end;
/