[20190409]latch get 引數where and why.txt
[20190409]latch get 引數where and why.txt
--//這一陣子一直在探究latch,mutex的問題,思路好亂.放假在看了許多連結.
--//被裡面的X$搞得有點暈.慢慢理解看看:
kslgetl(laddr, wait, why, where) – Get exclusive latch
--//感覺作者這裡寫錯了,應該是kslgetl(laddr, wait, where, why).這樣才與下面的連結對上.
More precisely, to request the latch Oracle kernel needs:
--//更準確地說,要請求閂鎖Oracle核心需要:
laddress -- address of latch in SGA
wait -- flag. If true, this is latch get in willing-to-wait mode..
where -- code for location from where the latch is acquired.
why -- context why the latch is acquired at this where.
--//我主要關注where,why如何取值.
1-latch address
2-immediate get (0 means yes, 1 means no)
3-where (X$KSLLW.INDX)
4-why (X$KSLWSC.INDX)
5-mode (8=shared,16=exclusive; only for ksl_get_shared_latch function)
--//以作者寫的例子看看latch='DMON Work Queues Latch'的情況:
1.環境:
SYS@book> @ ver1
PORT_STRING VERSION BANNER
------------------------------ -------------- --------------------------------------------------------------------------------
x86_64/Linux 2.4.xx 11.2.0.4.0 Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
SYS@book> select addr, name from v$latch where name='DMON Work Queues Latch';
ADDR NAME
---------------- ----------------------------------------
000000006004C300 DMON Work Queues Latch
SYS@book> select addr, name from v$latch_parent where name='DMON Work Queues Latch';
ADDR NAME
---------------- ----------------------------------------
000000006004C300 DMON Work Queues Latch
SYS@book> select addr, name from v$latch_children where name='DMON Work Queues Latch';
no rows selected
--//僅僅存在父拴鎖.
2.首先看看why的取值:
--//4-why (X$KSLWSC.INDX)
SYS@book> select * from x$kslwsc where ksllasnam ='DMON Work Queues Latch';
ADDR INDX INST_ID KSLNOWTF KSLSLEEP KSLWSCWSL KSLWSCLTHG KSLLASNAM
---------------- ---------- ---------- ---------- ---------- ---------- ---------- ----------------------
00000000861C08C0 4972 1 0 1 1 0 DMON Work Queues Latch
00000000861C08E0 4973 1 0 0 0 0 DMON Work Queues Latch
00000000861C0900 4974 1 0 0 0 0 DMON Work Queues Latch
00000000861C0920 4975 1 0 0 0 0 DMON Work Queues Latch
00000000861C0940 4976 1 0 0 0 0 DMON Work Queues Latch
00000000861C0960 4977 1 0 0 0 0 DMON Work Queues Latch
00000000861C0980 4978 1 0 0 0 0 DMON Work Queues Latch
00000000861C09A0 4979 1 0 0 0 0 DMON Work Queues Latch
00000000861C09C0 4980 1 0 0 0 0 DMON Work Queues Latch
00000000861C09E0 4981 1 0 0 0 0 DMON Work Queues Latch
00000000861C0A00 4982 1 0 0 0 0 DMON Work Queues Latch
00000000861C0A20 4983 1 0 0 0 0 DMON Work Queues Latch
00000000861C0A40 4984 1 0 0 0 0 DMON Work Queues Latch
00000000861C0A60 4985 1 0 0 0 0 DMON Work Queues Latch
00000000861C0A80 4986 1 0 0 0 0 DMON Work Queues Latch
00000000861C0AA0 4987 1 0 0 0 0 DMON Work Queues Latch
00000000861C0AC0 4988 1 0 0 0 0 DMON Work Queues Latch
00000000861C0AE0 4989 1 0 0 0 0 DMON Work Queues Latch
00000000861C0B00 4990 1 0 0 0 0 DMON Work Queues Latch
00000000861C0B20 4991 1 0 0 0 0 DMON Work Queues Latch
00000000861C0B40 4992 1 0 0 0 0 DMON Work Queues Latch
00000000861C0B60 4993 1 0 0 0 0 DMON Work Queues Latch
00000000861C0B80 4994 1 0 0 0 0 DMON Work Queues Latch
00000000861C0BA0 4995 1 0 0 0 0 DMON Work Queues Latch
00000000861C0BC0 4996 1 0 0 0 0 DMON Work Queues Latch
00000000861C0BE0 4997 1 0 0 0 0 DMON Work Queues Latch
00000000861C0C00 4998 1 0 0 0 0 DMON Work Queues Latch
00000000861C0C20 4999 1 0 0 0 0 DMON Work Queues Latch
00000000861C0C40 5000 1 0 0 0 0 DMON Work Queues Latch
00000000861C0C60 5001 1 0 0 0 0 DMON Work Queues Latch
00000000861C0C80 5002 1 0 0 0 0 DMON Work Queues Latch
00000000861C0CA0 5003 1 0 0 0 0 DMON Work Queues Latch
00000000861C0CC0 5004 1 0 0 0 0 DMON Work Queues Latch
00000000861C0CE0 5005 1 0 0 0 0 DMON Work Queues Latch
00000000861C0D00 5006 1 0 0 0 0 DMON Work Queues Latch
00000000861C0D20 5007 1 0 0 0 0 DMON Work Queues Latch
00000000861C0D40 5008 1 0 0 0 0 DMON Work Queues Latch
00000000861C0D60 5009 1 0 0 0 0 DMON Work Queues Latch
00000000861C0D80 5010 1 0 0 0 0 DMON Work Queues Latch
00000000861C0DA0 5011 1 0 0 0 0 DMON Work Queues Latch
00000000861C0DC0 5012 1 0 0 0 0 DMON Work Queues Latch
00000000861C0DE0 5013 1 0 0 0 0 DMON Work Queues Latch
00000000861C0E00 5014 1 0 0 0 0 DMON Work Queues Latch
00000000861C0E20 5015 1 0 0 0 0 DMON Work Queues Latch
00000000861C0E40 5016 1 0 0 0 0 DMON Work Queues Latch
00000000861C0E60 5017 1 0 0 0 0 DMON Work Queues Latch
46 rows selected.
--//可以看出取值在4972-5017之間.
SYS@book> select * from x$ksllw where indx between 4972 and 5017;
ADDR INDX INST_ID KSLLWNAM KSLLWLBL
---------------- ---------- ---------- --------------------------- -----------------
0000000009AB0CC0 4972 1 rfifdrcxch
0000000009AB0CD0 4973 1 rfifreqch
0000000009AB0CE0 4974 1 rfm_do_hc
0000000009AB0CF0 4975 1 rfm_init_boot_te1
0000000009AB0D00 4976 1 rfm_init_boot_te2
0000000009AB0D10 4977 1 rfm_init_boot_te3
0000000009AB0D20 4978 1 rfm_init_boot_te4
0000000009AB0D30 4979 1 rfm_free_te
0000000009AB0D40 4980 1 rfm_setup_te
0000000009AB0D50 4981 1 rfmeadvphs
0000000009AB0D60 4982 1 rfmdophs
0000000009AB0D70 4983 1 rfmdolocalop
0000000009AB0D80 4984 1 rfmdowrop1
0000000009AB0D90 4985 1 rfmdowrop2
0000000009AB0DA0 4986 1 rfmdowrop3
0000000009AB0DB0 4987 1 rfmdomonproperty1
0000000009AB0DC0 4988 1 rfmdomonproperty2
0000000009AB0DD0 4989 1 rfm_init_boot_te5
0000000009AB0DE0 4990 1 rfmdoremoteop1
0000000009AB0DF0 4991 1 rfmdoremoteop2
0000000009AB0E00 4992 1 rfmdodisable
0000000009AB0E10 4993 1 rfm_do_switchover1
0000000009AB0E20 4994 1 rfm_do_switchover2
0000000009AB0E30 4995 1 rfm_do_failover
0000000009AB0E40 4996 1 rfmtecb1
0000000009AB0E50 4997 1 rfmtecb2
0000000009AB0E60 4998 1 rfm_quiesce_site
0000000009AB0E70 4999 1 rfm_quiesce_instance
0000000009AB0E80 5000 1 rfm_enable_object
0000000009AB0E90 5001 1 rfmdsite
0000000009AB0EA0 5002 1 rfm_execute_task_fn1
0000000009AB0EB0 5003 1 rfm_execute_task_fn2
0000000009AB0EC0 5004 1 rfm_inst_phase_dispatch1
0000000009AB0ED0 5005 1 rfm_inst_phase_dispatch2
0000000009AB0EE0 5006 1 rfm_inst_phase_dispatch3
0000000009AB0EF0 5007 1 rfm_get_chief_lock
0000000009AB0F00 5008 1 rfm_release_chief_lock
0000000009AB0F10 5009 1 rfmhcadvphs
0000000009AB0F20 5010 1 rfm_do_client_hc
0000000009AB0F30 5011 1 rfm_execute_sprobe
0000000009AB0F40 5012 1 rfm_broker_cleanup
0000000009AB0F50 5013 1 rfm_init_dmon
0000000009AB0F60 5014 1 rfrm_set_param
0000000009AB0F70 5015 1 rfm_init_boot_te6
0000000009AB0F80 5016 1 rfm_phase_dispatch_sby1
0000000009AB0F90 5017 1 rfm_phase_dispatch_sby2
46 rows selected.
--//KSLLWNAM 對應的就是location.透過gV$LATCH_MISSES 定義修改一下增加indx如下:
/* Formatted on 2019/4/9 12:10:49 (QP5 v5.269.14213.34769) */
SELECT t1.inst_id inst_id
,t1.indx indx
,t1.ksllasnam PARENT_NAME
,t2.ksllwnam "WHERE"
,t1.kslnowtf NWFAIL_COUNT
,t1.kslsleep SLEEP_COUNT
,t1.kslwscwsl WTR_SLP_COUNT
,t1.kslwsclthg LONGHOLD_COUNT
,t2.ksllwnam LOCATION
FROM x$ksllw t2, x$kslwsc t1
WHERE t2.indx = t1.indx AND t1.ksllasnam LIKE 'DMON Work Queues Latch';
--//location 與where 對應的內容一樣.
INST_ID INDX PARENT_NAME WHERE NWFAIL_COUNT SLEEP_COUNT WTR_SLP_COUNT LONGHOLD_COUNT LOCATION
---------- ---------- ----------------------- ------------------------------ ------------ ----------- ------------- -------------- ------------------------------
1 4972 DMON Work Queues Latch rfifdrcxch 0 1 1 0 rfifdrcxch
1 4973 DMON Work Queues Latch rfifreqch 0 0 0 0 rfifreqch
1 4974 DMON Work Queues Latch rfm_do_hc 0 0 0 0 rfm_do_hc
1 4975 DMON Work Queues Latch rfm_init_boot_te1 0 0 0 0 rfm_init_boot_te1
1 4976 DMON Work Queues Latch rfm_init_boot_te2 0 0 0 0 rfm_init_boot_te2
1 4977 DMON Work Queues Latch rfm_init_boot_te3 0 0 0 0 rfm_init_boot_te3
1 4978 DMON Work Queues Latch rfm_init_boot_te4 0 0 0 0 rfm_init_boot_te4
1 4979 DMON Work Queues Latch rfm_free_te 0 0 0 0 rfm_free_te
1 4980 DMON Work Queues Latch rfm_setup_te 0 0 0 0 rfm_setup_te
1 4981 DMON Work Queues Latch rfmeadvphs 0 0 0 0 rfmeadvphs
1 4982 DMON Work Queues Latch rfmdophs 0 0 0 0 rfmdophs
1 4983 DMON Work Queues Latch rfmdolocalop 0 0 0 0 rfmdolocalop
1 4984 DMON Work Queues Latch rfmdowrop1 0 0 0 0 rfmdowrop1
1 4985 DMON Work Queues Latch rfmdowrop2 0 0 0 0 rfmdowrop2
1 4986 DMON Work Queues Latch rfmdowrop3 0 0 0 0 rfmdowrop3
1 4987 DMON Work Queues Latch rfmdomonproperty1 0 0 0 0 rfmdomonproperty1
1 4988 DMON Work Queues Latch rfmdomonproperty2 0 0 0 0 rfmdomonproperty2
1 4989 DMON Work Queues Latch rfm_init_boot_te5 0 0 0 0 rfm_init_boot_te5
1 4990 DMON Work Queues Latch rfmdoremoteop1 0 0 0 0 rfmdoremoteop1
1 4991 DMON Work Queues Latch rfmdoremoteop2 0 0 0 0 rfmdoremoteop2
1 4992 DMON Work Queues Latch rfmdodisable 0 0 0 0 rfmdodisable
1 4993 DMON Work Queues Latch rfm_do_switchover1 0 0 0 0 rfm_do_switchover1
1 4994 DMON Work Queues Latch rfm_do_switchover2 0 0 0 0 rfm_do_switchover2
1 4995 DMON Work Queues Latch rfm_do_failover 0 0 0 0 rfm_do_failover
1 4996 DMON Work Queues Latch rfmtecb1 0 0 0 0 rfmtecb1
1 4997 DMON Work Queues Latch rfmtecb2 0 0 0 0 rfmtecb2
1 4998 DMON Work Queues Latch rfm_quiesce_site 0 0 0 0 rfm_quiesce_site
1 4999 DMON Work Queues Latch rfm_quiesce_instance 0 0 0 0 rfm_quiesce_instance
1 5000 DMON Work Queues Latch rfm_enable_object 0 0 0 0 rfm_enable_object
1 5001 DMON Work Queues Latch rfmdsite 0 0 0 0 rfmdsite
1 5002 DMON Work Queues Latch rfm_execute_task_fn1 0 0 0 0 rfm_execute_task_fn1
1 5003 DMON Work Queues Latch rfm_execute_task_fn2 0 0 0 0 rfm_execute_task_fn2
1 5004 DMON Work Queues Latch rfm_inst_phase_dispatch1 0 0 0 0 rfm_inst_phase_dispatch1
1 5005 DMON Work Queues Latch rfm_inst_phase_dispatch2 0 0 0 0 rfm_inst_phase_dispatch2
1 5006 DMON Work Queues Latch rfm_inst_phase_dispatch3 0 0 0 0 rfm_inst_phase_dispatch3
1 5007 DMON Work Queues Latch rfm_get_chief_lock 0 0 0 0 rfm_get_chief_lock
1 5008 DMON Work Queues Latch rfm_release_chief_lock 0 0 0 0 rfm_release_chief_lock
1 5009 DMON Work Queues Latch rfmhcadvphs 0 0 0 0 rfmhcadvphs
1 5010 DMON Work Queues Latch rfm_do_client_hc 0 0 0 0 rfm_do_client_hc
1 5011 DMON Work Queues Latch rfm_execute_sprobe 0 0 0 0 rfm_execute_sprobe
1 5012 DMON Work Queues Latch rfm_broker_cleanup 0 0 0 0 rfm_broker_cleanup
1 5013 DMON Work Queues Latch rfm_init_dmon 0 0 0 0 rfm_init_dmon
1 5014 DMON Work Queues Latch rfrm_set_param 0 0 0 0 rfrm_set_param
1 5015 DMON Work Queues Latch rfm_init_boot_te6 0 0 0 0 rfm_init_boot_te6
1 5016 DMON Work Queues Latch rfm_phase_dispatch_sby1 0 0 0 0 rfm_phase_dispatch_sby1
1 5017 DMON Work Queues Latch rfm_phase_dispatch_sby2 0 0 0 0 rfm_phase_dispatch_sby2
46 rows selected.
3.where的取值:
--//3-where (X$KSLLW.INDX)
SYS@book> select * from X$KSLLW where indx between 4972 and 5017 ;
ADDR INDX INST_ID KSLLWNAM KSLLWLBL
---------------- ---------- ---------- ----------------------------- ----------------------------------
0000000009AB0CC0 4972 1 rfifdrcxch
0000000009AB0CD0 4973 1 rfifreqch
0000000009AB0CE0 4974 1 rfm_do_hc
0000000009AB0CF0 4975 1 rfm_init_boot_te1
0000000009AB0D00 4976 1 rfm_init_boot_te2
0000000009AB0D10 4977 1 rfm_init_boot_te3
0000000009AB0D20 4978 1 rfm_init_boot_te4
0000000009AB0D30 4979 1 rfm_free_te
0000000009AB0D40 4980 1 rfm_setup_te
0000000009AB0D50 4981 1 rfmeadvphs
0000000009AB0D60 4982 1 rfmdophs
0000000009AB0D70 4983 1 rfmdolocalop
0000000009AB0D80 4984 1 rfmdowrop1
0000000009AB0D90 4985 1 rfmdowrop2
0000000009AB0DA0 4986 1 rfmdowrop3
0000000009AB0DB0 4987 1 rfmdomonproperty1
0000000009AB0DC0 4988 1 rfmdomonproperty2
0000000009AB0DD0 4989 1 rfm_init_boot_te5
0000000009AB0DE0 4990 1 rfmdoremoteop1
0000000009AB0DF0 4991 1 rfmdoremoteop2
0000000009AB0E00 4992 1 rfmdodisable
0000000009AB0E10 4993 1 rfm_do_switchover1
0000000009AB0E20 4994 1 rfm_do_switchover2
0000000009AB0E30 4995 1 rfm_do_failover
0000000009AB0E40 4996 1 rfmtecb1
0000000009AB0E50 4997 1 rfmtecb2
0000000009AB0E60 4998 1 rfm_quiesce_site
0000000009AB0E70 4999 1 rfm_quiesce_instance
0000000009AB0E80 5000 1 rfm_enable_object
0000000009AB0E90 5001 1 rfmdsite
0000000009AB0EA0 5002 1 rfm_execute_task_fn1
0000000009AB0EB0 5003 1 rfm_execute_task_fn2
0000000009AB0EC0 5004 1 rfm_inst_phase_dispatch1
0000000009AB0ED0 5005 1 rfm_inst_phase_dispatch2
0000000009AB0EE0 5006 1 rfm_inst_phase_dispatch3
0000000009AB0EF0 5007 1 rfm_get_chief_lock
0000000009AB0F00 5008 1 rfm_release_chief_lock
0000000009AB0F10 5009 1 rfmhcadvphs
0000000009AB0F20 5010 1 rfm_do_client_hc
0000000009AB0F30 5011 1 rfm_execute_sprobe
0000000009AB0F40 5012 1 rfm_broker_cleanup
0000000009AB0F50 5013 1 rfm_init_dmon
0000000009AB0F60 5014 1 rfrm_set_param
0000000009AB0F70 5015 1 rfm_init_boot_te6
0000000009AB0F80 5016 1 rfm_phase_dispatch_sby1
0000000009AB0F90 5017 1 rfm_phase_dispatch_sby2
46 rows selected.
--//感覺不對,不大可能還是indx.
--//連結
Also, these strings present as "Location from where latch is held" in process state object dumps. For example, look
at the process holding cache buffers chains latch:
--//此外,這些字串在程式狀態物件轉儲中以"持有鎖的位置"的形式出現。例如,檢視儲存緩衝區鏈鎖存的程式:
PROCESS 299:
----------------------------------------
SO: 0x2d93be720, type: 2, owner: (nil), flag: INIT/-/-/0x00
(process) Oracle pid=299, calls cur/top: 0x2e9028a38/0x2e9028a38, flag: (0)
…
(latch info) wait_event=0 bits=2
holding 2dee1ac50 Child cache buffers chains level=1 child#=124200
Location from where latch is held: kcbgtcr: fast path:
Context saved from call: 39022946
…
"Why" meaning for some of "where" may be guessed from ksllwlbl column of x$ksllw. From the above listing one can
conclude that "why" contain the SGA chunk address for shared pool latch and the session address for session idle bit
latch correspondingly.
--//從x$ksllw的ksllwlbl列中可以猜到"why"的意思是"WHERE"。從上面的列表中可以得出結論,"why"包含用於共享池閂鎖的SGA塊地址
--//,以及相應地包含會話空閒位閂鎖的會話地址。
--//KSLLWLBL列顯示的是空?視乎要按照上下文猜測why.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/267265/viewspace-2640890/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- [20190409]latch get 引數where and why測試.txt
- http獲取get引數過濾HTTP
- GET請求的引數丟失
- SQL WHERE IN引數化編譯寫法簡單示例SQL編譯
- java傳送get請求帶引數Java
- RestTemplate exchange GET POST請求傳引數DEMOREST
- SpringBoot Get 請求接收 Date 型別引數Spring Boot型別
- GET請求引數為中文時亂碼分析
- drf serializer 字首 get 是什麼? 如何傳遞引數?
- 解決ajax get post方式提交中文引數亂碼問題
- $.ajax(),$.get(),$.post()的區別,以及一些引數注意規則
- where to start, from where the end
- zblog獲取GET/POST等值函式“GetVars”引數和使用方法介紹函式
- mutex,latch,lock,enqueue hash chains latch基礎概念MutexENQAI
- axios get請求如果遇到引數有陣列的情況怎麼解決iOS陣列
- 什麼是請求引數、表單引數、url引數、header引數、Cookie引數?一文講懂HeaderCookie
- nGrinder中快速編寫groovy指令碼03-在GET請求中傳送引數指令碼
- Vue + Spring Boot——axios使用GET以引數的方式傳遞物件到SpringMVC解決方案VueSpring BootiOS物件SpringMVC
- ORACLE LOCK,LATCH,PINOracle
- Oracle Latch 說明Oracle
- hiccup和Latch off
- python疑問5:位置引數,預設引數,可變引數,關鍵字引數,命名關鍵字引數區別Python
- PHP中GET與POST變數PHP變數
- [20190319]shared pool latch與library cache latch的簡單探究.txt
- [20210512]shared pool latch與library cache latch的簡單探究.txt
- MyDAL – .Where() & .And() & .Or() 使用
- having和where
- Windows Powershell & 環境變數;Powershell where命令無輸出Windows變數
- 12.MyBatis學習--對映檔案_引數處理_單個引數&多個引數&命名引數MyBatis
- latch等待事件彙總事件
- Latch free等待事件(轉)事件
- Systematic Latch Contention Troubleshooting in OracleOracle
- ubuntu18 沒有 where 命令 -bash: where: command not foundUbuntu
- Java對比有引數和無引數Java
- 引數配置
- python引數Python
- 超引數
- mt引數