Oracle 11g ddl_lock_timeout
2014-08-22 11:29
429 查看
在Oracle 11g之前,当一个表上还有事务,此时不能对表进行DDL操作,否则会马上报错。在11g里引进了ddl_lock_timeout这个参数,可以等上一段时间后还没有获得锁,才会报错。我个人认为这个新特性用处不大,知道就行了。
session1:
SQL> select * from v$version;
BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
PL/SQL Release 11.2.0.1.0 - Production
CORE 11.2.0.1.0 Production
TNS for Linux: Version 11.2.0.1.0 - Production
NLSRTL Version 11.2.0.1.0 - Production
SQL> drop table test purge;
SQL> create table test(id number(10));
SQL> insert into test values(1);
已创建 1 行。
session2:
SQL> show parameter ddl_lock_timeout;
NAME TYPE VALUE
------------------------------------ ----------- -----------
ddl_lock_timeout integer 0
SQL> set timing on
SQL> drop table test;
drop table test
*
第 1 行出现错误:
ORA-00054: 资源正忙, 但指定以 NOWAIT 方式获取资源, 或者超时失效
已用时间: 00: 00: 00.01
SQL> alter session set ddl_lock_timeout = 10;
SQL> drop table test;
drop table test
*
第 1 行出现错误:
ORA-00054: 资源正忙, 但指定以 NOWAIT 方式获取资源, 或者超时失效
已用时间: 00: 00: 10.01
session1:
SQL> select * from v$version;
BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
PL/SQL Release 11.2.0.1.0 - Production
CORE 11.2.0.1.0 Production
TNS for Linux: Version 11.2.0.1.0 - Production
NLSRTL Version 11.2.0.1.0 - Production
SQL> drop table test purge;
SQL> create table test(id number(10));
SQL> insert into test values(1);
已创建 1 行。
session2:
SQL> show parameter ddl_lock_timeout;
NAME TYPE VALUE
------------------------------------ ----------- -----------
ddl_lock_timeout integer 0
SQL> set timing on
SQL> drop table test;
drop table test
*
第 1 行出现错误:
ORA-00054: 资源正忙, 但指定以 NOWAIT 方式获取资源, 或者超时失效
已用时间: 00: 00: 00.01
SQL> alter session set ddl_lock_timeout = 10;
SQL> drop table test;
drop table test
*
第 1 行出现错误:
ORA-00054: 资源正忙, 但指定以 NOWAIT 方式获取资源, 或者超时失效
已用时间: 00: 00: 10.01
相关文章推荐
- DDL With the WAIT Option (DDL_LOCK_TIMEOUT) in Oracle Database 11g Release 1
- DDL_LOCK_TIMEOUT --Oracle 11g DDL 的 wait选项
- Oracle 变量之 DDL_LOCK_TIMEOUT
- oracle 9i r2 锁争用:DDL 和 DML 和 LOCK TABLE tablename IN exclusive mode
- oracle 11g 多次业务用户被锁定 library cache lock导致数据hang住问题解决
- [Oracle 11g r2(11.2.0.4.0)]sql实现ddl记录日志
- 『ORACLE』 对永久表空间进行DDL操作(11g)
- Oracle11g新特性:在线操作功能增强-可等待DDL操作
- DDL_LOCK_TIMEOUT的作用
- [ORACLE 11G]ROW CACHE LOCK 等待
- Oracle11g安全审计--重要帐号的DDL语句操作记录
- ORACLE distributed_lock_timeout参数
- Oracle 11gR2上遇到blocking txn id for DDL等待事件
- ddl_lock_timeout 与 ORA-00054: resource busy and acquire with NOWAIT specified or timeout expired
- Oracle Enqueue Lock Type Reference including 11g new locks
- ddl_lock_timeout
- oracle 11g 锁分类(lock)
- Oracle 11g下重现library cache lock等待事件
- Oracle 11g Golden Gate DDL单向同步实例演示
- Oracle Enqueue Lock Type Reference including 11g new locks