From:Steve Adams
Date:16-May-2001 16:13
Subject:   ORA-54 when the row is not locked

Yes, this can be caused by an ITL entry shortage. Let me demonstrate. This test database has a 2K block size. I'll create a table with two rows on the same block, but without enough space to dynamically allocate a second ITL entry in that block. Then I'll lock one of those rows, in the same session thereby using the only available ITL slot.

        SQL> create table t (n number, pad char(960)) pctfree 0;

        Table created.

        SQL> insert into t values (1, '1');

        1 row created.

        SQL> insert into t values (2, '2');

        1 row created.

        SQL> commit;

        Commit complete.

        SQL> select n from t where n = 1 for update nowait;

                 N
        ----------
                 1

        SQL>
OK, now I'll try to lock the other row in a different session ...
        SQL> select n from t where n = 2 for update nowait;
        select n from t where n = 2 for update nowait
                      *
        ERROR at line 1:
        ORA-00054: resource busy and acquire with NOWAIT specified


        SQL>
You need to rebuild your table with a slightly bigger PCTFREE allowance to avoid future occurrences of this error.

We are encountering ORA-54 errors when we clearly know that the said rows are not locked by any other user process. This happens when we do SELECT FOR UPDATE NOWAIT. We get hundreds of these on a single day. When we re-try after a second, we succeed for 90 percent of them but still fail for some. Is there any other reason (other than the row being locked by another process) to receive this error?