How to Identify Hard Parse Failures (文件 ID 1353015.1)
Applies to:
Oracle Database - Enterprise Edition - Version 10.2.0.2 and laterInformation in this document applies to any platform.
Goal
Hard parse time may be impacted when there are a high number of parse errors.
This may be noted in the ADDM report as follows:
------------------------------------
Hard parsing SQL statements that encountered parse errors was consuming
significant database time.
RECOMMENDATION 1: Application Analysis, 62% benefit (2561 seconds)
ACTION: Investigate application logic to eliminate parse errors.
In the AWR report Parse Failures are recorded in 2 places:
1. Time Model Statistics
2. Instance Activity Stats
......
Solution
Failed parses are not stored in the data dictionary and therefore cannot be identified through querying the data dictionary.
As of Oracle10g, event 10035 can be set to report SQLs that fail during PARSE operations.
Syntax:
ALTER SESSION SET EVENTS '10035 trace name context forever, level 1';
EVENT="10035 trace name context forever, level 1"
Levels:
level 1+ Print out failed parses of SQL statements to
Note:
The event can be turned off as follows:
ALTER SYSTEM SET EVENTS '10035 trace name context off';
ALTER SESSION SET EVENTS '10035 trace name context off';
When the event is set,any statement that fails to parse as a result of an error, will be documented in the alert.log, together with the error number and the process OSPID as displayed below
Mon Aug 29 09:48:24 2011
select empid from emp
PARSE ERROR: ospid=1776, error=936 for statement:
Mon Aug 29 09:21:30 2011
select * from emp where empno =
PARSE ERROR: ospid=10220, error=942 for statement:
Mon Aug 29 09:49:03 2011
select * from emp_new
High CPU and Library Cache Contention
A high number of invalid (syntactically incorrect) SQL can result in
high CPU and library cache contention. Ideally, the solution is to fix
the application to issue valid SQL.
However, as a temporary
workaround, it is possible to set _cursor_features_enabled in order to
ease the effect of the incorrect parsing.
When set the parse error
is recorded in a table SQLERROR$ which is checked so that repeated
attempts to parse syntactically or semantically invalid statements will
not continually incur the full costs associated with hard parsing.
In order to enable this workaround,add 32 to the current value of _cursor_features_enabled.
For Example:
The default value of _cursor_features_enabled = 2.
In order to enable the fix set _cursor_features_enabled to 2 + 32.
SQL> show parameter _cursor_features_enabled
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
_cursor_features_enabled integer 32
SQL> alter system set "_cursor_features_enabled" = 34 scope=spfile;
System altered.
After restarting the database certain (not all) parse errors for non-SYS users will be recorded in sqlerror$.
The
following notes include information on the necessary fixes to enable
this feature. These fixes are included in 112.0.4 and 12.1.0.1
Document 14584323.8 Bug 14584323 - ORA-1775 may be reported masking some other error
Failed Parse Time and ORA-4025
If a cursor reaches the max threshold for active locks, it can generate lots of ORA-4025 errors and failed parse time will increment very quickly.
See:
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/31393455/viewspace-2131910/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- fast parse,soft parse,hard parse的區別!AST
- soft parse(軟解析),hard parse(硬解析)
- How To Identify a Hot Block Within The Database Buffer Cache. [ID 163424.1]IDEBloCDatabase
- How to Identify Resource Intensive SQL for Tuning [ID 232443.1](metalink artic)IDESQL
- 關於軟解析(soft parse)與硬解析(hard parse),以及session cached cursors (asktom)Session
- How to Collect Diagnostics for Database Hanging Issues (文件 ID 452358.1)Database
- How to Check and Enable/Disable Oracle Binary Options (文件 ID 948061.1)Oracle
- How to Create or Remove Restore Point on Standby database (文件 ID 1672977.1)REMRESTDatabase
- Sql最佳化(六)程式可擴充套件性:soft parse/hard parse,以及為什麼要使用繫結變數SQL套件變數
- How To Analyze the Wait Statistic: 'enq: HW - contention' (文件 ID 419348.1)AIENQ
- HOW TO SHRINK A TABLE USING ONLINE REDEFINITION (文件 ID 1357878.1)
- How to Move a Database Using Transportable Tablespaces (文件 ID 1493809.1)Database
- Best Practices for failover during server failures [ID 1323472.1]AIServer
- How to Specify an INDEX Hint oracle官方文件IndexOracle
- Identify Which Latch is Associated with a "latch free" wait-413942.1IDEAI
- How To Find The Object That Causing ORA-600 [kqlnrc_1] (文件 ID 1190673.1)Object
- oracle ORA-01157: cannot identify/lock data file 64OracleIDE
- Identify If A Disk/Part Is Still Used By ASM,Used by ASM Or Used by ASM_603210.1IDEASM
- How To Kill Good IdeasGoIdea
- Parse CPU to Parse Elapsd %: 指標太低指標
- 《The Hard Thing About Hard Things》讀書筆記筆記
- How to compile Invalid Object?CompileObject
- Reverse Card (Hard Version)
- Surviving AWS Failures with a Node.js and MongoDB StackAINode.jsMongoDB
- How to Prepare Storage for ASM (Doc ID 452924.1)ASM
- How to Troubleshoot Grid Infrastructure Startup IssuesASTStruct
- How to find the UDID for an iPhone/iPod touchiPhone
- How to Brainstorm New IdeasAIORMIdea
- How to tacktrace In Android for Java codeAndroidJava
- ORA-01157: cannot identify/lock data file n 故障一例IDE
- LOB HWM CONTENTION,Using AWR to Identify Problem; Confirm,Verify Fix-837883.1IDE
- How to resolve : Authentication denied: Boot identity not validbootIDE
- how to use oidpasswd to admin your AS/OID account
- First Missing Positive【hard】
- git reset --hard HEAD^Git
- How To Automate Disconnection of Idle SessionsSession
- How to Recreate the OraInventory on UNIX Systems [ID 472854.1]AI
- How to Resolve Invalid Objects in a Database [ID 158185.1]ObjectDatabase