0

Running on Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production. Attempting to test auditing with the following steps:

Created a new user, MYUSER.

CREATE TABLE mytest (
  id NUMBER,
  val varchar2(10),
  CONSTRAINT mytest_pk PRIMARY KEY (id)
);

GRANT SELECT, INSERT, UPDATE, DELETE ON mytest TO myuser;

Executed as SYS:

CREATE AUDIT POLICY myaudit
  ACTIONS DELETE ON myuser.mytest,
          INSERT ON  myuser.mytest,
          UPDATE ON  myuser.mytest
          WHEN    'SYS_CONTEXT(''USERENV'', ''SESSION_USER'') = ''MYUSER'''
  EVALUATE PER SESSION;

AUDIT POLICY myaudit;

Put some data in the test table:

insert into mytest values(1,'test1');

Query the audit table:

select * from unified_audit_trail
order by event_timestamp desc

There are no records of audit for the INSERT. All I see DDL audits

enter image description here

WHat am I missing here?

  • Does it work without that WHERE clause? – sandman Feb 18 at 8:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.