oracle 细粒度审计使用
----增加策略
begin
DBMS_FGA.ADD_POLICY (
object_schema => ‘SCOTT‘,
object_name => ‘EMP‘,
policy_name => ‘mypolicy1‘,
handler_schema => NULL,
handler_module => NULL,
enable => TRUE,
statement_types => ‘INSERT, UPDATE,DELETE‘,
audit_column_opts => DBMS_FGA.ANY_COLUMNS);
end;
----启用策略
begin
DBMS_FGA.ENABLE_POLICY (
object_schema => ‘SCOTT‘,
object_name => ‘EMP‘,
policy_name => ‘mypolicy1‘,
enable => TRUE);
end;
select * from dba_fga_audit_trail;
select * from dba_audit_policies;
select db_user,timestamp,sql_text,sql_bind from dba_fga_audit_trail; --审计结果
SELECT text FROM dba_Views where view_name=upper(‘DBA_FGA_AUDIT_TRAIL‘); --查看记录
----删除策略
begin
dbms_fga.drop_policy (
object_schema=>‘SCOTT‘,
object_name=>‘EMP‘,
policy_name=>‘mypolicy1‘
);
end;
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。