On Oracle 12c. is there any way to enable the audit trail on SELECT on whole schema of some users

oracleoracle-12c

Is there any way to enable the audit trail on SELECT on whole schema of some users?

I can only see there is example on auditing on certain table in a schema, but is there any way to audit on whole schema?

Best Answer

Please try the following:

AUDIT SELECT TABLE, INSERT TABLE, DELETE TABLE, EXECUTE PROCEDURE
ON <Schema_name>
BY ACCESS;

Using Oracle fine grain auditing we can achieve auditing of all statements of entire schema:

begin
    for c1 in (select * from all_tables where owner = '&schema') loop
        dbms_fga.add_policy (
            object_schema   => c1.owner,
            object_name     => c1.table_name,
            statement_types => 'SELECT,UPDATE,DELETE,INSERT',
            policy_name     => c1.table_name
        );
    end loop;
end;
/