MetricSign
Start free
High severitylocking

Oracle Database Error:
ORA-00054

What does this error mean?

A DDL statement (ALTER TABLE, TRUNCATE, DROP) or a NOWAIT lock request could not acquire the required lock because another session holds it.

Common causes

  • 1Pipeline runs a TRUNCATE while an active DML session holds a row lock
  • 2Concurrent pipelines target the same table simultaneously
  • 3A previous pipeline session was left open and holds a lock
  • 4DDL migration script runs during business hours when writers are active

How to fix it

  1. 1Step 1: Find the blocking session: `SELECT sid, serial#, username, status FROM v$session WHERE blocking_session IS NOT NULL;`.
  2. 2Step 2: Kill the blocking session if safe: `ALTER SYSTEM KILL SESSION 'sid,serial#' IMMEDIATE;`.
  3. 3Step 3: Schedule DDL operations (TRUNCATE, DROP, ALTER) in a maintenance window with no active writers.
  4. 4Step 4: Replace TRUNCATE+INSERT with a DELETE+INSERT inside a transaction to avoid DDL locking.
  5. 5Step 5: Add retry logic with a short delay to pipeline code that hits this error.

Example log output

ORA-00054: resource busy and acquire with NOWAIT specified or timeout expired

Frequently asked questions

Can I avoid ORA-00054 without killing sessions?

Yes — use WAIT N instead of NOWAIT in your lock request, or restructure the pipeline to avoid DDL operations on live tables (use staging tables and atomic renames instead).

Source · docs.oracle.com/error-help/db/ora-00054

Other locking errors