Oracle的审计功能(简单记录)

切换权限用户:
SQLPLUS> connect / AS SYSDBA;


1、查看状态
SQLPLUS> show parameter audit;

2、修改状态(用户SYS):
SQLPLUS> alter system set audit_trail=DB,Extended scope=spfile;

3、重启Oracle
SQLPLUS> shutdown normal;
SQLPLUS> startup;

4、查看审计状态(用户SYS)
SQLPLUS> show parameter audit;

5、设置审计(用户SYS)
SQLPLUS> audit DELETE, INSERT,SELECT, UPDATE on edms.t_audit_demo by access Whenever successful;

audit insert table by MFDB;
audit update table by MFDB;
audit delete table by MFDB;

6、关闭审计
SQLPLUS> noaudit DELETE, INSERT,SELECT, UPDATE on edms.t_audit_demo;

7、查询已经添加的审计
SELECT USER_NAME, AUDIT_OPTION, SUCCESS, FAILURE FROM DBA_STMT_AUDIT_OPTS;

8、查看记录
SELECT * FROM sys.aud$

发表评论