[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
- nodejs接收get引數和post引數NodeJS
- Retrofit 動態引數(非固定引數、非必須引數)(Get、Post請求)
- http獲取get引數過濾HTTP
- GET請求的引數丟失
- SQL WHERE IN引數化編譯寫法簡單示例SQL編譯
- Java進行post和get傳引數Java
- java傳送get請求帶引數Java
- 解決latch free問題的資料庫引數調整資料庫
- GET請求引數為中文時亂碼分析
- golang web開發獲取get、post、cookie引數GolangWebCookie
- request的get和post引數亂碼問題
- PHP接收GET中文引數亂碼深入研究PHP
- SpringBoot Get 請求接收 Date 型別引數Spring Boot型別
- drf serializer 字首 get 是什麼? 如何傳遞引數?
- C# 之HTTP請求get,post帶重試引數C#HTTP
- 引數傳遞中編碼問題(Get/Post 方式)(一)
- 引數傳遞中編碼問題(Get/Post 方式)(二)
- CI框架獲取post和get引數_CodeIgniter心得框架
- 使用AFNetworking進行引數形式的GET請求
- 解決ajax get post方式提交中文引數亂碼問題
- YII GET方式引數重複/疊加的解決辦法
- DES加密後get獲取url引數無法解密問題加密解密
- Get返回頁數
- $.ajax(),$.get(),$.post()的區別,以及一些引數注意規則
- exp\imp 遇到作業系統轉移字元問題(比如query引數裡的where)作業系統字元
- kettle 引數——變數引數和常量引數變數
- dbms_metadata包中的get_ddl函式詳細引數函式
- MERGE新特性(UPDATE WHERE,DELETE WHERE,INSERT WHERE)delete
- Oracle Latch及latch衝突Oracle
- iframe利用get方式傳遞中文引數會出現亂碼解決方案
- 第13周-閱讀專案2-有關引數的get函式函式
- Oracle引數-隱藏引數Oracle
- zblog獲取GET/POST等值函式“GetVars”引數和使用方法介紹函式
- 什麼是請求引數、表單引數、url引數、header引數、Cookie引數?一文講懂HeaderCookie
- Swift語言中為外部引數設定預設值可變引數常量引數變數引數輸入輸出引數Swift變數
- c# 方法引數_值引數C#
- c# 方法引數_引用引數C#