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

Home -> Community -> Usenet -> c.d.o.server -> Re: How, specifically, can I find out the cause of deadlock from a trace file?

Re: How, specifically, can I find out the cause of deadlock from a trace file?

From: Chuck <skilover_nospam_at_bluebottle.com>
Date: Tue, 16 May 2006 17:09:09 GMT
Message-ID: <VGnag.6822$UY6.1805@trnddc08>


theRat wrote:
> Hello all,
>
> my multi-threaded application is having deadlock problems. Oracle is
> creating trace files for me whenever this happens. I can see from the
> trace file what SQL each thread is executing at the time the deadlock
> occurs - but this isn't enough information for me to actually figure
> out why the deadlock is occurring.
>
> Is there a resource out there that can tell me how to interpret these
> files. In particular, each trace file shows a "deadlock graph".
> Here's mine:
>
> Deadlock graph:
> ---------Blocker(s)--------
> ---------Waiter(s)---------
> Resource Name process session holds waits process session
> holds waits
> TX-00500015-00000434 112 13 X 93 98
> S
> TX-00630018-00000357 93 98 X 45 39
> S
> TX-00500015-00000434 45 39 X 112 13
> X
> session 13: DID 0001-0070-00004B10 session 98: DID
> 0001-005D-00007059
> session 98: DID 0001-005D-00007059 session 39: DID
> 0001-002D-0000C4BA
> session 39: DID 0001-002D-0000C4BA session 13: DID
> 0001-0070-00004B10
> Rows waited on:
> Session 98: no row
> Session 39: no row
> Session 13: obj - rowid = 00008DB5 - AAAI21AANAAAF+SAAS
> (dictionary objn - 36277, file - 13, block - 24466, slot - 18)
>
> Is there a way for me to find out what these "resources" are? From the
> above, I can see that session 98 is waiting for session 13, and session
> 13 is waiting on session 39, and session 39 is waiting on session 98 -
> but I can't figure out which resources are involved... How can I
> determine this?
>
> If anyone knows the answer or can point me to a document, I'd really
> appreciated it.
>
> Thanks!
>
> -john
>

Deadlocks are usually caused by two pieces of code that update the same tables but in a different order. Make sure any code that updates the same multiple tables as another piece of code does so in exactly the same order. If it's really a "multi-threaded application" then that's most like the problem. If however it's an application running against an Oracle instance that's in multi-threaded server mode, (now called shared server architecture), depending on the verision of oracle, Oracle itself can cause deadlocks. Received on Tue May 16 2006 - 12:09:09 CDT

Original text of this message

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