广告
返回顶部
首页 > 资讯 > 数据库 >enq: US - contention
  • 285
分享到

enq: US - contention

2024-04-02 19:04:59 285人浏览 安东尼
摘要

sql> select name, parameter1, parameter2, parameter3 from v$event_name where name like '&a

sql> select name, parameter1, parameter2, parameter3 from v$event_name where name like '&event';
Enter value for event: enq: US - contention
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 'enq: US - contention'

NAME                                PARAMETER1                PARAMETER2                PARAMETER3
----------------------------------- ------------------------- ------------------------- -------------------------
enq: US - contention                name|mode                 undo segment #            0

Below is the most commonly seen Undo related wait events. 下面是最常见的与撤消相关的等待事件:
 
    Enq: US Contention
    Buffer Busy waits on Undo
    Wait for a undo record


1.Enq: US Contention
As the number of transactions increases so is their need for space but if there is little space free because most is still allocated to unexpired blocks the sessions first search for free space in offline undo segments. If there are many of Offline undo segments, the search for space can generate lots of hits on dc_rollback_segments, the latch and US(Undo Segment)enqueue.  This can lead to high 'latch: row cache objects' contention which may be seen on DC_ROLLBACK_SEGMENTS together with high 'enq: US - contention'
随着交易数量的增加,他们需要空间,但是如果没有空间可用,因为大多数仍然分配给未到期的块,那么会话首先在离线还原段中搜索空闲空间。 如果有许多脱机撤销段,搜索空间可能在dc_rollback_segments上产生大量命中,存器和US(撤消段)排队。 这可能会导致高的'latch:row cache object'争用,在DC_ROLLBACK_SEGMENTS上可能会出现争用,而'enq:US  -  contention'

PerfORMance of the database is affected when this wait event occurs.  Row cache objects latch protects the dictionary cache. The first thing to figure out whether most of the contention was contributed by a particular row cache objects child latch:
发生此等待事件时,数据库的性能会受到影响。 行缓存对象闩锁保护字典缓存。 首先要弄清楚大部分的争用是由一个特定的行缓存对象子锁存器产生的

1.1查询:
1) select SEGMENT_NAME,STATUS,TABLESPACE_NAME from dba_rollback_segs where status = 'OFFLINE';

2) select latch#, child#, sleeps from v$latch_children where name='row cache objects' and sleeps > 0 order by sleeps desc;
 
    LATCH#     CHILD#     SLEEPS
     -------- ---------- ----------
       120        1       3531645
        10        5       400

3)Query v$rowcache to find the  confirm
    SQL> select parameter, gets from v$rowcache order by gets desc;
 
    PARAMETER                              GETS
    -------------------------------- ----------
    dc_rollback_segments              310995555
    dc_tablespaces                     76251831
    dc_segments                         3912096

Here it shows  dc_rollback_segments with highest gets.     

1.2查询awr:
Check for Top 5 Wait events

High 'latch: row cache objects' contention on dc_rollback_segmentstogether with high 'enq: US - contention'
Top 5 Timed Events                                         Avg %Total         
                    
~~~~~~~~~~~~~~~~~~                                        wait   Call         
                    
Event                                 Waits    Time (s)   (ms)   Time Wait    
 
------------------------------ ------------ ----------- ------ ------
----------                  
latch: row cache objects          2,057,004     490,074    238   43.8
Concurrency                  
enq: US - contention              1,548,328     370,460    239   33.1      
Other  

1.3 其他信息收集手段:
1) When the issue occurs, collect hang analyze dumps and system state dumps.

$ sqlplus / as sysdba
SQL> oradebug setmypid
SQL> oradebug unlimit
SQL> oradebug hanganalyze 3
SQL> oradebug dump systemstate 266

Wait for 5 seconds, and then continue with:等待5秒钟,然后继续

SQL> oradebug dump systemstate 266
SQL> exit

Wait for 2 minutes, and then again:等待2分钟,然后再次

$ sqlplus / as sysdba
SQL> oradebug setmypid
SQL> oradebug unlimit
SQL> oradebug hanganalyze 3
SQL> oradebug dump systemstate 266

2) AWR and/or ASH report of 30 or 60 minutes interval.

3) Alert.log from last startup  


2. Buffer Busy Waits on Undo  
Buffer Busy Waits on Undo happens when we want to NEW the block but the block is currently being read by another session (most likely for undo).
缓冲区忙于等待撤销时,我们想要新的块,但该块正在被另一个会话正在读取(最有可能撤消)。   

1)Review the section Segments by Buffer Busy Waits, and note the segments with the highest waits
查看按缓冲区繁忙等待分段,并注意等待最高的段

2)查询:
SELECT p1 "File", p2 "Block", p3 "Reason"
    FROM v$session_wait
   WHERE event='buffer busy waits';
   
3)SELECT owner, segment_name, file_id, block_id starting_block_id, block_id + blocks ending_block_id, blocks
FROM dba_extents
WHERE file_id = &file_num AND ( block_id <= &block_id AND (&block_id < (block_id + blocks)) )
 
 OWNER      SEGMENT_NAME            FILE_ID STARTING_BLOCK_ID ENDING_BLOCK_ID     BLOCKS
---------- -------------------- ---------- ----------------- --------------- ----------
SCOTT      STOCK_PRICES                  4             78385           78393          8

如果块类型是'Undo Header',那么解决方法是添加更多的回滚段

方案:Solutions
首先,检查UNDO的空间健康状况和错误配置是非常重要的。
检查下面的文件,并按照所述的检查/步骤:
ORA-01555疑难解答 - 快照太旧:名称"字符串"的回退段号"字符串"太小(文档ID 1580790.1)

Afterwards, apply one/both of the following solutions :之后,应用以下一种或两种解决方案

a. Setting _ROLLBACK_SEGMENT_COUNT to a high number to keep undo segments online:
ALTER SYSTEM SET "_rollback_segment_count"= scope=both;

Note: In databases with high query activity, particularly parallel query and a high setting for _ROLLBACK_SEGMENT_COUNT, you can expect to see wait contention on the row cache for DC_ROLLBACK_SEGS. It is highly recommended in these environments where setting _ROLLBACK_SEGMENT_COUNT to a high value (10s of thousands and higher) apply the patch for Bug:14226599 base Bug:1421197.  This will increase the hash buckets on the DC_ROLLBACK_SEGS row cache to help alleviate latch contention.   
注意:在具有高查询活动(尤其是并行查询)和_ROLLBACK_SEGMENT_COUNT的高设置的数据库中,您可能会看到DC_ROLLBACK_SEGS在行高速缓存上的等待争用。 强烈建议在这些环境中将_ROLLBACK_SEGMENT_COUNT设置为较高的值(数千和更高的值),并将Bug应用于Bug:14226599 base Bug:1421197。 这将增加DC_ROLLBACK_SEGS行缓存上的散列桶,以帮助缓解锁存争用。

b.Set the event 10511 which disables SMON from offlining the undo segments which avoids the contention for US enqueue.
设置禁用SMON的事件10511使撤消段离线,避免US争用。

Setting of this event does not effect the regular shrink/space reclaims as it only disables SMON from offlining to avoid excessive onlines of undo segments.
此事件的设置不会影响正常的收缩/空间回收,因为它只会禁用SMON从脱机状态,以避免过多联机撤消段。

语法:
alter system set events '10511 trace name context forever, level 1';  


3.wait for a undo record等待撤消记录
You can disable parallel rollback by setting the following parameter
您可以通过设置以下参数禁用并行回滚

参数:
fast_start_parallel_rollback = false

BEWARE: that setting this parameter dynamically can cause problems on a busy instance with a lot of active transaction work and it is safer to set this with an instance restart so as not to change the rollback strategy on active transactions.
注意:动态设置这个参数可能会导致一个繁忙的实例出现问题,并且有很多活动的事务工作,为了不改变活动事务的回滚策略,设置这个实例重启会更安全
您可能感兴趣的文档:

--结束END--

本文标题: enq: US - contention

本文链接: https://www.lsjlt.com/news/47127.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

本篇文章演示代码以及资料文档资料下载

下载Word文档到电脑,方便收藏和打印~

下载Word文档
猜你喜欢
  • enq: US - contention
    SQL> select name, parameter1, parameter2, parameter3 from v$event_name where name like '&a...
    99+
    2022-10-18
  • 数据库中如何解决enq: US - contention问题
    小编给大家分享一下数据库中如何解决enq: US - contention问题,相信大部分人都还不怎么了解,因此分享这篇文章给大家参考一下,希望大家阅读完这篇文章后大有收获,下面让我们一起去了解一下吧! ...
    99+
    2022-10-18
  • enq: SQ – contention、cursor: p
    事情已经过去一年,发生在15年1月份,某全国业务系统,实时的号码办理系统,收到短信告警,该系统断开连接。数据库出现大量enq: SQ – contention、cursor: pin S wait...
    99+
    2022-10-18
  • Oracle等待事件之enq: TM – contention
    执行DML 期间,为防止对与DML 相关的对象进行修改,执行DML 的进程必须对该表获得TM 锁。 P1 = name|mode P2 = object # P3 = table/partition ...
    99+
    2022-10-18
  • 由于IMPDP...APPEND引起的 enq: TM – contention
    线上业务突然告警,立刻检查ASH 报告发现 enq: TM – contention 从各个指标的TOP SQL 看都是同一个表的insert 和update 。 经确认是在impdp 数...
    99+
    2022-10-18
  • oracle 11.2.0.4 rac集群等待事件enq: TM - contention
        近期,一金融客户oracle 11.2.0.4 rac集群delete不当导致等待事件enq: TM - contention严重引起大范围会话堆积,记录的相关分析工...
    99+
    2022-10-18
  • enq: TX – row lock contention的测试和案例分析
    参考:http://www.killdb.com/2015/07/13/%E5%85%B3%E4%BA%8Eenq-tx-row-lock-contention%E7%9A%84%E6%B5%8B%E8%A...
    99+
    2022-11-30
    tx contention enq
  • 【故障处理】队列等待之enq IV - contention案例
    【故障处理】队列等待之enq IV -  contention案例1.1  BLOG文档结构图 1.2  前言部分1.2.1  导读和注意事项各位技术爱好者...
    99+
    2022-10-18
  • 如何理解enq: TX - index contention等待的探讨与测试
    本篇文章给大家分享的是有关如何理解enq: TX - index contention等待的探讨与测试,小编觉得挺实用的,因此分享给大家学习,希望大家阅读完这篇文章后可以有所收获,话不多说,跟着小编一起来看...
    99+
    2022-10-19
  • 如何进行等待事件enq TX row lock contention的分析
    本篇文章为大家展示了如何进行等待事件enq TX row lock contention的分析,内容简明扼要并且容易理解,绝对能使你眼前一亮,通过这篇文章的详细介绍希望你能有所收获。 ...
    99+
    2022-10-19
  • 数据库出现很高的enq: DX - contention等待该怎么解决
    数据库出现很高的enq: DX - contention等待该怎么解决,很多新手对此不是很清楚,为了帮助大家解决这个难题,下面小编将为大家详细讲解,有这方面需求的人可以来学习下,希望你能有所收获。检查客户AWR报告时,发现数据库经历严重的e...
    99+
    2023-06-06
  • Oracle %Cpu 100 us
      昨天中秋节,本该是团圆的好日子,苦逼的运维我还要值班(哈哈,吐槽一下)本以为会没有啥事,谁知道比较重要的一台Oracle服务器突然报警,CPU 2个core都飙到100%,load avera...
    99+
    2022-10-18
  • US 出差(3)--Kansas cit
    过来的第一个周末由于是on duty,所以不能出远门,只能周围逛逛。第二个周末计划去趟kansas city,位于Wichita的东北。它也是属于kansas州,只不过州和市是同名的,类似于国内的吉林省和吉林市的关系。之所以选择去那个城市的...
    99+
    2023-01-31
    Kansas cit
  • X3650M3\X3550M3用外置US
    X3550M3,X3650M3,X3250M3加外置光驱不能从光驱启动,解决办法: 更改启动项,把USB光驱启动调到最前面。 F1-boot manger-add boot option-usb storage-change boot ma...
    99+
    2023-01-31
    外置
  • us域名怎么备案
    根据工信部要求,us域名暂未被工信部收录,无法进行备案,目前工信部可接受备案的域名后缀有以下几种英文域名:.cn/.ren/.wang/.citic/.top/.sohu/.xin/.com/.net/.xyz/.vip/.work/.la...
    99+
    2022-10-20
  • enq:SQ-contention(SQ锁)测试
    oracle为了管理Sequence使用了以下三种锁:row cache lock :在调用Sequnece.nextval过程中.将数据字典信息进行物理修改时获取.赋予NOCACHE属性的Sequence...
    99+
    2022-10-18
  • enq:HW–contention 故障处理
    enq: HW - contention 说明:  硬件队列用于序列化段的高水位线以外的空间分配。 可以用手动分配范围即可解决问题。 V$SESSION_WAIT,P2 / V$LOCK...
    99+
    2022-10-18
  • us域名表示的是什么
    us域名是美国的国别域名,和我国的cn域名性质一样,为国家顶级域名;us域名还是一个通用顶级域名,任何行业都可以使用,us域名作为美国的国家顶级域名,如在美国内创立公司并需要拓展市场,选择使用us域名是一个很好的选择。...
    99+
    2022-10-20
  • oracle等待事件之enq: CF – contentio
    Enqueue 是一种保护共享资源的锁定机制,避免因并发操作而损坏数据,Enqueue 采用排队机制,即 FIFO(先进先出)来控制资源的使用。在任何需要读取控制文件的动作时,就会发生等待事件enq: CF...
    99+
    2022-10-18
  • Oracle Study之-- enq:SQ contention等待事件
    Oracle Study之-- enq:SQ contention等待事件通过AWR Report发现“enq:SQ contention”等待事件:应用环境:转自:http://www.xuebuyuan...
    99+
    2022-10-18
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作