zoukankan      html  css  js  c++  java
  • nullnullOracle 审计audit 的技巧使用,追踪oracle后台数据库的DML动作

    新手发帖,很多方面都是刚入门,有错误的地方请大家见谅,欢迎批评指正

        create or replace package aa_pkg_monitor_business_sql is

      procedure pro_monitor_drop_policy(object_schema in varchar2);
      procedure pro_monitor_add_policy(object_schema in varchar2);

      procedure pro_monitor_drop_main;
      procedure pro_monitor_add_main;

        end;
    /
    create or replace package body aa_pkg_monitor_business_sql is

      /*
      truncate table  sys.fga_log$ ;
      select t.* from dba_fga_audit_trail t;
      */
      procedure pro_monitor_drop_policy(object_schema in varchar2) is
     
        cursor cur_del is
          select owner, table_name from dba_tables a where owner = object_schema;
     
      begin
        for v_cur in cur_del
        loop
          begin
            dbms_fga.drop_policy(object_schema => v_cur.owner, ---
                                 object_name => v_cur.table_name, ---
                                 policy_name => v_cur.table_name);
          exception
            when others then
              null;
          end;
        end loop;
      end pro_monitor_drop_policy;
      --------------------------------------------------------------------

      --------------------------------------------------------------------
      procedure pro_monitor_add_policy(object_schema in varchar2) is
     
        cursor cur_del is
          select owner, table_name
          from   dba_tables a
          where  owner = object_schema and
                 a.table_name not like 'SRP%';
     
      begin
        for v_cur in cur_del
        loop
          begin
            dbms_fga.add_policy(object_schema => v_cur.owner, --
                                object_name => v_cur.table_name, --
                                policy_name => v_cur.table_name,
                                statement_types => 'SELECT,UPDATE,DELETE,INSERT',
                                enable => true);
         
          exception
            when others then
              null;
          end;
        end loop;
      end pro_monitor_add_policy;

        每日一道理
    爱,有的时候不需要山盟海誓的承诺,但她一定需要细致入微的关怀与问候;爱,有的时候不需要梁祝化蝶的悲壮,但她一定需要心有灵犀的默契与投合;爱,有的时候不需要雄飞雌从的追随,但她一定需要相濡以沫的支持与理解。

      --------------------------------------------------------------------

      --------------------------------------------------------------------
      procedure pro_monitor_drop_main is
      begin
        pro_monitor_drop_policy('CCARE');
        pro_monitor_drop_policy('CRMPUB');
        pro_monitor_drop_policy('INVENTORY');
        pro_monitor_drop_policy('ISAP');
        pro_monitor_drop_policy('OSMS');
        pro_monitor_drop_policy('ECARE');
        pro_monitor_drop_policy('CHANNEL');
      end pro_monitor_drop_main;

      --------------------------------------------------------------------

      --------------------------------------------------------------------
      --------------------------------------------------------------------

      --------------------------------------------------------------------
      procedure pro_monitor_add_main is
      begin
     
        pro_monitor_drop_main;
     
        pro_monitor_add_policy('CCARE');
       -- pro_monitor_add_policy('CRMPUB');
        pro_monitor_add_policy('INVENTORY');
        --pro_monitor_add_policy('ISAP');
        ---pro_monitor_add_policy('OSMS');
     
      end pro_monitor_add_main;

        end;
    /

    文章结束给大家分享下程序员的一些笑话语录: 联想——对内高价,补贴对外倾销的伟大“民族”企业。

  • 相关阅读:
    Java
    一个web项目web.xml的配置中<context-param>配置作用
    JVM之几种垃圾收集器简单介绍
    JVM日志和参数的理解
    Java GC日志查看
    Java-性能调优-理解GC日志
    理解Java的GC日志
    tomcat打印GC日志
    快速解读GC日志
    Java 堆内存
  • 原文地址:https://www.cnblogs.com/xinyuyuanm/p/3067627.html
Copyright © 2011-2022 走看看