Classification and query of latch in SGA: combined with v$latch view

Source: Internet
Author: User
Tags sleep

Classification and query of latch in SGA

Latch in the SGA are divided into two categories:

(1) willing to wait for latch (willing-to_wait)

(2) Unwilling to wait for immediate

CBC multiple BH Components Cache Buffer Chain (CBC)

For example: CBC latch's generation of queries:

sys@ Bys3>col name for A20

sys@ Bys3>select Name,gets, Misses, sleeps, immediate_gets, immediate_misses from V$latch where NAME like '%cache Buffe RS chains% ';

NAME GETS misses sleeps immediate_gets immediate_misses

-------------------- ---------- ---------- ---------- -------------- ----------------

Cache buffers Chains 2006932 0 0 78095 0

V$latch each field Description:--From official documents

GETS number of times the latch is requested in willing-to-wait mode is willing to wait for a pattern to acquire a lock

Misses number of times the latch is requested in willing-to-wait mode and the requestor had to wait for mode, requestor request latch not Number of Waits after success

Sleeps number of times a willing-to-wait latch request resulted in a session sleeping while waiting for the latch Number of times you are willing to wait for mode to cause a session sleep

Immediate_gets number of times a latch is requested in no-wait mode immediately gets latch success

Immediate_misses number of times a no-wait latch request did not succeed (which is, missed) immediately get latch unsuccessful

###################################

Queries for V$latch views

sys@ bys3>select Count (*) from V$latch; The--oracle version is 11.2.0.4, the lock has 582 kinds

COUNT (*)

----------

582

sys@ bys3>select Count (*) from V$latch where immediate_gets+immediate_misses>0; --Willing to wait for Willing-to-wait's latch

COUNT (*)

----------

35

sys@ bys3>select Count (*) from V$latch where immediate_gets+immediate_misses=0; ---don't want to wait for immediate latch

COUNT (*)

----------

547

################

The number of times the requester requests latch to wait after unsuccessful willing-to-wait mode involves the _spin_count parameter: The default value of 2000, that is, the SPIN2000 time is still unable to get the latch to sleep.

sys@ Bys3>@?/rdbms/admin/show_para-Script specific content see: http://blog.csdn.net/haibusuanyun/article/details/17140197 second section.

Enter value for P:spin

Old 3:where i.inst_id = USERENV (' Instance ') and cv.inst_id = USERENV (' Instance ') and i.indx = Cv.indx and Upper (I.KSP PINM) like upper ('%&p% ') Order by REPLACE (I.KSPPINM, ' _ ', ')

New 3:where i.inst_id = USERENV (' Instance ') and cv.inst_id = USERENV (' Instance ') and i.indx = Cv.indx and Upper (I.KSP PINM) like upper ('%spin% ') Order by REPLACE (I.KSPPINM, ' _ ', ')

P_name p_description p_value IsDefault ismodified Isadj

------------------ ------------------------ ---------- --------- ---------- -----

_lm_lms_spin make LMS is false TRUE false

_mutex_spin_count Mutex spin count 255 TRUE False

_spin_count Amount to spin waiting for a latch 1 TRUE false

Here because it is the single core that is used on the virtual machine, so the _spin_count is 1, the dual core is the default value: 2000

Show parameter CPU to view current CPU condition.

#############

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.