如何診斷等待事件 enq: HW - contention
如何診斷等待事件
SQL>select event,p1,p2,p3 from v$session_wait;
EVENT P1 P2 P3
---------------------- -------- ------- ----------
enq: HW - contention 1213661190 4 17005691
透過P3進行DBMS_UTILITY轉換可以獲知發生爭用的檔案和block
SQL> select DBMS_UTILITY.DATA_BLOCK_ADDRESS_FILE(17005691) FILE#,
2 DBMS_UTILITY.DATA_BLOCK_ADDRESS_BLOCK(17005691) BLOCK#
3 from dual;
FILE# BLOCK#
---------- ----------
4 228475
進而透過file#和block#定位物件
SQL> select owner, segment_type, segment_name
2 from dba_extents
3 where file_id = 4
4 and 228475 between block_id and block_id + blocks - 1;
OWNER SEGMENT_TYPE SEGMENT_NAME
--------------- --------------- ------------------------------
SCOTT LOBSEGMENT EMP_DATA_LOB
我們知道enqueue鎖的p2,p3值與v$lock的id1,id2值相同,同樣透過id2,也可以知道發生爭用的檔案和block
SQL> select DBMS_UTILITY.DATA_BLOCK_ADDRESS_FILE(ID2) FILE#,
2 DBMS_UTILITY.DATA_BLOCK_ADDRESS_BLOCK(ID2) BLOCK#
3 from v$lock
4 where type = 'HW';
FILE# BLOCK#
---------- ----------
4 228475
透過p1值可以知道鎖型別和模式
SQL> select chr(bitand(1213661190,-16777216)/16777215)||
2 chr(bitand(1213661190,16711680)/65535) "Lock",to_char( bitand(1213661190, 65535) ) "Mode" from dual;
Lock Mode
---------- ----------
HW 6
1. When using Automatic Segment Space Management (ASSM)
a) As temporary workaround, manually add extra space to the LOB segment
ALTER TABLE
MODIFY LOB () (allocate extent (size ));
OR
b) It may related Bug 6376915.
Refer to Note 6376915.8 "Bug 6376915 HW enqueue contention for ASSM LOB segments"
In 10.2.0.4 or above, this fix has been included, and can be enabled by setting event 44951 to a value
between 1 and 1024. A higher value would be more beneficial in reducing contention.
EVENT="44951 TRACE NAME CONTEXT FOREVER, LEVEL < 1 - 1024 >"
OR
c) Consider partitioning the LOB in a manner that will evenly distribute concurrent DML across multiple partitions
2. When using Manual Segment Space Management(MSSM)
a) As temporary workaround, manually add extra space to the LOB segment
ALTER TABLE
MODIFY LOB () (allocate extent (size ));
OR
b) Consider partitioning the LOB in a manner that will evenly distribute concurrent DML across multiple partitions
SQL>select event,p1,p2,p3 from v$session_wait;
EVENT P1 P2 P3
---------------------- -------- ------- ----------
enq: HW - contention 1213661190 4 17005691
透過P3進行DBMS_UTILITY轉換可以獲知發生爭用的檔案和block
SQL> select DBMS_UTILITY.DATA_BLOCK_ADDRESS_FILE(17005691) FILE#,
2 DBMS_UTILITY.DATA_BLOCK_ADDRESS_BLOCK(17005691) BLOCK#
3 from dual;
FILE# BLOCK#
---------- ----------
4 228475
進而透過file#和block#定位物件
SQL> select owner, segment_type, segment_name
2 from dba_extents
3 where file_id = 4
4 and 228475 between block_id and block_id + blocks - 1;
OWNER SEGMENT_TYPE SEGMENT_NAME
--------------- --------------- ------------------------------
SCOTT LOBSEGMENT EMP_DATA_LOB
我們知道enqueue鎖的p2,p3值與v$lock的id1,id2值相同,同樣透過id2,也可以知道發生爭用的檔案和block
SQL> select DBMS_UTILITY.DATA_BLOCK_ADDRESS_FILE(ID2) FILE#,
2 DBMS_UTILITY.DATA_BLOCK_ADDRESS_BLOCK(ID2) BLOCK#
3 from v$lock
4 where type = 'HW';
FILE# BLOCK#
---------- ----------
4 228475
透過p1值可以知道鎖型別和模式
SQL> select chr(bitand(1213661190,-16777216)/16777215)||
2 chr(bitand(1213661190,16711680)/65535) "Lock",to_char( bitand(1213661190, 65535) ) "Mode" from dual;
Lock Mode
---------- ----------
HW 6
1. When using Automatic Segment Space Management (ASSM)
a) As temporary workaround, manually add extra space to the LOB segment
ALTER TABLE
MODIFY LOB (
OR
b) It may related Bug 6376915.
Refer to Note 6376915.8 "Bug 6376915 HW enqueue contention for ASSM LOB segments"
In 10.2.0.4 or above, this fix has been included, and can be enabled by setting event 44951 to a value
between 1 and 1024. A higher value would be more beneficial in reducing contention.
EVENT="44951 TRACE NAME CONTEXT FOREVER, LEVEL < 1 - 1024 >"
OR
c) Consider partitioning the LOB in a manner that will evenly distribute concurrent DML across multiple partitions
2. When using Manual Segment Space Management(MSSM)
a) As temporary workaround, manually add extra space to the LOB segment
ALTER TABLE
MODIFY LOB (
OR
b) Consider partitioning the LOB in a manner that will evenly distribute concurrent DML across multiple partitions
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/7199859/viewspace-1174629/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 等待事件之enq: HW - contention事件ENQ
- ORACLE 如何診斷高水位爭用(enq: HW – contention)OracleENQ
- enq: HW - contention診斷及解決過程ENQ
- [20161208]等待事件enq: HW - contention事件ENQ
- [20140311]等待事件enq HW - contention事件ENQ
- enq: HW - contentionENQ
- enq: WF - contention等待事件ENQ事件
- enq: CF - contention 等待事件ENQ事件
- enq: TS - contention 等待事件ENQ事件
- 大量insert引起的enq: HW - contention等待ENQ
- enq:TM-contention事件等待ENQ事件
- 消除 enq: DX - contention 等待事件ENQ事件
- zt_Oracle enq: TX contention 和 enq: TM contention 等待事件OracleENQ事件
- Oracle等待事件之enq: TM – contentionOracle事件ENQ
- 等待事件enq: TX - row lock contention事件ENQ
- oracle等待事件之enq: CF – contentionOracle事件ENQ
- 【等待事件】-enq: TX - row lock contention事件ENQ
- 索引分裂造成的index contention等待事件的診斷索引Index事件
- 故障排除 | enq:TX - index contention等待事件ENQIndex事件
- 等待事件enq TX row lock contention分析事件ENQ
- 【效能調整】等待事件 enq: SQ - contention事件ENQ
- 事務上的等待事件 —— enq: UL - contention事件ENQ
- enq: SQ - contention 等待事件處理辦法ENQ事件
- enq: TX - row lock contention等待事件處理ENQ事件
- enq: HW - contention 問題的處理ENQ
- enq: TX - index contention等待ENQIndex
- 【恩墨學院】經典故障分析 - ASSM引發的索引爭用與 enq HW -contention 等待事件SSM索引ENQ事件
- 等待事件快速定位診斷事件
- 等待事件效能診斷方法事件
- oracle 11.2.0.4 rac叢集等待事件enq: TM - contentionOracle事件ENQ
- enq: TM - contention TM 等待事件的原因及模擬ENQ事件
- [20220518]enq FU - contention等待事件.txtENQ事件
- 基於等待事件的效能診斷事件
- 'enq HW - contention' For Busy LOB Segment (文件 ID 740075.1)ENQ
- 關於HW-contention等待的處理
- 使用oradebug dump processstate 來診斷enq: TX - row lock contentionENQ
- How To Analyze the Wait Statistic: 'enq: HW - contention' (文件 ID 419348.1)AIENQ
- 基於等待事件的效能診斷(轉)事件