In this Document
Symptoms
Changes
Cause
Solution
References
In testing prior to going to 11g, you find that application procedures which had completed in Oracle 10g in minutes (e.g. 30-40 ) are now taking 12 hours or more ... or may not complete at all
Symptom #1
Using Oracle 11g with Automatic Memory Management you may find within a short amount of time CPU Utilization reached up to 100% and detected unusual Wait Event stats for 2 or more of the following:
Symptom #2
Exceptional time spent for one of the following
If you are use "Automatic Memory Management" you may test switching to Manual as a workaround
CPU Utilization may improve substantially from the previously seen ~ 100% CPU but the values for "library cache: mutex X" will remain high and some procedures may never complete or run for several hours whereas they completed in minutes on 10gRx
Symtom #3
No confirmation that the following query ever completes: (N/A)*
High DBTime for a Simple Query that should execute in less than one second (85.6%)**
Elapsed CPU Elap per % Total
Time (s) Time (s) Executions Exec(s) DB Time SQL Id
---------- ---------- ------------ ---------- ------- -------------
32,514 32,195 N/A* N/A* 85.6** 6dv0dpznx0dg9
select VALUE from NLS_SESSION_PARAMETERS where PARAMETER='NLS_LENGTH_SEMANTICS'
Symptom #4
You have determined that
Symptom #5
AWR: Library cache: mutex X and Concurrency Wait Class dominates the Top 5 Wait Events
Further AWR statistics will include High Concurrency Foreground Wait Events
Second example profiling FOREGROUND WAITS
Symptom #6
Sample SYSTEM STATE excerpt shows exceptional oper SHRD or GET_EXCL[sive] on One mutex
Grep for above mutex in the system state dump ... long list ... point being that a large number of sessions either have it shared or want it exclusive, heavily contended mutex.
"...
Mutex 4dfa82650(0, 1) idn 96fb6306 oper SHRD
Mutex 4df7b1248(0, 1) idn 96fb6306 oper SHRD
Mutex 4df0c68b8(0, 1) idn 96fb6306 oper SHRD
Mutex 4df9a99b0(0, 1) idn 96fb6306 oper SHRD
Mutex 4df5d5b88(0, 1) idn 96fb6306 oper SHRD
Mutex 4df620bc0(0, 1) idn 96fb6306 oper SHRD
...
Mutex 4dfb28c60(1910, 0) idn 96fb6306 oper GET_EXCL
Mutex 4dfb28c60(756, 0) idn 96fb6306 oper GET_EXCL
Mutex 4ddceda68(0, 1) idn 96fb6306 oper SHRD
Mutex 4ddd01230(0, 1) idn 96fb6306 oper SHRD
...
.... Thousands more..."
Symptom #7
If you further investigate you will find that the "problem" query's SQL TEXT is not reported
** Row Source Not Available **
** SQL Text Not Available **
Sampled #
SQL ID Planhash of Executions % Activity
----------------------- -------------------- -------------------- --------------
Event % Event Top Row Source % RwSrc
------------------------------ ------- --------------------------------- -------
c5brdpybgqss6 N/A 0 64.17
CPU + Wait for CPU 63.65 ** Row Source Not Available ** 63.65
** SQL Text Not Available **
2091112056 0 10.00
CPU + Wait for CPU 9.90 ** Row Source Not Available ** 9.90
** SQL Text Not Available **
@Symptom #8
Testing or usage after upgrading to 11.1.0.x from 10g or earlier
Using or switching to CHAR NLS_LENGTH_SEMANTICS vs. the default value of BYTE
Comment: NLS_LENGTH_SEMANTICS is set at the Column level for Tables, Views, Indexes, or Packages/Procedures for Sting based datatypes including [N]CHAR ; [N]VARCHAR2 ; [N]CLOB
You are most likely hitting
Bug 7648406 CHILD CURSOR IS NOT SHARED IF NLS_LENGTH_SEMANTICS=CHAR
Bug 7648406 is caused by pseudo cursors which are not being shared as expected due to NLS_LENGTH_SEMANTICS=CHAR being set.
This bug can potentially result in thousands of Child Cursors for a single Parent Cursor which show as SHRD mutexes for "library cache: mutex X"
Another variation is
BUG 8523183 AQ APPLICATION STARTUP RESULTS IN HIGH SESSION CPU CONSUMPTION
More information can be found in
NOTE 783120.1 High cursor version count when NLS_LENGTH_SEMANTICS=CHAR Can Lead To ORA-4031 or ORA-600[17059] Errors
You will find that there are a large number of cursors associated with SYS.KOTTD$ table.
Executing the following query checks for pseudo cursors with high version counts
connect / as sysdba
select s.kglnaobj, sc.* from v$sql_shared_cursor sc, x$kglob s where sc.sql_id=s.kglobt03 and INDX =CHILD_NUMBER and s.kglobt03 = '3zjuyvs42c8hs';
Results indicate that we have cursor mismatch on AUTH_CHECK_MISMATCH and LANGUAGE_MISMATCH for those cursors with high version counts.
For more excellent information on this issue see
"Cursor: Pin S Wait On X" Contention Mutex Sleep Reason Primarily ' kkslce [KKSCHLPIN2]' Document 1268724.1
For a more comprehensive description ofWAITEVENT: "library cache: mutex X" please review document 727400.1 which includes many bug listings
Apply the patch for Bug 7648406 or request a backport if necessary
This is fixed in 11.2