Hello, guys,
I have created and activated an Oracle unified audit policy on SELECT on a database table. It works fine. However, when I query a database view on top of this table (e.g. the view's query includes the table), the system records audit trail records for the table. This is something I do not want. I want audit trail records to be registered only when I query the table directly, but not when querying it through a view. Is there any way to prevent creation of these unwanted audit trail records?
Details:
Oracle Database 19c EE (last patchset), also tried with Oracle Database 18c SE, same behaviour.
CREATE VIEW myview AS SELECT * FROM mytable;
CREATE AUDIT POLICY test_policy ACTIONS SELECT ON mytable;
AUDIT POLICY test_policy;
A query like the one below
SELECT COUNT(*) FROM myview;
registers an audit trail record about “mytable”, which is I'm trying to avoid.
Is there any way to avoid that?