ORA-00060: Deadlock detected while waiting for resource
OracleWhat 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.
More from this engine
- ORA-00001Unique constraint violated
- ORA-00054Resource busy and acquire with NOWAIT specified or timeout expired
- ORA-01017Invalid username/password; logon denied
- ORA-01555Snapshot too old: rollback segment number too small
- ORA-01652Unable to extend temp segment by N in tablespace
- ORA-04031Unable to allocate N bytes of shared memory