DDL With the WAIT Option (DDL_LOCK_TIMEOUT) in Oracle Database 11g Release 1
来源:互联网 发布:知乎手机怎么回答 编辑:程序博客网 时间:2024/05/21 22:45
http://www.oracle-base.com/articles/11g/ddl-lock-timeout-11gr1.php
DDL With the WAIT Option (DDL_LOCK_TIMEOUT) in Oracle Database 11g Release 1
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 DDL_LOCK_TIMEOUT
parameter, which can be set at instance or session level using theALTER 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, theALTER TABLE
will return a successful message.
ALTER TABLE lock_tab ADD ( description VARCHAR2(50));Table altered.SQL>
For more information see:
- DDL_LOCK_TIMEOUT
- DDL With the WAIT Option (DDL_LOCK_TIMEOUT) in Oracle Database 11g Release 1
- DDL With the WAIT Option (DDL_LOCK_TIMEOUT)
- DDL_LOCK_TIMEOUT --Oracle 11g DDL 的 wait选项
- Oracle 11g ddl_lock_timeout
- Table Compression Enhancements in Oracle Database 11g Release 1
- Adaptive Cursor Sharing in Oracle Database 11g Release 1
- DNS Configuration for the SCAN used with Oracle RAC Database 11g Release 2
- (转)Fine-Grained Access to Network Services in Oracle Database 11g Release 1
- 《Oracle Database Concepts 11g Release 2》读书笔记(1)-schema
- Oracle Database 11g Release 1中的自适应游标共享
- Oracle Database 11g Release 2 New Features in Oracle Data Guard
- Create Oracle ASM Cluster File Systems (ACFS) in Oracle Database 11g Release 2
- Oracle Database 11g Release 2 DBCA Error At Adding Oracle JVM When Creating A Database With A Datab
- DML Error Logging in Oracle 10g Database Release 2
- DML Error Logging in Oracle 10g Database Release 2
- 82.You are managing an Oracle Database 11g database with the following backup strategy: 1) On Sunday
- Data Guard Physical Standby Setup in Oracle Database 11g Release 2
- Data Guard Physical Standby Setup in Oracle Database 11g Release 2
- C#中的BeginInvoke和EndInvoke实现异步
- 汉化Avid Media Composer
- CentOS Tips
- 雷达图,自己捣腾了一个,还有许多需要改进的地方
- 关于java处理异常的话题
- DDL With the WAIT Option (DDL_LOCK_TIMEOUT) in Oracle Database 11g Release 1
- 几种数字滤波算法
- ftps传输encrypt data
- poj 3026 Borg Maze
- [旧闻]OpenStreetMap 组织确认苹果正使用他们的地图数据
- JS DOM
- 系统性能调优如何做?
- 深入浅出JavaScript—ECMAScript
- .NET使用DES加密解密