Example of a Scott user's EMP table
----Increase Policy
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
----Enable policy
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; --Audit results
SELECT text from Dba_views where View_name=upper (' dba_fga_audit_trail '); --View Records
----Delete Policy
Begin
Dbms_fga.drop_policy (
Object_schema=> ' SCOTT ',
Object_name=> ' EMP ',
Policy_name=> ' Mypolicy1 '
);
End
Oracle Fine-grained audit use