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

目录
相关文章
|
11月前
|
调度 数据库
什么是 SAP Lock 机制中的 Lock Table
什么是 SAP Lock 机制中的 Lock Table
|
10月前
|
关系型数据库 MySQL 数据库
MySQL报错:Lock wait timeout exceeded; try restarting transaction
MySQL报错:Lock wait timeout exceeded; try restarting transaction
433 0
|
10月前
|
SQL 关系型数据库 MySQL
MySQL报错:1205 Lock wait timeout exceeded; try restarting transaction处理
MySQL报错:1205 Lock wait timeout exceeded; try restarting transaction处理
190 0
|
11月前
|
SQL 关系型数据库 MySQL
【MySQL异常】MySQL事务锁问题----lock wait timeout exceeded; try restarting transaction
【MySQL异常】MySQL事务锁问题----lock wait timeout exceeded; try restarting transaction
128 0
|
SQL 关系型数据库 MySQL
Mysql 异常:Lock wait timeout exceeded; try restarting transaction的解决办法
Mysql 异常:Lock wait timeout exceeded; try restarting transaction的解决办法
145 0
|
SQL 关系型数据库 MySQL
mysql Lock wait timeout exceeded; try restarting transaction解决方案
在测试程序时,打的断点怎么都跳不进去,console一直报 “Lock wait timeout exceeded; try restarting transaction”
143 0
|
存储 关系型数据库 MySQL
【MySQL】innodb_lock_wait_timeout=120,是干什么的?底层原理是什么?
【MySQL】innodb_lock_wait_timeout=120,是干什么的?底层原理是什么?
311 0
|
关系型数据库 MySQL
jdbs学习中的错误总结1(MySql Lock wait timeout exceeded)
错误原因: 两个事物之间出现死锁,导致另外一个事物超时 某一种表频繁被锁表,导致其他事物无法拿到锁,导致事物超时
jdbs学习中的错误总结1(MySql Lock wait timeout exceeded)
|
Oracle 关系型数据库 数据库
innodb_lock_wait_timeout参数的了解
前言:在管理ORACLE的工作中,经常发现因为锁等待的原因导致应用宕机了。Mysql考虑到自身的性能和架构等因素,InnoDB数据库引擎增加了参数innodb_lock_wait_timeout,避免在资源有限的情况下产生太多的锁等待; 一、innodb_...
3107 0
|
关系型数据库 MySQL
[Err] 1205 - Lock wait timeout exceeded; try restarting transaction Mysql 报错
Mysql 报错: [Err] 1205 - Lock wait timeout exceeded; try restarting transaction
467 0