如何获取登录Oracle数据库的客户端IP等会话信息

1、获取访问数据库IP的触发器

create or replace trigger on_logon_trigger after logon on database
begin
  dbms_application_info.set_client_info(sys_context('userenv', 'ip_address'));
end;
/
2、查看语句对应的IP:
select sid,serial#,username,sql_id,program,machine,client_info
from v$session
where username is not null
order by username,program,machine;

你可能感兴趣的:(Oracle,Linux)