zoukankan      html  css  js  c++  java
  • ORA-00054:resource busy and acquire with nowait specified解决方法

    1、用dba权限的用户查看数据库都有哪些锁

           SELECT T2.USERNAME,T2.SID,T2.SERIAL#,T2.LOGON_TIME
            FROM V$LOCKED_OBJECT T1,V$SESSION T2
            WHERE T1.SESSION_ID=T2.SID ORDER BY T2.LOGON_TIME;

           如:testuser 339 13545 2009-3-5 17:40:05
            知道被锁的用户testuser,sid为339,serial#为13545

          2、根据sid查看具体的sql语句,如果sql不重要,可以kill

          SELECT SQL_TEXT FROM V$SESSION A,V$SQLTEXT_WITH_NEWLINES B
           WHERE DECODE(A.SQL_HASH_VALUE, 0, PREV_HASH_VALUE, SQL_HASH_VALUE)=B.HASH_VALUE
           AND A.SID=&SID ORDER BY PIECE;

          查出来的sql,如: BEGIN :ID := SYS.DBMS_TRANSACTION.LOCAL_TRANSACTION_ID; END;

          3、kill该事务
           ALTER SYSTEM KILL SESSION '339,13545';

          4、这样就可以执行其他的事务sql语句了

          如给表加一列:    
           ALTER TABLE TEST ADD ORG_NAME VARCHAR2(50)

  • 相关阅读:
    java异常处理 it
    java文件操作 it
    ArrayLike it
    javaProreties it
    javaset,Collections,map it
    003 Longest Substring Without Repeating Characters it
    react Video event it
    查看git地址
    Itext 生成PDF
    jar包配置文件到单独文件夹
  • 原文地址:https://www.cnblogs.com/kawashibara/p/9737777.html
Copyright © 2011-2022 走看看