Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Please ask technical questions in the appropriate category. Thank you!

Unwanted audit trail records for a table when querying a database view on top of the table

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?

Comments
Post Details
Added on Jun 6 2023
0 comments
39 views