Getting ORA-00054

Our application is getting the following error...
SQL> select * from cmd where CC0034_CMD_NRI = 111 for update nowait;
select * from cmd where CC0034_CMD_NRI = 111 for update nowait
ERROR at line 1:
ORA-00054: resource busy and acquire with NOWAIT specified
My understanding is that the requested record is locked and that the "FOR UPDATE NOWAIT" clause causes the error. How do I find out who locked the record ?
How do I prevent this from happening again, or is retrying until the locked record is free the only option I have ?
Thanks,
Gabriel

Yes this error comes from that some other users were holding a lock on a table.
Example below will demonstrate this:
Session one:
[email protected]> create table t(id int);
Table created.
[email protected]> insert into t values(10);
1 row created.
[email protected]> lock table t in exclusive mode;
Table(s) Locked.
Session two:
[email protected]> select * from t for update nowait;
select * from t for update nowait
ERROR at line 1:
ORA-00054: resource busy and acquire with NOWAIT specified
[email protected]> select * from t for update ;
still wating..........
You can peform this check:
[email protected]> select * from dba_blockers;
HOLDING_SESSION
11
to get sid of the blocking sessions and then using v$ views you can check sid, serial#, sql statetment being executed and so on..
Best Regards
Krystian Zieja / mob

Similar Messages

  • ORA-00054: resource busy and acquire with NOWAIT specified

    We are frequently getting ORA-00054: resource busy and acquire with NOWAIT specified error in production database for a application user group. Production database is oracle 10g R 10.2.0.5.0 on sun solaris. The app user group is telling that the code is not changed from many years. They wants this to be resolved on h.priority. The tables which are getting this error has clob fields. I rebuilded indexes in QA environment & they ran it again they are getting the same error.
    I asked to see select for update nowait clause's carefully. They said everything is fine. Please let me know any solution if any one is getting this kind of error. Thanks.

    Has anything changed compared to previously when these errors didn't happen?
    Not necessarily application code but
    - Database version
    - patches
    - indexes
    - data volumes
    - number of clients
    etc, etc
    What led you to rebuild the indexes?
    As for suggested solutions, they completely depend on the specifics of your situation.
    Do you know that the SELECT FOR UPDATE is raising the ORA-00054?
    Something else has the relevant resource locked in a non-shareable way - you need to find out what.
    It sounds like the most likely candidate is another session that has issued a SELECT FOR UPDATE and locked some of the same row(s).
    It's good that you can reproduce on QA rather than just production.
    Maybe you can manually issue the failing SELECT FOR UPDATE statement but with WAIT rather than NOWAIT and see if that helps you figure out blockers, etc.
    Further analysis required at your end.

  • Errors: ORA-00054 & ORA-01452 while running DAC Full Load

    Hi Friends,
    Previously, I ran full load...it went well. And, I did some sample reports also in BI APPS 7.9.6.2
    Now, I modified few parameters as per the Business and I try to run Full Load again...But I struck with few similar errors. I cleared couple of DB Errors.
    Please, help me out to solve the below errors.
    1. ANOMALY INFO::: Error while executing : TRUNCATE TABLE:W_SALES_BOOKING_LINE_F
    MESSAGE:::com.siebel.etl.database.IllegalSQLQueryException: DataWarehouse:TRUNCATE TABLE W_SALES_BOOKING_LINE_F
    ORA-00054: resource busy and acquire with NOWAIT specified or timeout expired
    --I checked W_SALES_BOOKING_LINE_F, it contain s data.
    2. ANOMALY INFO::: Error while executing : CREATE INDEX:W_GL_REVN_F:W_GL_REVN_F_U1
    MESSAGE:::java.lang.Exception: Error while execution : CREATE UNIQUE INDEX
         W_GL_REVN_F_U1
    ON
         W_GL_REVN_F
         INTEGRATION_ID ASC
         ,DATASOURCE_NUM_ID ASC
    NOLOGGING
    with error DataWarehouse:CREATE UNIQUE INDEX
         W_GL_REVN_F_U1
    ON
         W_GL_REVN_F
         INTEGRATION_ID ASC
         ,DATASOURCE_NUM_ID ASC
    NOLOGGING
    ORA-01452: cannot CREATE UNIQUE INDEX; duplicate keys found
    -- Yes, I found duplicate values in this table W_GL_REVN_F. But, how can I rectify it. I did some engineering, but failed.
    please tell me the steps to acheive....
    Thanks in advance..
    Stone

    Hi, Please see the answers (in bold) below.
    1. ANOMALY INFO::: Error while executing : TRUNCATE TABLE:W_SALES_BOOKING_LINE_F
    MESSAGE:::com.siebel.etl.database.IllegalSQLQueryException: DataWarehouse:TRUNCATE TABLE W_SALES_BOOKING_LINE_F
    ORA-00054: resource busy and acquire with NOWAIT specified or timeout expired
    --I checked W_SALES_BOOKING_LINE_F, it contain s data.
    Just restart the load, It seems like your DB processes are busy and the table still has a  lock on it which means something is not yet Commited/Rolled Back.
    If this issue repeats you can mail your DBA and ask him to look in to the issue
    2. ANOMALY INFO::: Error while executing : CREATE INDEX:W_GL_REVN_F:W_GL_REVN_F_U1
    MESSAGE:::java.lang.Exception: Error while execution : CREATE UNIQUE INDEX
    W_GL_REVN_F_U1
    ON
    W_GL_REVN_F
    INTEGRATION_ID ASC
         ,DATASOURCE_NUM_ID ASC
         NOLOGGING
         with error DataWarehouse:CREATE UNIQUE INDEX
         W_GL_REVN_F_U1
         ON
         W_GL_REVN_F
         INTEGRATION_ID ASC
         ,DATASOURCE_NUM_ID ASC
         NOLOGGING
         ORA-01452: cannot CREATE UNIQUE INDEX; duplicate keys found
         -- Yes, I found duplicate values in this table W_GL_REVN_F. But, how can I rectify it. I did some engineering, but failed.
         please tell me the steps to achieve....
    please execute this sql and get the duplicate values. If the count is less you can delete the records based on ROW_WID
    How  many duplicates do you have in total?
    *1. SELECT INTEGRATION_ID,DATASOURCE_NUM_ID,count(*) FROM W_GL_REVN_F*
    GROUP BY INTEGRATION_ID, DATASOURCE_NUM_ID
    HAVING COUNT()>1*
    *2. SELECT ROW_WID,DATASOURCE_NUM_ID,INTEGRATION_ID FROM W_GL_REVN_F*
    WHERE INTEGRATION_ID= (from 1st query)
    *3. DELETE from W_GL_REVN_F where ROW_WID=( from 2nd query)*
    Hope this helps !!

  • JBO-26030 and ORA-00054 error when updating a certain row

    I have a page that saves data when you leave a cell in a table. Everything seems to work fine, but when you get to some cells the JBO-26030 error pops up and then no matter what you do you can't ever save anything on that cell. You can close everything down and reopen and change other cells, but when you go back to that cell the error message always pops up. I think it's mainly happening on the cell that is a drop down with 3 values (P, F, and NT). P is the value and key for the drop down.
    Then when I go into the database through Toad I try to change the value just so see what happens and that's when I get the ORA-00054: resource busy and acquire with NOWAIT specified error. This again only happens when editing that row.
    Any help is appreciated...Thanks!
    Edited by: user10942416 on Aug 6, 2009 6:16 AM

    This error is caused when the block property 'DML returning values' equals YES. This property was introduced as of forms 6. What does it do ? As per the on-line help of Forms, "A database update or insert action may initiate server-side triggers that cause alterations or additional changes in the data. In Release 6, when using an Oracle8 database server, Forms uses the DML Returning clause to immediately bring back any such changes. When this property is set to Yes, Forms will automatically update the client-side version of the data, and the user will not need to re-query the database to obtain the changed values". When this property is switched to yes the generated insert/update statement will contain the 'returning clause' and this clause is causing the error.
    As far as I have tested, the only way at present, to get rid of this error is to set 'DML returing values' to NO. So, not to use this functionality.
    See also:
    http://support.oracle.co.uk/metalink/plsql/ml2_documents.showFrameDocument?p_database_id=NOT&p_id=143395.1
    Please respond if this solution works for you.
    Greets,
    Guido Zeelen

  • SQL*Loader and ORA-00054

    I was wondering if anyone knows a way to prevent ORA-00054 errors on tables when using SQL*Loader. I'm currently invoking scripts that extract data from a source system and load into a table in my database. I'm concurrently invoking the script because I have multiple source systems to improve my overall time for the loads. Sometimes, I get failures on the loads due to ORA-00054 errors. Can this be prevented? Is these a WAIT command/option that can be turned on for SQL*Loader?

    desc toto
    Name Null? Type
    COL1 DATE
    Controlfile :
    load data
    infile 'titi.dat'
    truncate
    into table titi
    (col1 position(1:7) DATE "YYYYMMDD" "DECODE (:col1, '9999999','19990101','000000
    0',null,:col1 + 19000000)")
    Indeed, the input format date is SYYMMDD where S=0 if year=19xx and S=1 if Year=20xx.
    Thanks for your reply.

  • Dropping Table: ORA-00054

    When going to drop a table in a particular schema, I receive the following error:
    ORA-00054: resource busy and acquire with NOWAIT specified.
    My command:
    drop table schema1.table1;
    I've tried the above drop command several times. No matter what, I keep on getting the same error. How can I successfully drop this table? I also tried logging out & back into my toad session.

    Looks like you were having quite some trouble with your toad connections. This one and the other insert problem.
    Try Oracle SQL Developer and/or SQLPLUS
    Not only there are native Oracle products, but also they are free to use with your database.
    http://www.oracle.com/technology/products/database/sql_developer/index.html

  • Can't drop text index (ORA-00054: resource busy) - causes?

    Thanks, you were right! It works now, but I have another issue. I only added about 75 MB of PDFs (20 files) into my table, and indexed it. Indexing took about 4 minutes. But now, whenever I try to drop the index, I get this error:
    ORA-00054: resource busy and acquire with NOWAIT specified
    I tried waiting an hour, and it still gives me the error - it really shouldn't be doing anything. Would a memory or storage space issue cause this? I'd appreciate any help you could give. Thanks.

    Try drop index <name> force

  • Cannot drop table (error ORA-00054)

    I am trying to drop a table but get an "ORA-00054 Resource busy and acquire with NOWAIT specified". Previously I had created this table and run a join which I cancelled because it was taking too long and obviously not doing what I wanted. Now I can't get rid of the table, even with sysdba privileges and re-starting the machine running the database.
    Can anyone help?

    It looks like your table got locked. Do you see any locks in your database on this table? I also, suggest you to close or kill the session which was cancled due to long running join condition, as you said in your question.

  • How can I enable a constraint even ORA-00054

    Dear,
    ALTER TABLE CLC_TRM_DTS_ATRBT
    MODIFY CONSTRAINT CLC_TRM_DTS_ATRBT_02_FK ENABLE;
    ORA-00054: resource busy and acquire with NOWAIT specified or timeout expired.
    Any way to enable the constraint even any uncommited session or locked?
    Regards

    It is possible, for a busy database, that you will NEVER get the lock you need to enable the constraint. Just because one transaction finishes does not mean that another has not already started. Even a loop as Mr Chitale suggests may never succeed.
    The answer is to quiesce the database with ALTER SYSTEM QUIESCE RESTRICTED. It will hang until all active sessions have committed while preventing inactive sessions from waking up. Then kick off your ENABLE command, and in another session UNQUIESCE. This can be very quick, and your users may not even notice: their sessions will just appear to hang for a couple of seconds.
    John Watson
    Oracle Certified Master DBA

  • Adding default constraint causes ORA-00054: resource busy

    Hi,
    i ran a script and got error below. Why am i getting error "ORA-00054: resource busy" when adding a default constraint to table? On other evironments such error didn't occure, only in particualr special one the error occured.
    Is it possible that table has too much traffic/locks i nthat environment? How can i rewrite my script?
    Should i instal lthe script in OFFLINE mode?
    In Oracle 11g, Linux Os i runned such script (in Online mode, system not offline):
    ALTER TABLE Casino.Physicaltables ADD WinnerListEnabled NUMBER(1);
    COMMENT ON COLUMN Casino.Physicaltables.WinnerListEnabled  IS '<BOOLEAN> Defines if winner list is turned on or off.';
    ALTER TABLE Casino.Physicaltables MODIFY WinnerListEnabled DEFAULT 0;
    ALTER TABLE Casino.Physicaltables MODIFY (WinnerListEnabled CONSTRAINT NC_Pts_WinnerListEnabled NOT NULL NOVALIDATE);
    UPDATE Casino.Physicaltables SET WinnerListEnabled = 0 WHERE WinnerListEnabled IS NULL;
    COMMIT;
    ALTER TABLE Casino.Physicaltables MODIFY CONSTRAINT NC_Pts_WinnerListEnabled ENABLE VALIDATE;And output was such:
    \\dserver\Live\release\12.6\0.10\sql\live_sql_12.4.0.5_to_12.6.0.10.zip
    Elapsed: 00:00:00.09
    ALTER TABLE Casino.Physicaltables MODIFY WinnerListEnabled DEFAULT 0
    ERROR at line 1:
    ORA-00054: resource busy and acquire with NOWAIT specified

    Any DDL will cause an exclusive lock on the corresponding record in the dictionary. The error message indicates the object is in use by someone else.
    Solutions:
    1 Apply the code in a maintenance window when no one is there. DDL should NOT be run in a live system during production.
    2 Put the database in restricted mode, provided no one has the restricted session privilege
    3 Make sure your application uses a non-default service (ie service <> database name) and shut down that service using srvctl and/or dbms_service.
    There is no such thing as 'OFFLINE mode'
    Sybrand Bakker
    Senior Oracle DBA

  • Record locking message on ORA-00054

    I have a block based on a view which has an on-lock trigger to perform custom row-locking. (select for update nowait)
    All works fine, except for the fact that i want to display the standard "keep trying" message when my on-lock procedure gets the ora-00054 exception. Is there any builtin to call to produce this message without the use of custom alerts ?
    thanks,
    Maarten

    I sure don't think there is any way to get Oracle to raise the standard alert. And there are two of them, by the way, "FRM-40657: Record changed or deleted by another user"
    amd "FRM-40501: ORACLE error- unable to reserve record for update or delete".

  • ORA-00054 - Find user who have lock

    Hi,
    I'm using "select for update NOWAIT" in my application for editing records. It works but after I catch ORA-00054 I want to find username who have the lock.
    The basic step is propably to query view v$lock and propably after then some else view.
    Thanks for any idea/solution
    SASA

    You'll need to scroll down a while to get to your particular question in the thread I linked... I believe it's about a third of the way down.
    It is not possible to know who is locking a particular row unless there are two sessions that are blocking each other. If session 1 has a lock on a particular row and session 2 requests a lock on that same row and session 2 is waiting for that lock to free up, session 3 can query the v$lock table to see which session holds the lock and which session is waiting for the lock. Assuming everyone is logging in with their own user name, you can join this information with v$session to find out the username of the person holding the lock. In your case, though, no session is ever blocked, so you cannot determine who owns the lock.
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • Error msg ORA-00054

    Hi,
    I'm getting the error msg ORA-00054: resource busy and aquire with NOWAIT specified. This happens when I'm trying to delete a table.

    use to detect who's locking the table:
    select S.SID,Q.SQL_TEXT
    from V$LOCK L, V$SESSION S, V$SQLAREA Q
    where L.BLOCK = 1
    and S.SID = L.SID
    and S.SADDR = Q.ADDRESS;

  • Not closing ResultSet, but not getting ORA-01000

    I have an application that is generating the familiar ORA-01000 error.
    Whilst investigating the problem, I wrote a small test program. In the test program I tried to get the ORA-01000, but I don't get it (has anyone ever complained about not getting ORA-01000 before?!)
    connection = DriverManager.getConnection("<connection string>");
    String sql = "SELECT c1 FROM pdtab2 WHERE Id>=? AND Id<=?";
    PreparedStatement ps = connection.prepareStatement(sql);
    for (int i = 1; i <= 30000; ++i)
        ps.setInt(1, i-1);
        ps.setInt(2, i+1);
        if (i % 100 == 0)
            System.out.println("i=" +i);
            System.out.println("getCurrentOpenCursors(connection)="
                               +getCurrentOpenCursors(connection));
        try
            rs = ps.executeQuery();
            while (rs.next())
                result = rs.getInt(1);
        catch (SQLException e2)
            e2.printStackTrace();
        finally
            // Do nothing! Do not close the result set
    }getCurrentOpenCursors does:
    select count(*) AS COUNT from v$open_cursor where user_name like 'me'
    I have reduced OPEN_CURSORS down from 300 to 100, but getCurrentOpenCursors always returns less that what it is set to. Suggesting that OPEN_CUSRORS is not a limit, but rather a pool size?
    The result set returns more than one record, I never close the result set, yet I do not get an ORA-01000 error. I have tried auto-commit true and false on the connection. Is the prepared statement closing its previous result set on each new iteration of the loop, hence stopping me getting a problem?
    I am using Oracle version 10.2.0.1, the corresponding ojdbc14.jar, and Java 1.4.
    Thanks,
    Paul

    Here is a program that does that for you.
    To fix the program, un-comment the line 24 of the code and run again.
    C:\> type TestCursors.java
    import java.lang.* ;
    import java.util.* ;
    import java.sql.* ;
    import oracle.jdbc.* ;
    public class TestCursors
        public static void main(String[] args) throws SQLException, ClassNotFoundException
            Class.forName("oracle.jdbc.driver.OracleDriver");
            Connection connection = DriverManager.getConnection("jdbc:oracle:oci:@localhost:1521:ORCL");
            ResultSet rs ;
            PreparedStatement ps ;
            for (int i = 1; i <= 30000; ++i)
                String sql = "SELECT 20 FROM scott.emp WHERE deptno = ?";
                ps = connection.prepareStatement(sql);
                ps.setInt(1, 10);
                try
                    rs = ps.executeQuery();
                    rs.close() ;
                    //ps.close() ;
                catch (SQLException e2)
                    System.out.println("The value if i is " + i) ;
                    throw e2 ;
    C:\> javac TestCursors.java
    C:\> java TestCursors
    The value if i is 301
    Exception in thread "main" java.sql.SQLException: ORA-01000: maximum open cursors exceeded
            at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:111)
            at oracle.jdbc.driver.T2CConnection.checkError(T2CConnection.java:671)
            at oracle.jdbc.driver.T2CConnection.checkError(T2CConnection.java:597)
            at oracle.jdbc.driver.T2CPreparedStatement.executeForDescribe(T2CPreparedStatement.java:570)
            at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1030)
            at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1123)
            at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3284)
            at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3328)
            at TestCursors.main(TestCursors.java:22)
    C:\>

  • While trying to change password getting ora-00600 [4842] - Plz help

    while trying to change password getting ora-00600 [4842] - Plz help
    database : 9.2.0.4
    o/s : Linux

    Hi,
    when getting an ORA-600 you always should contact Oracle support please ;-)
    To diagnose an ORA-600 the stack trace will be necessary - see the trace file mentioned in the alert.log when the ORA-600 did happen.
    But FIRST OF ALL you should definitely apply patch set 9.2.0.8 and see if this error happens again (metalink.oracle.com ==> PATCHES ==> Quick Links ==> <your platform>). Support will ask you to do the same before they start diagnosing anything in this case.
    And please keep in mind that 9.2.0 has reached end of Premier Support more than 1 year ago.
    Kind regards
    Mike

Maybe you are looking for

  • Jdk 1.2 clients running ejb deployed on oracle 8.1.5

    Oracle claims that it is possible to run jdk 1.2 clients with ejb on oracle 8.1.5 in the faq : http://technet.oracle.com/products/oracle8i/htdocs/jserver_faq/815faq0012.html If you have JDK1.2 on the client side and: 8.1.5 clients connecting to an 8.

  • Printer to be used in DSD application

    Hi, My client is using HP printers right now with an legacy application instaled on Palm Devices. They print using Bluetooth. We are developing MDSD application for them and want to know about the devices which we can use. We are at MI 7.0 sp16. Will

  • Apple apps freezes after upgrading to Yosemite

    Dear Apple community, I have been running Yosemite (10.10.2) on an iMac 21.5 inch late 2009 model, 2TB HD, 3.06 GHz Intel Core 2 duo with 16Gb RAM for the last 1 month.  No major hiccups. Just today I was not able to make any selections on the menu b

  • Problem in opening the package indesign

    Hi guys, need help one of my client having problems in opening the indd package I have sent to them via ftp, the files are compressed in a zip file. Then I try to download the zip package, it opens and works well. I'm using CS3 windows base by the wa

  • How to Attach a File Without Embedding It on Mail?

    How to Attach a File Without Embedding It on a Mac? Tamer is not working and I prefer not to use TERMINAL (defaults write com.apple.mail DisableInlineAttachmentViewing -bool yes) Right click send as icon is not a solution. Any other options? Thanks!