DDL With the WAIT Option (DDL_LOCK_TIMEOUT)
来源:互联网 发布:赫莲娜绷带面霜 知乎 编辑:程序博客网 时间:2024/05/19 17:25
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. This can be especially frustrating when trying to modify objects that are accessed frequently. To get round this Oracle 11g includes the
The
DDL_LOCK_TIMEOUT
parameter, which can be set at instance or session level using the ALTER SYSTEM
and ALTER SESSION
commands respectively.The
DDL_LOCK_TIMEOUT
parameter indicates the number of seconds a DDL command should wait for the locks to become available before throwing the resource busy error message. The default value is zero. To see it in action, create a new table and insert a row, but don't commit the insert.CREATE TABLE lock_tab ( id NUMBER);INSERT INTO lock_tab VALUES (1);
Leave this session alone and in a new session, set the DDL_LOCK_TIMEOUT
at session level to a non-zero value and attempt to add a column to the table.ALTER SESSION SET ddl_lock_timeout=30;ALTER TABLE lock_tab ADD ( description VARCHAR2(50));
The session will wait for 30 seconds before failing.ALTER TABLE lock_tab ADD ( *ERROR at line 1:ORA-00054: resource busy and acquire with NOWAIT specified or timeout expired
If we repeat the ALTER TABLE
command and commit the insert in the first session within 30 seconds, the ALTER TABLE
will return a successful message.ALTER TABLE lock_tab ADD ( description VARCHAR2(50));Table altered.SQL>
For more information see:- DDL_LOCK_TIMEOUT
0 0
- DDL With the WAIT Option (DDL_LOCK_TIMEOUT)
- DDL With the WAIT Option (DDL_LOCK_TIMEOUT) in Oracle Database 11g Release 1
- DDL_LOCK_TIMEOUT --Oracle 11g DDL 的 wait选项
- ddl_lock_timeout
- DDL_LOCK_TIMEOUT
- Opening the Database with the RESETLOGS Option
- About Opening with the RESETLOGS Option
- Option to use with setsockopt at the IPPROTO_IP level
- Some serious issues with the new -O option
- nobody cared (try booting with the "irqpoll" option)
- irq n: nobody cared (try booting with the "irqpoll" option)
- Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get m
- Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get
- with admin option、with grant option区别
- with admin option&with grant option
- with admin option 与 with grant option
- with admin option & with grant option
- with check option和with grant option
- 【分享】列车运行控制系统人工驾驶数据
- 使用ASP建立Http组件
- Spring事务隔离级别
- asp程序权限控制的代码
- OpenMP中的任务调度
- DDL With the WAIT Option (DDL_LOCK_TIMEOUT)
- 函数整理(日期和时间函数)
- 红黑树(Red Black Tree)
- 精典博文
- jQuery插件标准结构
- 把二元查找树转变成排序的双向链表——Java实现
- asp 中常用的文件处理函数
- iOS 设置字体 自定义字体
- android应用签名详细步骤。