This practice shows how unified audit policies are enforced on the current user who executes the SQL statement.
Before starting any new practice, refer to the Practices Environment recommendations.
Step 1 : Create the users and a procedure
/home/oracle/labs/M104781GC10/setup_audit_policies.shscript to create users and a procedure for this practice.
Step 2 : Create and enable an audit policy
PDB21, create and enable an audit policy to audit any query on the
HR.EMPLOYEEStable executed by the login user named
Step 3 : Test
U2and execute the
Display the values in
DBUSERNAME(the login user) and
CURRENT_USER(the user who executed the procedure) from the unified audit trail.
Observe that the unified audit policy is enforced on the current user who executed the SQL statement,
U1. Because only
U2is audited and
U1is the current user executing the query, there is no audit record generated that would give the auditor the impression that the statement is executed by the user who owned the top-level user session.