zoukankan      html  css  js  c++  java
  • No more “busy and acquire with NOWAIT”

    Finally, with Oracle 11g comes a solution to the dreaded  "ORA-00054: resource busy and acquire with NOWAIT specified" message. It's now possible to specify how long the command should wait before timing out (either at the system or session level) by specifying a value in seconds for the DDL_LOCK_TIMEOUT  parameter.

    Permanently, at the system level:

    alter system set DDL_LOCK_TIMEOUT=300 scope=both;

    Temporarily, at the session level:

    alter session set DDL_LOCK_TIMEOUT = 300;

    Both of the above commands will set the timeout to 5 minutes (300 seconds), which can be tested / demonstrated with the aid of two sessions:

    StepSession #1Session #2

     Session #1Session #2
     1 SQL> create table test_table ( val number );
    Table created.
    SQL> insert into test_table values (1);
    1 row created.
     
    2   SQL> set timing on
    3   SQL> create index test_idx on test_table (val);
    create index test_idx on test_table (val)
    *
    ERROR at line 1:
    ORA-00054: resource busy and acquire with NOWAIT specified or timeout expired
    Elapsed: 00:00:00.09
    4   SQL> alter session set DDL_LOCK_TIMEOUT=300;
    5   SQL> create index test_idx on test_table (val);
    create index test_idx on test_table (val)
    *
    ERROR at line 1:
    ORA-00054: resource busy and acquire with NOWAIT specified or timeout expired
    Elapsed: 00:05:00.68
    6 SQL> commit;
    Commit complete.
     

    You can see from the highlighted output above that the first attempt to create an index immediately errored whereas the second attempt waited for the 5 minutes specified via DDL_LOCK_TIMEOUT before the error message was displayed.

  • 相关阅读:
    开发者最好的推广平台
    [ERR] 2006
    PS通道
    PS图层样式
    PS 图层 蒙版
    科研狗的基本绘图技巧 | PS | AI
    memcached的常规操作:增删改查【转】
    mysql:pt-online-schema-change 在线修改表、删除表数据【转】
    HAProxy的四层与七层的区别及透传IP实战案例【转】
    【springBoot】SpringBoot修改启动logo图案
  • 原文地址:https://www.cnblogs.com/karmapeng/p/7683325.html
Copyright © 2011-2022 走看看