oracle细粒度审计使用

WBOY
发布: 2016-06-07 16:22:44
原创
1056 人浏览过

以scott用户的emp表为示例 ----增加策略 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,DELET

  以scott用户的emp表为示例

  ----增加策略

  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;

相关标签:
来源:php.cn
本站声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板