你执行一下select * from ....where ....for update nowait看看这两条数据是不是被锁住了?

解决方案 »

  1.   

    我运行select * from ....where ....for update nowait,一段时间后提示:“ORA-00054:resource busy and acquire with NOWAIT specified”请问是何原因啊,谢谢了!这张表只有不到5万条记录。而我在另一张有39万条记录的表执行类似的操作,很快就完成了。两张表都是只删除2条记录。
      

  2.   

    表示这两条数据已经被别的session锁住了....你要急着删就去把别的session删掉,要不就等待别人把锁释放掉
      

  3.   

    我如何能找到这个session呢,请多指教,谢谢!
      

  4.   

    我只会在toad里面看...你装了没有?
    用sys用户进入,到DBA-->session browser-->lock下面去看,直接点删除就行了
      

  5.   

    呵呵,哪位能提供一个sql语句啊,多谢了。
      

  6.   

    ----查找某用户下的所有锁
    select a.*,b.object_name 
    from v$locked_object a ,all_objects b ,v$session c
    where a.OBJECT_ID=b.object_id
    AND a.SESSION_ID=c.SID
    and c.USERNAME='abc'
      

  7.   

    例:
    SQL> select username,status,sid,serial# from v$session where username is not null;USERNAME                       STATUS         SID   SERIAL#
    ------------------------------ -------- --------- ---------
    SYS                            ACTIVE          11     38493SQL> /USERNAME                       STATUS         SID   SERIAL#
    ------------------------------ -------- --------- ---------
    TEMP                           INACTIVE         9     38038
    SYS                            ACTIVE          11     38493SQL> alter system kill session '9,38038';系统已更改。SQL> select username,status,sid,serial# from v$session where username is not null;USERNAME                       STATUS         SID   SERIAL#
    ------------------------------ -------- --------- ---------
    TEMP                           KILLED           9     38038
    SYS                            ACTIVE          11     38493SQL>