※sysユーザでのSQL実行は監査ログに残らない
truncate table SYS.FGA_LOG$;
select * from SYS.FGA_LOG$;
select * from dba_audit_policies;
begin
DBMS_FGA.ADD_POLICY (
object_schema => 'sh',
object_name => 'sales',
policy_name => 'myfga1',
audit_condition => 'prod_id < 100',
audit_column => 'cust_id,time_id',
handler_schema => NULL,
handler_module => NULL,
enable => TRUE,
statement_types => 'select,INSERT, UPDATE',
audit_trail => DBMS_FGA.DB + DBMS_FGA.EXTENDED,
audit_column_opts => DBMS_FGA.ANY_COLUMNS);
end;
/
select cust_id from sh.sales where prod_id < 100 fetch first 30 rows only;
begin
DBMS_FGA.DROP_POLICY(
object_schema => 'sh',
object_name => 'sales',
policy_name => 'myfga1');
end;
/