DBAtlas · Database operations atlas

ORA-00060: Deadlock detected while waiting for resource

Oracle

What does it mean?

Two or more sessions are deadlocked, each waiting for a resource held by the other. Oracle detects the cycle, picks a victim and rolls back that session's statement.

Why does it happen?

Row locks acquired in different orders, the same rows updated crosswise by different transactions, table locks on parent table updates caused by unindexed foreign keys, or concurrent DML on a bitmap index.

How to fix it

Examine the deadlock trace (graph) file referenced in the alert log to find the conflicting SQL statements and rows. In the application, always access tables/rows in the same order. Index foreign key columns (unindexed FKs are a classic deadlock cause). Keep transactions short and review commit frequency. Catch the deadlocked transaction in the application and retry it.

Open in DBAtlas →

More from this engine