DDL_LOCK_TIMEOUT的作用

简介: 11g的DDL_LOCK_TIMEOUT参数的作用,从字面上看,就是DDL获取锁的超时时间。先看下官方文档的介绍:DDL_LOCK_TIMEOUTPropertyDescriptionParameter typ...

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

目录
相关文章
|
Ubuntu Linux 网络安全
Linux:使用ntpdate命令同步更新系统时间
Linux:使用ntpdate命令同步更新系统时间
4094 0
|
Linux 关系型数据库 Oracle
|
Docker 容器 数据格式
Docker 修改镜像源地址
版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_34173549/article/details/80417198 我的Docker 版本为 1.
42515 0
|
运维 Kubernetes 安全
推荐3个开源好用的堡垒机
【7月更文挑战第11天】
4689 0
推荐3个开源好用的堡垒机
|
SQL Oracle 关系型数据库
|
Ubuntu JavaScript 前端开发
Google Map api国内正常使用该如何配置(2021最新)
Google Map api国内正常使用该如何配置(2021最新)
829 0
Google Map api国内正常使用该如何配置(2021最新)
|
Linux
在CentOS/RHEL 7.X安装 EPEL repo 的方法
在CentOS/RHEL 7.X安装 EPEL repo 的方法 一 背景 RHEL以及他的衍生发行版如CentOS、Scientific Linux为了稳定,官方的rpm repository提供的rpm包往往是很滞后的,而EPEL恰恰可以解决这两方面的问题。
2898 0
|
Oracle 关系型数据库 索引
|
Linux 网络安全 C语言
Linux下升级 OpenSSH
1、安装需要的包 yum -y install gcc* make perl pam pam-devel  zlib-devel  tcp_wrappers-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel read...
2552 0