Analyzing 'enq: HW - contention' Wait Event (Doc ID 740075.1)
Analyzing 'enq: HW - contention' Wait Event (Doc ID 740075.1)
In this Document
| Symptoms |
| Cause |
| Solution |
| References |
APPLIES TO:
Oracle Database Cloud Schema Service - Version N/A and later
Oracle Database Exadata Cloud Machine - Version N/A and later
Oracle Cloud Infrastructure - Database Service - Version N/A and later
Oracle Database Backup Service - Version N/A and later
Oracle Database Exadata Express Cloud Service - Version N/A and later
Information in this document applies to any platform.
***Checked for relevance on 29-Aug-2016***
SYMPTOMS
1. There is a performance slow down with a large number of waits for 'enq HW - contention'.
2. ASH Reports shows the wait event 'enq HW - contention' which includes SQL with LOB Objects.
CAUSE
The HW enqueue is used to manage the allocation of space beyond the high water mark of a segment. The high water mark of a segment is the boundary between used and unused space in that segment. If contention is occurring for "enq: HW - contention" it is possible that automatic extension is occuring to allow the extra data to be stored since the High Water Mark has been reached. Frequent allocation of extents, reclaiming chunks, and sometimes poor I/O performance may be causing contention for the LOB segments high water mark.
SOLUTION
How To Analyze the Wait Statistic: 'enq: HW - contention'
Given the following situation. This information can be retrieved from a ADDM, ASH report or v$session_wait query:
| Event | % Wait Time | P1 Parameter | P1 Value | P2 Parameter | P2 Value | Parameter 3 | P3 Value |
|---|---|---|---|---|---|---|---|
| enq: HW - contention | 62,81 | name|mode | 1213661190 | table space | 4 | # block | 17005691 |
1. Determine the correct file and block number:
select DBMS_UTILITY.DATA_BLOCK_ADDRESS_FILE(17005691) FILE#,
DBMS_UTILITY.DATA_BLOCK_ADDRESS_BLOCK(17005691) BLOCK#
from dual;FILE# BLOCK#
---------- ----------
4 228475For bigfile tablespaces, do not use DBMS_UTILITY.DATA_BLOCK_ADDRESS_FILE, or you will get wrong results.
Reference: https://docs.oracle.com/cd/E18283_01/appdev.112/e16760/d_util.htm#i1002531
In such a case, just use the tablespace# and assume p3 is the block number (there is no relative file number).
2. Determine the object to which this block belongs to
select owner, segment_type, segment_name
from dba_extents
where file_id = 4
and 228475 between block_id and block_id + blocks - 1 and tablespace_name = (select name from ts$ where ts#= <parameter2.tablespace#>);OWNER SEGMENT_TYPE SEGMENT_NAME
--------------- --------------- ------------------------------
SCOTT LOBSEGMENT EMP_DATA_LOB
Additionally, if the lock contention is currrently observed, we can find out the underlying segment using the following query:
select DBMS_UTILITY.DATA_BLOCK_ADDRESS_FILE(ID2) FILE#,
DBMS_UTILITY.DATA_BLOCK_ADDRESS_BLOCK(ID2) BLOCK#
from v$lock
where type = 'HW';
As the 'enq HW - contention' may be caused by a number of different reasons, there are also several possible different solutions to alleviate or reduce contention.
Things to check are:-
1. Ensure that your lob segment is not frequently extending.
2. Check I/O performance.
3. A table containing a very busy lob segment may need partitioning in a manner that will evenly distribute concurrent DML across multiple partitions.
4. Frequent lob space/chunk reclaimation can also cause 'enq HW - contention'
In the case of point 4. there are a couple of options that may be able to be employed to provide either temporary relief or a workaround for the problem
a. Manually adding extra space to the LOB segment can alleviate the issue by allocating more free space to the lob segment to chunk reclaimation does not need to take place, until the free space is again used up
ALTER TABLE <lob_table>
MODIFY LOB (<column_name>) (allocate extent (size <extent size>));
** The following ALERT should be READ before manually allocating space to a LOB Segment
- NOTE 1229669.1 Bug 8198906 - Segment header corruption if extent allocation operation is interrupted
b. Using the shrink space command or dbms_redefinition process (for SECUREFILE LOBS) can be used to free up any reclaimable space.
ALTER TABLE test_lob MODIFY LOB (image) (SHRINK SPACE);
** The following documents should be READ before performing a LOB Shrink Operations
- Bug 5636728 - LOB corruption / ORA-1555 when reading LOBs after a SHRINK operation (Doc ID 5636728.8)
- Bug 5768710 - ALTER TABLE SHRINK slow with LOB (Doc ID 5768710.8)
c. When using Automatic Segment Space Management (ASSM), and the fix for Bug 6376915 has been applied in your database (Included in 10.2.0.4 +) it is possible to adjust the number of chunks that are cleaned up
when the chunk cleanup operation is required.
This can be enabled by setting event 44951 to a value between 1 and 1024 (default is 1). With the value between 1 and 1024 setting the number of chunks to be cleaned up each time a chunk reclaimation operation occurs. This can therefore reduce the number of requests for the High Watermark Enqueue.
EVENT="44951 TRACE NAME CONTEXT FOREVER, LEVEL < 1 - 1024 >"
~OR~
SQL> Alter system set events '44951 TRACE NAME CONTEXT FOREVER, LEVEL 1024';
Refer to NOTE 6376915.8 "Bug 6376915 HW enqueue contention for ASSM LOB segments"
With Manual Segment Space Management, this value cannot be altered and is fixed at 128.
REFERENCES
NOTE:9801919.8 - Bug 9801919 - "enq: HW - contention" against segments that add an extent frequently during high concurrency
NOTE:2098543.1 - WAITEVENT: "enq: HW - contention" Reference Note
BUG:8198906 - ORA-00600: [5467] BY SMON WHILE RECOVERING TRANSACTION
BUG:6376915 - ENQ: HW - CONTENTION WITH LOB SEGMENTS
BUG:9711859 - ORA-600 [KTSPTRN_FIX-EXTMAP] DURING EXTENT ALLOCATION
NOTE:837883.1 - LOB HWM CONTENTION :Using AWR Reports to Identify the Problem; Confirm and Verify the Fix
NOTE:6376915.8 - Bug 6376915 - HW enqueue contention for ASSM LOB segments
NOTE:8198906.8 - Bug 8198906 - OERI [kddummy_blkchk] / OERI [5467] for an aborted transaction of allocating extents
NOTE:5768710.8 - Bug 5768710 - ALTER TABLE SHRINK slow with LOB
NOTE:130814.1 - How To Move LOB Data To Another Tablespace
NOTE:365156.1 - Rebuilding LOB freepools
NOTE:1394613.1 - How to Shrink a Securefile LOB Using Online Redefinition (DBMS_REDEFINITION)?
NOTE:1229669.1 - ALERT: Bug 8198906 - Segment header corruption if extent allocation operation is interrupted
NOTE:5636728.8 - Bug 5636728 - LOB corruption / ORA-1555 when reading LOBs after a SHRINK operation
NOTE:9711859.8 - Bug 9711859 - ORA-600 [ktsptrn_fix-extmap] / ORA-600 [kdblkcheckerror] during extent allocation caused by bug 8198906
Analyzing 'enq: HW - contention' Wait Event (Doc ID 740075.1)的更多相关文章
- 等待事件:enq: HW - contention和enq: TM - contention
今天生成了生产库前几日的AWR报告,发现等待事件中出现了一个陌生的event--enq: HW - contention,google一下是ASSM(Auto Segment Space Manage ...
- Undo 相关的等待事件和已知问题 (Doc ID 1575701.1)
Undo Related Wait Events & Known Issues (Doc ID 1575701.1) APPLIES TO: Oracle Database - Enterpr ...
- 性能问题,AWR High Event enq: US - contention
1.1问题现象 应用反馈业务执行SQL响应超时,需要数据库排除DB是否存在问题,创建AWR观察到top event 新增enq: US - contention ??? 1.2问题分析 1) DB ...
- oracle 11g enq: JI – contention等待事件
最近使用物化视图同步的环境在大量刷新的时候频繁出现enq: JI – contention等待事件,经查: JI enqueue is acquired in exclusive mode on th ...
- 【故障处理】队列等待之enq IV - contention案例
[故障处理]队列等待之enq IV - contention案例 1.1 BLOG文档结构图 1.2 前言部分 1.2.1 导读和注意事项 各位技术爱好者,看完本文后,你可以掌握如下的技能,也 ...
- Resolving Issues of "Library Cache Pin" or "Cursor Pin S wait on X" (Doc ID 1476663.1)
Doc ID 1476663.1) To Bottom In this Document Purpose Troubleshooting Steps Brief Definition: ...
- ORA-4031 错误故障排除与诊断[视频] (Doc ID 2016002.1)
Copyright (c) 2019, Oracle. All rights reserved. Oracle Confidential. ORA-4031 错误故障排除与诊断[视频] (Do ...
- Click to add to Favorites Troubleshooting: High Version Count Issues (Doc ID 296377.1)
Copyright (c) 2018, Oracle. All rights reserved. Oracle Confidential. Click to add to Favorites Trou ...
- enq: FB - contention
Troubleshooting 'enq: FB - contention' Format Block Enqueues. (Doc ID 1379986.1) In this DocumentPur ...
随机推荐
- gcc编译基本用法~2
编译简单的 C 程序 C 语言经典的入门例子是 Hello World,下面是一示例代码: ;} 我们假定该代码存为文件‘hello.c’.要用 gcc 编译该文件,使用下面的命令: $ gcc -g ...
- PWA的探索与应用
本文由云+社区发表 PWA(Progressive Web App)起源背景 传统的Web网页存在以下几个问题: 进入一个页面必须要记住它的url或者加入书签,入口不便捷: 没网络就没响应,不具备离线 ...
- 强大的数据库工具 dbForge Studio ForMySql
优点: 1.可以将MySql数据库操作仿 sqlserver 的操作方式,便于操作 2.强大的比较拷贝能力.菜单栏上的 Comparison 的功能,可以比较两个数据库的差别,同时可以将数据库Copy ...
- [Go] 使用go语言解决现代编程难题
1.计算机一直在演化,64核,128核等等,但是我们依旧在使用为单核设计的技术编程2.Go语言让分享自己的代码包更容易3.Go语言重新思考传统的面向对象,提供了更高效的复用代码手段4.Go不仅提供高性 ...
- Java开发笔记(五十)几种开放性修饰符
前面介绍子类继承父类的时候,提到了public(公共)和private(私有)两个修饰符,其中public表示它所修饰的实体是允许外部访问的:而private表示它所修饰的实体不允许外部访问,只能在当 ...
- Java 内存模型 JMM 浅析
JMM简介 Java Memory Model简称JMM, 是一系列的Java虚拟机平台对开发者提供的多线程环境下的内存可见性.是否可以重排序等问题的无关具体平台的统一的保证.(可能在术语上与Java ...
- 零基础学Python--------第4章 序列的应用
第4章 序列的应用 4.1序列 序列是一块用于存放多个值的连续内存空间,并且按上一定顺序排列,每一个值(称为元素)都分配一个数字,称为索引或位置.通过该索引可以取出相应的值.例如,我们可以把一家酒店看 ...
- 经典面试题:从 URL 输入到页面展现到底发生什么?
前言 打开浏览器从输入网址到网页呈现在大家面前,背后到底发生了什么?经历怎么样的一个过程?先给大家来张总体流程图,具体步骤请看下文分解! 本文首发地址为GitHub 博客,写文章不易,请多多支持与关注 ...
- RMQ求LCA
题目链接 rmq求LCA,interesting. 一直没有学这玩意儿是因为CTSC的Day1T2,当时我打的树剖LCA 65分,gxb打的rmq LCA 45分... 不过rmq理论复杂度还是小一点 ...
- 作为JavaScript开发人员,这些必备的VS Code插件你都用过吗?
本文翻译自:https://www.sitepoint.com/vs-code-extensions-javascript-developers/ 转载请注明出处:葡萄城官网,葡萄城为开发者提供专业的 ...