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.

  • 相关阅读:
    多层缓存、要素缓存
    ASP.NET提供三种主要形式的缓存
    cache、session、cookie的区别
    常用简写快速生成代码
    EF数据迁移
    源文件与模块生成时的文件不同,是否希望调试器使用它?
    强命名程序集组成与作用
    centOS docker运行Asp.net Core程序
    docker
    .net常用的代码生成工具
  • 原文地址:https://www.cnblogs.com/karmapeng/p/7683325.html
Copyright © 2011-2022 走看看