oracle database AUDIT doesn't show SQL text and bind values

audit, oracle

Solution

The column `SQLTEXT` and `SQLBIND` are populated only when `AUDIT_TRAIL` option is set to `db, extended`. Here is an example:

SQL> alter system set audit_trail=db,extended scope=spfile;

System altered

Restart the instance.

SQL> audit select on your_table;

Audit succeeded

SQL> select sqltext from sys.aud$ where obj$name = 'YOUR_TABLE';

SQLTEXT
--------------------------------------------------------------------------------
null

SQL> select count(*) from your_table;

  COUNT(*)
----------
         3

SQL> select sqltext from sys.aud$ where obj$name = 'YOUR_TABLE';

SQLTEXT
--------------------------------------------------------------------------------
select count(*) from your_table


SQL> 

Problem

Based on this tutorial I have configured auditing on a database with these options: ``` AUDIT ALL BY db BY ACCESS; AUDIT SELECT TABLE, UPDATE TABLE, INSERT TABLE, DELETE TABLE BY db BY ACCESS; AUDIT EXECUTE PROCEDURE BY db BY ACCESS; ``` I prepare query from java and run a `SELECT` query. `DBA_AUDIT_TRAIL` table shows my `SELECT` query but `SQL_TEXT` and `SQL_BIND` fields are empty. How can I see them? Should I enable any other option? I'm using Oracle 11.2 Express Edition. Is this because It is express edition?

Original source