oracle开启audit(审计)
时间:2023-02-26 来源:
oracle开启audit(审计)
1、查看审计功能是否开启(本机已经开启,如果audit_sys_operations值为FALSE就是没开审计)
SQL> CONN /AS SYSDBA
SQL> show parameter audit
NAME TYPE VALUE
------------------------------------ -----------
------------------------------
audit_file_dest string F:APPADMINISTRATORADMINORCLADUMP
audit_sys_operations boolean TRUE
audit_trail string DB_EXTENDED
如果没有使用下面语句更改:
SQL> alter system set audit_trail=db_extended scope=spfile;
注意audit_trail要为DB_EXTENDED才记录执行的具体语句...
2、重启实例
SQL> shutdown immediate;
SQL> startup
3、针对某表的DML审计(错误的也记录)
SQL> AUDIT UPDATE,DELETE,INSERT ON T_TEST by access;
4、对该表做各种DML操作
用scott用户登录
SQL> conn scott/123
SQL> create table t_test as select * from emp;