---摘錄開始 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審計策略:
begin dbms_fga.enable_policy ( object_schema => 'SCOTT', object_name =>'EMP', policy_name => 'EMP_FGA_AUDIT', enable => FALSE ); end;
請補全其他的審計策略
三、執行exp 導出sys.fga_log$表exp sys/aa file=fga_logdmp log=fga_logexp.log tables=sys.fga_log$ buffer=99999999請注意:sys.fga_log$為5G大小(請注意,該表有lob字段,不能只查詢dba_segments來確定帶有lob列的表的大小),所以,導出可能需要一段時間。
truncate table sys.fga_log$
五、開啟fga審計策略:
begin dbms_fga.enable_policy ( object_schema => 'SCOTT', object_name =>'EMP', policy_name => 'EMP_FGA_AUDIT', enable => TRUE ); end;請補全其他的審計策略
注意:上邊=>後邊的信息,可以從dba_audit_policies查詢出來。