The audit table AUD$ has been moved to a dedicated tablespace using package DBMS_AUDIT_MGMT (or otherwise), and the datafiles associated with this tablespace are set to autoextend. Database recyclebin parameter has been set to ON, audit_trail parameter has been set to db,extended. However when AUD$ grows and fills up the tablepace the datafile(s) do not autoextend and the following error is reported:
ORA-02002: error while writing to audit trail datafile not extending.Typically this error appears within a larger errorstack showing recursive operations:
Errors in file /u01/app/oracle/diag/rdbms/bdafisdc/bdafisdc1/trace/bdafisdc1_j000_13690.trc: ORA-12012: error on auto execute of job 11 ORA-02002: error while writing to audit trail ORA-00604: error occurred at recursive SQL level 5 ORA-08243: recursive audit operation attempted ORA-08243: recursive audit operation attempted ORA-06512: at "FMS_USER.SPREGISTERJOBS", line 9 ORA-06512: at "FMS_USER.SPREGISTERJOBS", line 92 ORA-06512: at line 1 Errors in file /u01/app/oracle/diag/rdbms/bdafisdc/bdafisdc1/trace/bdafisdc1_j000_13690.trc: ORA-00604: error occurred at recursive SQL level 1 ORA-02002: error while writing to audit trail ORA-00604: error occurred at recursive SQL level 4While connecting to the database using sqlplus the following errors occur:
ERROR: ORA-00604: error occurred at recursive SQL level 3 ORA-08243: recursive audit operation attempted ORA-08243: recursive audit operation attempted ORA-02002: error while writing to audit trail ORA-00604: error occurred at recursive SQL level 3 ORA-08243: recursive audit operation attempted ORA-08243: recursive audit operation attempted
Cause of the Problem
This issue was reported to development in Bug 11742155 - ORA-2002 and ORA-08243 when the audit tablespace is full.
The errors are caused by the fact that we are purging the recyclebin while writing the audit record. This automatic purge is triggered by the fact that there is no free space in the tablespace. Oracle Development concluded that there is no way to avoid this automatic purge operation.
Solution of the Problem
1.) Make sure that at any time there is sufficient free space in the tablespace of the AUD$ table. Tablespace utilization can be monitored with Enterprise Manager or by running the following query:
select sum(bytes)/1024/1024 from dba_free_space where tablespace_name ='NEW_TABLESPACE';
2.) Move the AUD$ table into a dictionary-managed tablespace. In this case the errors are not seen but consider carefully the potential drawbacks of using dictionary managed tablespaces.
3.) Allocate new extents for AUD$ manually. When doing this the datafile(s) of the tablespace are extended without issues:
alter table sys.aud$ allocate extent;
4) Increase the size of the database manually.
alter database datafile 6 resize 30G;
To know more information about resizing datafile have a look at http://arjudba.blogspot.com/2008/08/how-to-resize-datafile.html.