我的存储过程中有以下一段: strsql:='truncate table table1';
 execute immediate strsql;
 commit;update table1......这个存储过程在asp.net中被调用。在别人点执行时,我又点了执行,系统马上报错
异常信息: ORA-00054: 资源正忙, 但指定以 NOWAIT 方式获取资源 
如何让系统不报错,等别人执行完后,我的点击可以执行。谢谢 

解决方案 »

  1.   

    ORA-00054 resource busy and acquire with NOWAIT specifiedCause: The NOWAIT keyword forced a return to the command prompt because a resource was unavailable for a LOCK TABLE or SELECT FOR UPDATE command.Action: Try the command after a few minutes or enter the command without the NOWAIT keyword.
    在SQL中增加NO WAIT!
      

  2.   

    我把存储过程改了,改成 delete from table1; commit;
    这样好象不报错了,谁知道为什么?谢谢
      

  3.   

    delete不会释放表占用的空间
    truncate要释放
      

  4.   

      同时对一个表操作,update,truncate 等操作 可以让多个人同时调用truncate 一个表? 同时asp里写的调用过程的方法时候够健壮等等 ORA-00054的异常是否捕获. ORA-00054 正常情况下如果资源锁定,根据ora默认的设置 想修改被锁定的资源需要一段时间才会抱错 + no wait 则会不等待立即申请资源,如果资源这个时候被锁定,则立即抱错.
      

  5.   

     lz 可以多研究下 oracle 的事务