library cache lock mutex row cache

18
Library Cache Lock, Mutex and Data Dictionary Cache

Upload: saeed-meethal

Post on 22-Oct-2015

110 views

Category:

Documents


8 download

TRANSCRIPT

Page 1: Library Cache Lock Mutex Row Cache

Library Cache Lock, Mutex and Data Dictionary Cache

Page 2: Library Cache Lock Mutex Row Cache

UADTAO had high library cache lock and cursor: pin S wait on X contention. Let's find out detail.

Page 3: Library Cache Lock Mutex Row Cache

Top activity shows library cache lock and cursor: pin S wait on X are on top two spots.

Page 4: Library Cache Lock Mutex Row Cache

There are a couple of SQLs with high wait counts.

Page 5: Library Cache Lock Mutex Row Cache

No session has dominant waits.

Page 6: Library Cache Lock Mutex Row Cache

For "cursor: pin S wait on X", use the context menu to find out mutex holder.

Page 7: Library Cache Lock Mutex Row Cache

Session 1442 is the mutex holder.

Page 8: Library Cache Lock Mutex Row Cache

Session 1442 is waiting on library cache lock for 25 seconds. Use context menu to find the lock holder. Note this wait time is not very long. Frequently when use SQLPLUS for troubleshooting, the time we type or copy/paste SQL scripts, the lock will disappear and we then have no idea

what happens.

Page 9: Library Cache Lock Mutex Row Cache

This is the lock matrix. They are plenty of sessions requesting the same library cache lock, for table TAO_LOGFILE_DELTA. It is held by session 23 on node 3 in Exclusive mode. The holder is busy, but had "latch: row cache objects" waits which frequently refers to data dictionary cache contention.

Page 10: Library Cache Lock Mutex Row Cache

(This screenshot was taken a little bit too late.) Session 23 on node 3 now waits on  library cache lock, too. We can use the same method to find out the lock

holder. In this case, it is session 592 on the same node, which is busy and has waited on "latch: row cache objects"

Page 11: Library Cache Lock Mutex Row Cache

Session 592 is working on a stat gathering job.

Page 12: Library Cache Lock Mutex Row Cache

Session 23 is also working on a stat gathering job.

Page 13: Library Cache Lock Mutex Row Cache

Let's look at shared pool for node 3. KQR L PO is part of data dictionary cache.  It is using 7881MB, or 51% of

total shared pool memory.

Page 14: Library Cache Lock Mutex Row Cache

The top data dictionary cache is dc_histogram_defs, at 7.771M entries. Note each KQR L PO entry will use at least 1024 bytes (1KB). So dc_histogram_defs is the

reason for shared pool memory usage. dc_histogram_def is related to table column stats -  histograms. This also explains why we see "latch: row cache objects" wait

events from the stat gather jobs when those jobs need to update row cache.

Page 15: Library Cache Lock Mutex Row Cache

A snapshot taken on another day. “row cache lock” is data dictionary cache related. Clicking

the row will show the cache name.

Page 16: Library Cache Lock Mutex Row Cache

"row cache lock" is related to column histogram entries, too.

Page 17: Library Cache Lock Mutex Row Cache

Data dictionary cache uses more than 4GB memory.

Page 18: Library Cache Lock Mutex Row Cache

Column stats histogram is the major consumer.