事件id34 oracle,Oracle11gR2上遇到blockingtxnidforDDL等待事件-Oracle

在最近处理的一个案例(11.2.0.4版本的oracle db)中,遇到了blocking txn id for DDL 这个等待事件。

下面来说一下当时的操作:

create index idx_tab_1 on table_name (column_name) tablespace xxx online;

如上建立索引的操作用了17分钟零7秒才完成。 之后我生成该时间段的awr报告,截取top10 等待事件如下:

vU32Af.jpg

blocking txn id for DDL 的wait time是1023.1秒 ,17分钟零7秒 =1027秒,也就是说,当时该create index语句的绝大多数时间都在等待。

后来又生成了该时间段的ash报告,在ash报告中,也能清楚的看到 create index操作的等待事件是blocking txn id for DDL,如下:

i26vyi.png

在mos文章Alter Table Add Column Command Hangs With Wait Event ‘blocking txn id for DDL’ (文档 ID 1553725.1)中,清楚的说明了该等待事件:

原文如下:

DDL commands require exclusive locks on internal structures. If these locks are not available, the commands return with an "ORA-00054: resource busy" error message.

On Oracle 11.2 instead of ora-54, the ALTER TABLE statement will not error out immediately. Instead, it waits indefinitely.

Prior to 11g, if these locks are not available, the DDL command will fail with an "ORA-00054: resource busy" error message.

翻译如下:

DDL命令需要在内部结构上的排他锁。如果这些锁不能获得,DDL命令会失败,并返回”ORA-00054: resource busy” 错误信息。

在Oracle 11.2中,取代了ora-54,alter table语句 不会立即返回错误,而是会无限期的等待。

在11g之前,如果这些锁不能获得,DDL命令会失败,并返回”ORA-00054: resource busy” 错误信息。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值