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
- 1Step 1: Find the blocking session: `SELECT sid, serial#, username, status FROM v$session WHERE blocking_session IS NOT NULL;`.
- 2Step 2: Kill the blocking session if safe: `ALTER SYSTEM KILL SESSION 'sid,serial#' IMMEDIATE;`.
- 3Step 3: Schedule DDL operations (TRUNCATE, DROP, ALTER) in a maintenance window with no active writers.
- 4Step 4: Replace TRUNCATE+INSERT with a DELETE+INSERT inside a transaction to avoid DDL locking.
- 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