cache buffers lru chain
cache buffers lru chain閂鎖競爭與解決
當使用者程式需要讀資料到buffer cache時,或cache buffer根據lru演算法進行管理時,就不可避免地要掃描
lru list獲取可用buffer或更改buffer的狀態,我們知道,oracle的buffer cache是共享記憶體,可以為眾多
併發程式併發訪問,所以在搜尋的過程中必須獲取latch(latch是oracle的一種序列鎖機制,用於保護共享記憶體結構)
,鎖定記憶體結構,防止併發訪問損壞記憶體中的資料.
這個用於鎖定lru的latch就是經常見到的cache buffers lru chain.
SQL> select addr,latch#,name,gets,misses,immediate_gets,immediate_misses
2 from v$latch where name='cache buffers lru chain';
ADDR LATCH# NAME GETS MISSES IMMEDIATE_GETS IMMEDIATE_MISSES
---------------- ---------- ----------------------------- ---------- ---------- -------------- ----------------
C00000000BE23B10 117 cache buffers lru chain 2601887 8060 106765296 597096
cache buffers lru chain latch存在多個子latch,它的數量受隱含引數_db_block_lru_latches控制
SQL> select x.ksppinm name,y.ksppstvl value,x.ksppdesc describ
2 from sys.x$ksppi x,sys.x$ksppcv y
3 where x.inst_id=USERENV('Instance')
4 and y.inst_id=USERENV('Instance')
5 and x.indx=y.indx
6 and x.ksppinm like '%_db_block_lru_latches%';
NAME VALUE DESCRIB
---------------------------- ------------- -------------------------------
_db_block_lru_latches 32 number of lru latches
可以從v$latch_children檢視檢視當前各子latch使用的情況:
SQL> select addr,latch#,name,gets,misses,immediate_gets,immediate_misses
2 from v$latch_children where name='cache buffers lru chain';
ADDR LATCH# NAME GETS MISSES IMMEDIATE_GETS IMMEDIATE_MISSES
---------------- ---------- ------------------------- -------------- ---------- -------------- ----------------
C00000047AB14E80 117 cache buffers lru chain 68 0 0 0
C00000047AB14928 117 cache buffers lru chain 68 0 0 0
C00000047AB143D0 117 cache buffers lru chain 68 0 0 0
C00000047AB13E78 117 cache buffers lru chain 68 0 0 0
C00000047AB13920 117 cache buffers lru chain 68 0 0 0
C00000047AB133C8 117 cache buffers lru chain 68 0 0 0
C00000047AB12E70 117 cache buffers lru chain 68 0 0 0
C00000047AB12918 117 cache buffers lru chain 68 0 0 0
C00000047AB123C0 117 cache buffers lru chain 68 0 0 0
C00000047AB11E68 117 cache buffers lru chain 68 0 0 0
C00000047AB11910 117 cache buffers lru chain 68 0 0 0
C00000047AB113B8 117 cache buffers lru chain 68 0 0 0
C00000047AB10E60 117 cache buffers lru chain 68 0 0 0
C00000047AB10908 117 cache buffers lru chain 68 0 0 0
C00000047AB103B0 117 cache buffers lru chain 68 0 0 0
C00000047AB0FE58 117 cache buffers lru chain 68 0 0 0
C00000047AB0F900 117 cache buffers lru chain 68 0 0 0
C00000047AB0F3A8 117 cache buffers lru chain 68 0 0 0
C00000047AB0EE50 117 cache buffers lru chain 68 0 0 0
C00000047AB0E8F8 117 cache buffers lru chain 68 0 0 0
ADDR LATCH# NAME GETS MISSES IMMEDIATE_GETS IMMEDIATE_MISSES
---------------- ---------- ------------------------- -------------- ---------- -------------- ----------------
C00000047AB0E3A0 117 cache buffers lru chain 658582 2096 27333396 148252
C00000047AB0DE48 117 cache buffers lru chain 659346 2092 27372470 148770
C00000047AB0D8F0 117 cache buffers lru chain 660582 2168 27373352 148620
C00000047AB0D398 117 cache buffers lru chain 657057 1824 27227832 152743
C00000047AB0CE40 117 cache buffers lru chain 68 0 0 0
C00000047AB0C8E8 117 cache buffers lru chain 68 0 0 0
C00000047AB0C390 117 cache buffers lru chain 68 0 0 0
C00000047AB0BE38 117 cache buffers lru chain 68 0 0 0
C00000047AB0B8E0 117 cache buffers lru chain 70 0 2 0
C00000047AB0B388 117 cache buffers lru chain 70 0 3 0
C00000047AB0AE30 117 cache buffers lru chain 70 0 3 0
C00000047AB0A8D8 117 cache buffers lru chain 70 0 2 0
32 rows selected
如果該latch競爭激烈,通常有如下方法可以採用.
適當的增大buffer cache,這樣可以減少讀資料到buffer cache的機會,減少掃描lru list的競爭
可以適當增加lru latch的數量,修改_db_block_lru_latches引數可以實現,但是該引數通常來說
是足夠的,除非在oracle support的建議下或確知是該引數帶來的影響,否則不推薦修改
透過多緩衝池技術,可以減少不希望的資料老化和全表掃描等操作對於default池的衝擊,
從而可以減少競爭
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/26015009/viewspace-751839/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- cache buffers LRU chain latchAI
- cache buffers chains vs cache buffers lru chainAI
- 等待事件_cache_buffers_lru_chain_latch事件AI
- cache buffers chains and cache buffers lru chainsAI
- latch free(cache buffers chain)AI
- buffer cache實驗5-latch:cache buffers chainAI
- cache buffer lru chain latch等待事件AI事件
- buffer cache實驗6-latch:cache buffers lru chainsAI
- oracle實驗記錄(buffer_cache分析(3)cbc lru chain latch)OracleAI
- cache buffer chainAI
- latch: cache buffers chainsAI
- 關於cache_buffer_lru_chain的疑問,知道的給小弟解答一下。AI
- latch:cache buffers chains案例AI
- Leetcode LRU CacheLeetCode
- [LeetCode] LRU CacheLeetCode
- buffer cache部分原理(LRU)
- 等待模擬-cache buffer chainAI
- Cache Buffer Chain Latch等待事件AI事件
- 用於排查cache buffers chainsAI
- Cache Buffers chains,存在共享模式?AI模式
- Leetcode-LRU CacheLeetCode
- LRU Cache leetcode javaLeetCodeJava
- cr塊和latch buffer cache chainAI
- cache buffer chain latch只讀共享?AI
- 深入理解latch: cache buffers chainsAI
- Trouble shooting latch: cache buffers chainsAI
- ORACLE等待事件latch: cache buffers chainsOracle事件AI
- 等待事件_cache_buffers_chains_latch事件AI
- LRU cache原理及go實現Go
- LeetCode 146 [LRU Cache]LeetCode
- leveldb程式碼精讀 lru cache
- latch free 中 cache buffer chain 的整理AI
- 模擬cache buffers chains與library cache pin等待事件AI事件
- latch:cache buffers chains解決步驟AI
- latch:cache buffers chains的優化思路AI優化
- LRU cache快取簡單實現快取
- 動手實現一個 LRU cache
- 用 Go 實現一個 LRU cacheGo