为何在v$locked_table中没有查到表被锁住表记录,却在给修改某个表结构时出错:
ora-00054:resouce busy and acquire with NOWAIT specified

解决方案 »

  1.   

    对不起,上面的表应是v$locked_objects
      

  2.   

    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
    是不是你的查询不正确:
    To find the table name that corresponds to a particular OBJECT_ID of the
    V$LOCKED_OBJECT view:
    select xidusn, object_id, session_id, locked_mode from v$locked_object;
    XIDUSN OBJECT_ID SESSION_ID LOCKED_MODE
    --------- --------- ---------- -----------
    3 2711 9 3
    0 2711 7 3
    select object_name from dba_objects where object_id = 2711;
    OBJECT_NAME
    -------------
    S_EMP
    是这样的吗,应该能够看到呀
      

  3.   

    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
    是不是你的查询不正确:
    To find the table name that corresponds to a particular OBJECT_ID of the
    V$LOCKED_OBJECT view:
    select xidusn, object_id, session_id, locked_mode from v$locked_object;
    XIDUSN OBJECT_ID SESSION_ID LOCKED_MODE
    --------- --------- ---------- -----------
    3 2711 9 3
    0 2711 7 3
    select object_name from dba_objects where object_id = 2711;
    OBJECT_NAME
    -------------
    S_EMP
    是这样的吗,应该能够看到呀
      

  4.   


    select a.username, a.sid, a.serial#, b.id1, c.sql_text
       from v$session a, v$lock b, v$sqltext c
       where a.lockwait = b.kaddr
       and a.sql_address = c.address
       and a.sql_hash_value = c.hash_value;
    来查询当前被锁住的用户列表,如下:
    USERNAME SID SERIAL# ID1    SQL_TEXT 
    SCOTT    11   9     131080  update plsql_user.s_employee set salary = 5000 
      

  5.   

    锁有很多种的!
    RX,X,SRX等等
      

  6.   

    查锁:
    SELECT A.OWNER,   
             A.OBJECT_NAME,   
             B.XIDUSN,   
             B.XIDSLOT,   
             B.XIDSQN,   
             B.SESSION_ID,   
             B.ORACLE_USERNAME,   
             B.OS_USER_NAME,   
             B.PROCESS,   
             B.LOCKED_MODE,   
             C.MACHINE,   
             C.STATUS,   
             C.SERVER,   
             C.SID,   
             C.SERIAL#,   
             C.PROGRAM  
        FROM ALL_OBJECTS A,   
             V$LOCKED_OBJECT B,   
             SYS.GV_$SESSION C 
       WHERE ( A.OBJECT_ID = B.OBJECT_ID ) 
         AND (B.PROCESS = C.PROCESS )
       ORDER BY 1,2
      

  7.   

    v$locked_object视图里一条记录也没有,但我要更改某表的结构时却出现:
    ora-00054:resouce busy and acquire with NOWAIT specified
      

  8.   

    系统资源忙,你用的oracle8吧,重新启动吧