Trouble shooting latch: cache buffers chains
SQL> select name, parameter1, parameter2, parameter3 from v$event_name where name like '&event';
Enter value for event: latch: cache buffers chains
old 1: select name, parameter1, parameter2, parameter3 from v$event_name where name like '&event'
new 1: select name, parameter1, parameter2, parameter3 from v$event_name where name like 'latch: cache buffers chains'
NAME PARAMETER1 PARAMETER2 PARAMETER3
----------------------------------- --------------- --------------- ---------------
latch: cache buffers chains address number tries
Troubleshooting Steps:故障排除步驟
"latch: cache buffers chains" contention is typically encountered because SQL statements read more buffers than they need to and multiple sessions are waiting to read the same block.
通常會遇到"latch:cache buffers chains"爭用,因為SQL語句讀取的緩衝區比他們需要的多,且多個會話正在等待讀取同一個塊。
If you have high contention, you need to look at the statements that perform the most buffer gets and then look at their access paths to determine whether these are performing as efficiently as you would like.
如果您的爭用率很高,則需要檢視執行最多緩衝區的語句,然後檢視其訪問路徑,以確定這些語句的執行效率是否符合您的要求。
Typical solutions are:
Look for SQL that accesses the blocks in question and determine if the repeated reads are necessary. This may be within a single session or across multiple sessions.查詢訪問相關塊的SQL,並確定重複讀取是否必要。 這可能在單個會話內或跨多個會話。
Check for suboptimal SQL (this is the most common cause of the events) - look at the execution plan for the SQL being run and try to reduce the gets per executions which will minimize the number of blocks being accessed and therefore reduce the chances of multiple sessions contending for the same block.檢查次優SQL(這是事件的最常見原因) - 檢視正在執行的SQL的執行計劃,並嘗試減少每次執行的獲取次數,這將最大限度地減少正在訪問的塊的數量,從而減少多次出現的機會 競爭同一塊的會話。
If you can identify a poor SQL and have identified a better plan, you can direct the optimizer to use this plan using the following article:如果您能識別出一個糟糕的SQL,並確定了一個更好的計劃,那麼可以使用下面的文章來指導最佳化器使用這個計劃
思路一:
查詢awr的top sql:
Top 5 Timed Events
SQL ordered by Gets
Segments by Logical Reads
思路二:
熱點塊爭用
1)查詢資料庫是否存在latch的爭用
select sid,event,p1text,p1raw from v$session_wait where event='latch: cache buffers chains';
2)下面查詢查出Top 5 的爭用的latch address。
select * from( select CHILD#,ADDR,GETS ,MISSES,SLEEPS from v$latch_children where name = 'cache buffers chains' and misses>0 and sleeps>0 order by 5 desc, 1, 2, 3) where rownum<6;
3)然後利用下面查詢找出Hot block。
select /*+ RULE */
e.owner || '.' || e.segment_name segment_name,
e.extent_id extent#,
x.dbablk - e.block_id + 1 block#,
x.tch, /* sometimes tch=0,we need to see tim */
x.tim,
l.child#
from v$latch_children l, x$bh x, dba_extents e
where x.hladdr = '&ADDR'
and e.file_id = x.file#
and x.hladdr = l.addr
and x.dbablk between e.block_id and e.block_id + e.blocks - 1
order by x.tch desc;
Enter value for event: latch: cache buffers chains
old 1: select name, parameter1, parameter2, parameter3 from v$event_name where name like '&event'
new 1: select name, parameter1, parameter2, parameter3 from v$event_name where name like 'latch: cache buffers chains'
NAME PARAMETER1 PARAMETER2 PARAMETER3
----------------------------------- --------------- --------------- ---------------
latch: cache buffers chains address number tries
Troubleshooting Steps:故障排除步驟
"latch: cache buffers chains" contention is typically encountered because SQL statements read more buffers than they need to and multiple sessions are waiting to read the same block.
通常會遇到"latch:cache buffers chains"爭用,因為SQL語句讀取的緩衝區比他們需要的多,且多個會話正在等待讀取同一個塊。
If you have high contention, you need to look at the statements that perform the most buffer gets and then look at their access paths to determine whether these are performing as efficiently as you would like.
如果您的爭用率很高,則需要檢視執行最多緩衝區的語句,然後檢視其訪問路徑,以確定這些語句的執行效率是否符合您的要求。
Typical solutions are:
Look for SQL that accesses the blocks in question and determine if the repeated reads are necessary. This may be within a single session or across multiple sessions.查詢訪問相關塊的SQL,並確定重複讀取是否必要。 這可能在單個會話內或跨多個會話。
Check for suboptimal SQL (this is the most common cause of the events) - look at the execution plan for the SQL being run and try to reduce the gets per executions which will minimize the number of blocks being accessed and therefore reduce the chances of multiple sessions contending for the same block.檢查次優SQL(這是事件的最常見原因) - 檢視正在執行的SQL的執行計劃,並嘗試減少每次執行的獲取次數,這將最大限度地減少正在訪問的塊的數量,從而減少多次出現的機會 競爭同一塊的會話。
If you can identify a poor SQL and have identified a better plan, you can direct the optimizer to use this plan using the following article:如果您能識別出一個糟糕的SQL,並確定了一個更好的計劃,那麼可以使用下面的文章來指導最佳化器使用這個計劃
思路一:
查詢awr的top sql:
Top 5 Timed Events
SQL ordered by Gets
Segments by Logical Reads
思路二:
熱點塊爭用
1)查詢資料庫是否存在latch的爭用
select sid,event,p1text,p1raw from v$session_wait where event='latch: cache buffers chains';
2)下面查詢查出Top 5 的爭用的latch address。
select * from( select CHILD#,ADDR,GETS ,MISSES,SLEEPS from v$latch_children where name = 'cache buffers chains' and misses>0 and sleeps>0 order by 5 desc, 1, 2, 3) where rownum<6;
3)然後利用下面查詢找出Hot block。
select /*+ RULE */
e.owner || '.' || e.segment_name segment_name,
e.extent_id extent#,
x.dbablk - e.block_id + 1 block#,
x.tch, /* sometimes tch=0,we need to see tim */
x.tim,
l.child#
from v$latch_children l, x$bh x, dba_extents e
where x.hladdr = '&ADDR'
and e.file_id = x.file#
and x.hladdr = l.addr
and x.dbablk between e.block_id and e.block_id + e.blocks - 1
order by x.tch desc;
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/31397003/viewspace-2149606/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- latch: cache buffers chainsAI
- latch:cache buffers chains案例AI
- 深入理解latch: cache buffers chainsAI
- ORACLE等待事件latch: cache buffers chainsOracle事件AI
- 等待事件_cache_buffers_chains_latch事件AI
- latch:cache buffers chains解決步驟AI
- latch:cache buffers chains的優化思路AI優化
- cache buffers chains and cache buffers lru chainsAI
- buffer cache實驗6-latch:cache buffers lru chainsAI
- latch:cache buffers chains的最佳化思路AI
- latch: cache buffers chains---AWR實戰分析AI
- latch: cache buffers chains故障處理總結(轉載)AI
- 解決一例latch:cache buffers chains小記AI
- cache buffers chains vs cache buffers lru chainAI
- 一次latch cache buffers chains問題的處理AI
- 處理 latch_cache_buffers_chains等待事件一例AI事件
- Latch: cache buffer chains (%)AI
- cache buffers LRU chain latchAI
- latch free(cache buffers chain)AI
- buffer busy waits, latch cache buffers chains, read by other session區別AISession
- latch: cache buffers chains-熱塊的簡單模擬實驗AI
- 用於排查cache buffers chainsAI
- Cache Buffers chains,存在共享模式?AI模式
- Bug 3797171 cache buffers chains latch contention increased in 10g-3797171.8AI
- cbc latch或cache buffer chains latch系列一AI
- buffer cache實驗5-latch:cache buffers chainAI
- trouble shooting案例分享
- 等待事件_cache_buffers_lru_chain_latch事件AI
- 模擬cache buffers chains與library cache pin等待事件AI事件
- 熱點塊競爭和解決--cache buffers chainsAI
- DNS查詢 and trouble-shooting caseDNS
- Trouble shooting for Pin S wait on XAI
- 0821Cache Buffers chains與共享模式疑問4AI模式
- 0330Cache Buffers chains與共享模式疑問AI模式
- 0330Cache Buffers chains與共享模式疑問2AI模式
- 1104Cache Buffers chains與共享模式疑問3AI模式
- 1104Cache Buffers chains與共享模式疑問4AI模式
- 客戶資料庫出現大量cache buffer chains latch資料庫AI