oracle tutorial webinars

ORA-00604: error occurred at recursive SQL level 1

Error ORA-00604 is a commonly seen error by Oracle users, and one that can sometimes be tricky to solve. ORA-00604 occurs while processing a recursive SQL statement. A recursive SQL statement is a statement that is applied to internal dictionary tables.

Because there are many possible reasons for the error, Oracle simply states that if the situation described in the next error on the stack can be corrected, it should be corrected. Otherwise, the user should contact the Oracle support line.

An example of error ORA-00604 in Oracle 11g is “error occurred at recursive SQL level 1” in which table or view does not exist. A possible cause for recursive SQL errors is a  trigger. If this is the case, you may have experienced the trigger attempting to insert records into an audit log table, the audit log table being dropped by your cleanup script, or a trigger that fires for every DDL statement.

To make sure that the error is related to a trigger issue, execute the following SQL statement:

Alter system set “_system_trig_enabled”=FALSE;

To view all of the triggers, execute the following SQL statement:

SELECT * FROM dba_triggers

WHERE trigger_type not in (‘before each row’,’after each row’)

To find the most relevant triggers, filter the triggering_event column.

Find the trigger that is causing the problem and disable it or drop it to resolve the issue. Usually, this error occurs in the Oracle database by the system level triggers on DDL or SYSTEM events.

Another example of error ORA-00604 is when the user attempts to run a newly-created table using SELECT* from cdc. In this case, the DBMS_CDC_PUBLISH package needs to be recompiled using SYS. The user should recompile until invalid packages are no longer viewed.

The Error ORA-00604 message itself does not indicate the actual error, and the user must look at the directly preceding message to determine the reason for the error. As always, check the syntax and spelling of your code to ensure no careless errors have been made. Make use of the debugger when running into issues. If you continue to face problems with this error, contact your database administrator. Fixing error ORA-00604 can especially be difficult as there are many possible reasons for the message. Consider consulting a professional well versed in Oracle issues if the problem persists. Make sure to check their credentials to ensure that they have the appropriate knowledge, experience and expertise to handle your specific needs.