Description:
ORA-30006 and ORA-00054 errors raised when update operation is performed against a record, that has been locked by the user or some session FOR UPDATE.
To fix this, before performing the update, check whether the record is locked or not. Simple way to check this is,
declare
l_invoice_num varchar2(100);
begin
select invoice_num into l_invoice_num
from apps.ap_invoices_all
where invoice_num = ‘TEST123’
for update skip locked;
<do your update process against the invoice in AP_INVOICES_ALL table>;
exception
when no_data_update;
<do not perform update>;
end;
The select script will return NO_DATA_FOUND exception, if invoice number ‘TEST123’ is locked FOR UPDATE and will exit the update process.
Summary:
Error ORA-00054 is a commonly seen error by Oracle users. It occurs when a user tries to execute a LOCK TABLE or SELECT FOR UPDATE command with the NOWAIT keyword when the resource is unavailable. DDL or DML operations are being run concurrently without proper commits. In most cases, Error ORA-00054? Occurs from a session. Any session that has referenced the table and any structural change attempt, such as adding a column, requires an “exclusive” lock.
Queries?
Do drop a note by writing us at doyen.ebiz@gmail.com or use the comment section below to ask your questions