前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >DDL_LOCK_TIMEOUT的作用

DDL_LOCK_TIMEOUT的作用

作者头像
bisal
发布2019-01-29 15:38:48
5030
发布2019-01-29 15:38:48
举报

11g的DDL_LOCK_TIMEOUT参数的作用,从字面上看,就是DDL获取锁的超时时间。

先看下官方文档的介绍:

DDL_LOCK_TIMEOUT

Property

Description

Parameter type

Integer

Default value

0

Modifiable

ALTER SESSION

Range of values

0 to 1,000,000 (in seconds)

Basic

No

DDL_LOCK_TIMEOUT specifies a time limit for how long DDL statements will wait in a DML lock queue. The default value of zero indicates a status of NOWAIT. The maximum value of 1,000,000 seconds will result in the DDL statement waiting forever to acquire a DML lock. If a lock is not acquired before the timeout period expires, then an error is returned.

从解释看,很好理解,该参数表示了执行DDL语句时需要等待DML锁的超时时间,默认0表示当无法立即获得DML锁时,会立即抛出NOWAIT,并且支持session级修改。

实验:

SQL> show parameter ddl_lock_timeout

NAME     TYPE VALUE ------------------------------------ ----------- ------------------------------ ddl_lock_timeout     integer 0

SQL> desc t;

 Name     Null?           Type  ----------------------------------------- -------- ----------------------------  TID             NOT NULL NUMBER(38)  CLS_NAME     NOT NULL VARCHAR2(30)

session1:

SQL> update t set cls_name='a' where tid=1;

0 rows updated.

session2:

SQL> drop table t;

drop table t            * ERROR at line 1: ORA-00054: resource busy and acquire with NOWAIT specified or timeout expired

Elapsed: 00:00:00.00

session2:

SQL> alter session set ddl_lock_timeout = 10;

Session altered.

SQL> drop table t; drop table t            * ERROR at line 1: ORA-00054: resource busy and acquire with NOWAIT specified or timeout expired

Elapsed: 00:00:10.01

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2015年03月24日,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • DDL_LOCK_TIMEOUT
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档