得到当前session的ip地址:
select SYS_CONTEXT('USERENV','IP_ADDRESS') from dual;
但是,如果不通过连接字符串登录(在服务器上操作),则无法取出创建系统触发器
create or replace trigger SYS.login_on_info
after logon on database
Begin
insert into sys.login_log(session_id,login_on_time,login_off_time,user_in_db,machine,ip_address,run_program)
select AUDSID,sysdate,null,sys.login_user,machine,SYS_CONTEXT('USERENV','IP_ADDRESS'),program
from v$session where AUDSID = USERENV('SESSIONID'); --当前SESSION
END;通过login_log这个表就可以查用户信息了。
select SYS_CONTEXT('USERENV','IP_ADDRESS') from dual;
但是,如果不通过连接字符串登录(在服务器上操作),则无法取出创建系统触发器
create or replace trigger SYS.login_on_info
after logon on database
Begin
insert into sys.login_log(session_id,login_on_time,login_off_time,user_in_db,machine,ip_address,run_program)
select AUDSID,sysdate,null,sys.login_user,machine,SYS_CONTEXT('USERENV','IP_ADDRESS'),program
from v$session where AUDSID = USERENV('SESSIONID'); --当前SESSION
END;通过login_log这个表就可以查用户信息了。
对象的细粒度的审计使用9i的dbms_fga包来进行
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\ControlClass\4D36E970-E325-11CE-BFC1-08002BE10318 中的0000,0001,0002中的DriverDesc,如果在0000找到,就在0000下面添加字符串变量,命名为“NetworkAddress”,值为要设置的MAC地址,例如:000102030405