Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: Deadlock problem

RE: Deadlock problem

From: Alessandro Vercelli <alever_at_libero.it>
Date: Wed, 10 May 2006 15:00:54 +0200
Message-Id: <IZ1W5I$C0E8E9BC9A93C0A5FD65F31D4292BE80@libero.it>


Sorry for the wrong trace file: here is the correct one:

The indexes are periodically rebuilded.

Thanks for your help,

Alessandro

> Hi Alessandro,
>
> First off, this is an ORA-0060, not an ORA-4020. (ORA-60 is an enqueue
> deadlock, ORA-4020 is a library cache deadlock.)
>
> Second, it's a TX (transaction enqueue) deadlock.
>
> Third, the mode held by the blocker and the mode held by the waiter are
> 'X' (exclusive).
>
> Fourth, the statement encountering the deadlock is an UPDATE.
>
> So, the combination of the above info tells me that this is a row-level
> application deadlock. You've got two concurrent sessions, one session
> updates row X and does not commit. Another session updates row Y and
> does not commit. Then, the first session tries updating row Y and
> starts waiting on the second session, and finally, the second session
> tries to update row X and starts waiting on the first session. In this
> state, the sessions would wait forever, so, Oracle detects a deadlock,
> raises ORA-0060, and statement level rollback occurs.
>
> I don't know anything about your application, however, the cleanest
> solution would be to examine the application logic, and alter as
> necessary to ensure that two concurrent sessions do not attempt to
> update the same set of rows. Also, another possiblility, which would
> still suffer from slowdowns due to TX enqueue waits, but not deadlocks,
> would be to ensure that the order that rows are updated is the same in
> all the concurrent sessions.
>
> Hope that helps,
>
> -Mark
>
>
>
>
> --
> Mark J. Bobak
> Senior Oracle Architect
> ProQuest Information & Learning
>
> For a successful technology, reality must take precedence over public
> relations, for Nature cannot be fooled. --Richard P. Feynman, 1918-1988
>
>
> -----Original Message-----
> From: oracle-l-bounce_at_freelists.org
> [mailto:oracle-l-bounce_at_freelists.org] On Behalf Of Alessandro Vercelli
> Sent: Monday, May 08, 2006 1:34 PM
> To: Oracle Freelists.org
> Subject: [SPAM] Deadlock problem
> Importance: Low
>
> Hi all,
> I'm trying to solve an ora-4020 (deadlock) issue; the trace file (sorry
> if messed) shows:
>
> ksqded1: deadlock detected via did
> DEADLOCK DETECTED
> Current SQL statement for this session:
> Update <TABLE> set <FIELD1>='<VALUE>' where <FIELD2> like '<STRING>%'
> The following deadlock is not an ORACLE error. It is a deadlock due to

--
http://www.freelists.org/webpage/oracle-l
Received on Wed May 10 2006 - 08:00:54 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US