Implementing fine-grained auditing
Standard auditing is of paramount importance in certain cases, such as session, statement, and privilege tracking, but does not give granularity more than at the object level.
In fact, if we want to audit any DML operation on objects and also need to audit additional cases that violate specific conditions on sensitive columns, then we must rely on fine-grain auditing.
In this recipe we will define two fine-grained audit policies. One will be defined on Emp
_
Details_View
and will perform general auditing, and one the EMPLOYEES
table that are using an access condition on the salary
and commission_pct
columns. Both objects belong to the HR
schema.
Getting ready
All steps will be performed on the HACKDB
database.
How to do it...
We will apply a fine-grained audit on EMP_DETAILS_VIEW
.
As the user
system
define a policy nameempd_vw_fga_policy
onemp_details_view
as follows:SQL> exec dbms_fga.add_policy(object_schema=>'HR',object_name=>'EMP_DETAILS_VIEW...