Thanks for the question, Michael.
Asked: September 02, 2022 - 4:30 pm UTC
Last updated: September 06, 2022 - 5:45 am UTC
Version: Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Viewed 1000+ times
create audit policy audit_schema_names_objects actions all on schema_name.* only toplevel;
create or replace trigger tweak_auditing after create on database begin -- -- lots of flexibility here in choosing what you want to log -- and when etc etc. -- if ora_dict_obj_type = 'TABLE' and ora_dict_obj_owner in ('....') and dbms_utility.format_call_stack not like '%NIGHTLY%' -- not the nightly maint jobs and nvl(sys_context('USERENV','MODULE'),'x') != 'DBMS_SCHEDULER' -- not jobs and ... (whatever you want) then -- -- tweak the audit policy -- execute immediate 'alter audit policy my_policy add actions all on '||ora_dict_obj_owner||'.'||ora_dict_obj_name; end if; end; /
Check out more PL/SQL tutorials on our LiveSQL tool.
PL/SQL reference manual from the Oracle documentation library