Too many parse errors - Oracle

Oracle Too Many Parse Errors: Alert log Warnings Explained

Oracle Database may report WARNING: too many parse errors in the alert log when a SQL statement repeatedly fails during parsing.

These failures can result from syntax errors, invalid object references, missing privileges, or other semantic problems. Although an occasional parse error is usually harmless, repeated failures can consume unnecessary CPU resources and indicate an application issue.

In this article, I explain how these warnings are generated, how to interpret their diagnostic information, and how to investigate failed SQL statements using Oracle event 10035.

SQL syntax errors are always normal and commonly dealing with them is up to software developers.  But sometimes, they might bother database administrators too.

When an sql is syntactically(E.g. syntax error) or semantically(E.g. projection of a nonexistent column) incorrect, its processing fails at parsing stage and it never gets executed.

If that happens too often, it can have a negative impact on overall database performance. With 12.2 release, these failing sqls are recorded in alert.log as below if they are called excessively.

2022-02-17T14:25:33.918516+10:30
WARNING: too many parse errors, count=9700 SQL hash=0xcccb313a
PARSE ERROR: ospid=33356, error=923 for statement:
2022-02-17T14:25:33.918632+10:30
select dual
Additional information: hd=0xb336ab08 phd=0xb336af30 flg=0x28 cisid=120 sid=120 ciuid=120 uid=120
2022-02-17T14:29:04.673714+10:30
WARNING: too many parse errors, count=9800 SQL hash=0xcccb313a
PARSE ERROR: ospid=34578, error=923 for statement:
2022-02-17T14:29:04.673839+10:30
select dual
view raw parse_error.txt hosted with ❤ by GitHub
FieldMeaning
count=9700Accumulated parse-error count reported for this SQL
SQL hashIdentifier for the failing SQL statement
ospid=33356Operating-system process ID
error=923Oracle error ORA-00923
select dualSQL statement that failed parsing

In the above example, “select dual” statement is failing with “ORA-00923: FROM keyword not found where expected” error code. This is a syntax error, which is observed 100 times  within 4 minutes and it is recorded.

Now the question is coming. How much amount of failure is required for an sql to got written in the alert.log file?

According to the Doc ID 16945190.8, By default the diagnostic will dump the parse error along with warning in alert log every 100 parse errors for a given SQL within a 60 minutes period. The sampling interval can be configured with the hidden parameter “_kks_parse_error_warning“. 

To mute these warnings.

SQL> ALTER SYSTEM SET "_kks_parse_error_warning"=0 SCOPE=BOTH;

Also, anytime 10035 KSD(Kernel Service Debugging) event can be used to detect these parse failures.

Until explicitly disabled, it will track sql statements with parsing errors.
SQL> alter system set events '10035 trace name context forever, level 1';
Levels:
level 1+ Print out user SQL statements
level >3 Print out recursive SQL
level >5 Print out row cache cached cursor stats
Turning off :
SQL> alter system set events '10035 trace name context off';
view raw 10035_event.txt hosted with ❤ by GitHub

Diagnostic information for 10035 condition enriched largely with “Bug 25754281 – Diagnostic Enhancement For Event 10035 To Dump More Details About Parse Failures To Alert Log (Doc ID 25754281.8)“

When this warning appears in the alert log, the first step is to identify the failing SQL statement and its Oracle error code.

Check the alert log for WARNING: too many parse errors and the associated PARSE ERROR entries.

Identify the Oracle error number, SQL statement, and operating-system process ID.

Determine which application, session, or database process is repeatedly submitting the invalid statement.

Correct the underlying SQL, object reference, privilege issue, or application behavior.

If the SQL text is missing from the diagnostic output, investigate using supported tracing techniques or Oracle event 10035, taking your database release and patch level into account.

Suppressing the warning does not fix the underlying parse failures.

If the alert log does not include the SQL statement responsible for the parse errors, identifying the source can become more challenging. I explored this problem in greater detail, including cursor dumps, event 10035, and database triggers, in my follow-up article: Finding Failed SQL Queries with 10035 Event Tracing in Oracle.

What causes “WARNING: too many parse errors” in Oracle?

This warning indicates that a SQL statement has repeatedly failed during parsing. Common causes include invalid SQL syntax, nonexistent database objects, incorrect column references, and missing privileges.

What is the default threshold for Oracle parse error warnings?

According to Oracle Support Doc ID 16945190.8, the default diagnostic threshold is 100 parse errors for a given SQL statement within a 60-minute period. This behavior can vary depending on the Oracle Database version and applied patches.

How can I identify SQL statements that fail during parsing?

Start by checking the alert log for the error number, process ID, and SQL text. If the statement is not recorded, event 10035 and additional diagnostic tracing can help identify it. The available diagnostic information depends on the database version and Release Update.

Hope it helps.


Discover More from Osman DİNÇ


Comments

Leave your comment