转自————http://blog.csdn.net/msdnchina/article/details/38435999
一、确认有哪些fga审计策略,
从select * from dba_audit_policies就可以查询到审计策略,请注意,查询结果中的每一行,就是一个审计策略。另外,fga审计记录存放在这个视图中:select * from dba_fga_audit_trail该视图对应的后台基表为:sys.fga_log$,见如下的视图。注意,fga审计策略不是存放在sys.aud$表中!!![html] view plain copy ---摘录开始 CREATE OR REPLACE VIEW DBA_FGA_AUDIT_TRAIL (session_id, timestamp, db_user, os_user, userhost, client_id, econtext_id, ext_name, object_schema, object_name, policy_name, scn, sql_text, sql_bind, comment$text, statement_type, extended_timestamp, PRoxy_sessionid, global_uid, instance_number, os_process, transactionid, statementid, entryid, obj_edition_name, dbid) AS select sessionid, CAST ( (FROM_TZ(ntimestamp#,'00:00') AT LOCAL) AS DATE ), dbuid, osuid, oshst, clientid, auditid, extid, obj$schema, obj$name, policyname, scn, to_nchar(substr(lsqltext,1,2000)), to_nchar(substr(lsqlbind,1,2000)), comment$text, DECODE(stmt_type, 1, 'SELECT', 2, 'INSERT', 4, 'UPDATE', 8, 'DELETE', 'INVALID'), FROM_TZ(ntimestamp#,'00:00') AT LOCAL, proxy$sid, user$guid, instance#, process#, xid, statement, entryid, obj$edition, dbid from sys.fga_log$ ---摘录结束 二、禁用fga审计策略:以下以%20policy_name%20=>%20'EMP_FGA_AUDIT'为例子说明,当然,客户的环境中,可能存在多个审计策略。[html] view%20plain copy begin dbms_fga.enable_policy ( object_schema => 'SCOTT', object_name =>'EMP', policy_name => 'EMP_FGA_AUDIT', enable => FALSE ); end;请补全其他的审计策略
三、执行exp%20导出sys.fga_log$表[html] view%20plain copy exp sys/aa file=fga_logdmp log=fga_logexp.log tables=sys.fga_log$ buffer=99999999 请注意:sys.fga_log$为5G大小(请注意,该表有lob字段,不能只查询dba_segments来确定带有lob列的表的大小),所以,导出可能需要一段时间。四、%20删除日志表:[html] view%20plain copy truncate table sys.fga_log$五、开启fga审计策略:
[html] view%20plain copy begin dbms_fga.enable_policy ( object_schema => 'SCOTT', object_name =>'EMP', policy_name => 'EMP_FGA_AUDIT', enable => TRUE ); end; 请补全其他的审计策略注意:上边=>后边的信息,可以从dba_audit_policies查询出来。新闻热点
疑难解答