首页 > 数据库 > Oracle > 正文

oracle细粒度审计-使用

2019-11-02 14:48:51
字体:
来源:转载
供稿:网友

  以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 (

  

好听网名[www.la240.com/html2017/1/15/]
object_schema=>'SCOTT',

  object_name=>'EMP',

  policy_name=>'mypolicy1'

  );

  end;

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表