I want to audit a specific SQL query in Oracle. However I think we can audit only users or table level.
For example I want to audit 'audit statements', such as who run the "AUDIT CREATE SESSION by username by access" query.
Thanks for supports.
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It only takes a minute to sign up.Sign up to join this community
You are right in that audits of "audit" statements need to be made at the object level.
Using Traditional Auditing, you can use a query to generate a script to enable audit tracking for existing objects:
select 'audit audit on '||owner||'.'||object_name;' from dba_objects where owner='[owner]';
After that, or ideally when you first configure your database and before you install any schemas, you can set auditing of audit to happen by default for all future created objects with:
audit audit by default;
With Unified Auditing you can do something like this:
create audit policy audit_actions actions audit table, audit view, audit procedure, audit package, audit directory; audit policy audit_actions;