Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

library cache concurrency

André Vila CovaJun 1 2020 — edited Jun 8 2020

Dear all,

I'm assessing performance in a 12.1.0.2 database and the pattern that I'm seeing is not very clear for me. As you can see in top 10 wait times there are high waits for concurrency, mainly library cache lock: mutex X.

Top 10 Foreground Events by Total Wait Time

EventWaitsTotal Wait Time (sec)Wait Avg(ms)% DB timeWait Class
DB CPU 6361.6 31.8
library cache: mutex X108,4881122.910.355.6Concurrency
log file sync109,964594.75.413.0Commit
latch: row cache objects53,20458611.012.9Concurrency
cursor: mutex X251,559499.71.992.5Concurrency
cursor: mutex S86,7773844.421.9Concurrency
buffer busy waits32,125234.97.311.2Concurrency
enq: SQ - contention9,520188.619.81.9Configuration
latch: call allocation22,652168.37.43.8Other
cursor: pin S33,070111.73.38.6Concurrency

However, the SQL that is promoting library cache: mutex X is just a

SELECT UNIT FROM SECTION WHERE CODE = :B1

No reloads or invalidations, the high version count of this query is too low. Find below the ASH from that period:

SQL IDPlan HashExecutions% ActivityEvent% EventTop Row Source% Row SourceSQL TextContainer Name
6pbbbumdmt35w 013.05CPU + Wait for CPU10.32SELECT STATEMENT6.58SELECT UNIT FROM SECTION WHERE..PRD
013.05library cache: mutex X1.62SELECT STATEMENT1.28SELECT UNIT FROM SECTION WHERE...PRD
dzsk004vfprp137691625261427.92CPU + Wait for CPU7.92UNION-ALL1.39PRD
f8ry92xjrqm3x29141222261347.47CPU + Wait for CPU7.47HASH - GROUP BY3.07PRD
bpmzta1v09vb719726006201176.58CPU + Wait for CPU6.47SELECT STATEMENT5.02PRD
3c7fapy0fk5a51388734953543.23CPU + Wait for CPU3.23SELECT STATEMENT3.18PRD

Any idea why so high library cache mutex X? Any bug?

Why the sum of all wait classes %DB time is only ~50% ? Where is database spending the other 50%?

Wait Classes by Total Wait Time

Wait ClassWaitsTotal Wait Time (sec)Avg Wait (ms)% DB timeAvg Active Sessions
DB CPU 6,362 31.81.2
Concurrency582,9383,0735.2715.30.6
Other198,0017924.004.00.1
Commit110,0005955.413.00.1
System I/O176,9423732.111.90.1
Configuration9,68419019.63.90.0
User I/O46,44980.18.00.0
Network870,98710.00.00.0
Application1,15511.08.00.0

Thanks in advance

This post has been answered by Jonathan Lewis on Jun 2 2020
Jump to Answer
Comments
Post Details
Added on Jun 1 2020
12 comments
1,748 views