Unix Technical Forum

Deadlock resolution

This is a discussion on Deadlock resolution within the Oracle Database forums, part of the Database Server Software category; --> Are there any tips & tricks folks have for resolving deadlocks reported in the alert log files? Currently on ...


Go Back   Unix Technical Forum > Database Server Software > Oracle Database

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-23-2008, 07:58 AM
Jeremy
 
Posts: n/a
Default Deadlock resolution

Are there any tips & tricks folks have for resolving deadlocks reported
in the alert log files?

Currently on 8.1.7.4


--

jeremy
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-23-2008, 07:59 AM
Daniel Morgan
 
Posts: n/a
Default Re: Deadlock resolution

Jeremy wrote:

> Are there any tips & tricks folks have for resolving deadlocks reported
> in the alert log files?
>
> Currently on 8.1.7.4


Design better schemas and write better code.

Deadlocks in a properly designed schema in which appropriate code
is written are so rare as to be almost unworthy of comment.

The first thing to ask is "What is causing the deadlocks"? What
business process is being supported by what code?

--
Daniel Morgan
http://www.outreach.washington.edu/e...ad/oad_crs.asp
http://www.outreach.washington.edu/e...oa/aoa_crs.asp
damorgan@x.washington.edu
(replace 'x' with a 'u' to reply)

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-23-2008, 08:02 AM
srivenu
 
Posts: n/a
Default Re: Deadlock resolution

The dead lock graph in the trace file will give you an idea which
tables are involved in the dead lock.
Also you can write a SERVERERROR trigger to catch more info during the
dead lock error.
regards
Srivenu
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-23-2008, 08:04 AM
Galen Boyer
 
Posts: n/a
Default Re: Deadlock resolution

On Mon, 16 Feb 2004, newspostings@hazelweb.co.uk wrote:
> Are there any tips & tricks folks have for resolving deadlocks
> reported in the alert log files?
>
> Currently on 8.1.7.4


I've found that you have to walk through you database access code
and make sure you've ordered all access the same way. If you
have implemented subtypes within your database design, these can
cause deadlock headaches as well.

The hard thing is that Oracle doesn't tell you what objects were
involved in the deadlock, and it can be anything.

Good luck. Your codebase will be more solid when you solve it.
It should invariably be an application design/coding issue.

--
Galen Boyer
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 02-23-2008, 08:05 AM
Sybrand Bakker
 
Posts: n/a
Default Re: Deadlock resolution

On 19 Feb 2004 11:12:17 -0600, Galen Boyer <galenboyer@hotpop.com>
wrote:

>The hard thing is that Oracle doesn't tell you what objects were
>involved in the deadlock, and it can be anything.


I don't think this is true. Ora-060 will always result in a trace file
with detailed info about open cursors, lockmodes etc.


--
Sybrand Bakker, Senior Oracle DBA
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 02-23-2008, 08:05 AM
Galen Boyer
 
Posts: n/a
Default Re: Deadlock resolution

On Thu, 19 Feb 2004, gooiditweg@sybrandb.demon.nl wrote:
> On 19 Feb 2004 11:12:17 -0600, Galen Boyer
> <galenboyer@hotpop.com> wrote:
>
>>The hard thing is that Oracle doesn't tell you what objects
>>were involved in the deadlock, and it can be anything.

>
> I don't think this is true. Ora-060 will always result in a
> trace file with detailed info about open cursors, lockmodes
> etc.


Hm... Sets up a deadlock situation... Looks at trace file.

I'll be damned. I solved an insidious deadlocking issue a few
weeks ago and didn't use that info. How many times do I have to
tell myself, just look at the trace file you dummy!

--
Galen Boyer
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 02-23-2008, 08:05 AM
Howard J. Rogers
 
Posts: n/a
Default Re: Deadlock resolution


"Galen Boyer" <galenboyer@hotpop.com> wrote in message
news:ud68asvld.fsf@standardandpoors.com...
> On Thu, 19 Feb 2004, gooiditweg@sybrandb.demon.nl wrote:
> > On 19 Feb 2004 11:12:17 -0600, Galen Boyer
> > <galenboyer@hotpop.com> wrote:
> >
> >>The hard thing is that Oracle doesn't tell you what objects
> >>were involved in the deadlock, and it can be anything.

> >
> > I don't think this is true. Ora-060 will always result in a
> > trace file with detailed info about open cursors, lockmodes
> > etc.

>
> Hm... Sets up a deadlock situation... Looks at trace file.
>
> I'll be damned. I solved an insidious deadlocking issue a few
> weeks ago and didn't use that info. How many times do I have to
> tell myself, just look at the trace file you dummy!
>
> --
> Galen Boyer



LOL! I remember the first time I got the "instance terminated disconnection
forced' error message with 9i... panic! terror!... bloody Linux!!.. I
thought I must have done the Linux or Oracle installs wrong, so was about to
re-install the lot... when I thought, "hang on, let's just look at the alert
log" -it's what I always drill into students, after all. Sure enough:
incorrect undo tablespace name. Phew!

Regards
HJR
--
--------------------------------------------
Oracle Insights: www.dizwell.com
--------------------------------------------


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 02-23-2008, 08:05 AM
Galen Boyer
 
Posts: n/a
Default Re: Deadlock resolution

On Fri, 20 Feb 2004, hjr@dizwell.com wrote:
>
> "Galen Boyer" <galenboyer@hotpop.com> wrote in message
> news:ud68asvld.fsf@standardandpoors.com...
>> On Thu, 19 Feb 2004, gooiditweg@sybrandb.demon.nl wrote:
>> > On 19 Feb 2004 11:12:17 -0600, Galen Boyer
>> > <galenboyer@hotpop.com> wrote:
>> >
>> >>The hard thing is that Oracle doesn't tell you what objects
>> >>were involved in the deadlock, and it can be anything.
>> >
>> > I don't think this is true. Ora-060 will always result in a
>> > trace file with detailed info about open cursors, lockmodes
>> > etc.

>>
>> Hm... Sets up a deadlock situation... Looks at trace file.
>>
>> I'll be damned. I solved an insidious deadlocking issue a few
>> weeks ago and didn't use that info. How many times do I have
>> to tell myself, just look at the trace file you dummy!
>>
>> --
>> Galen Boyer

>
>
> LOL! I remember the first time I got the "instance terminated
> disconnection forced' error message with 9i... panic!
> terror!... bloody Linux!!.. I thought I must have done the
> Linux or Oracle installs wrong, so was about to re-install the
> lot... when I thought, "hang on, let's just look at the alert
> log" -it's what I always drill into students, after all. Sure
> enough: incorrect undo tablespace name. Phew!


I wish I was able to join in with the "Phew", but alas, I did it
the old-fashioned way, I tried, cussed, tried something else,
cussed some more, tried something else, blamed someone who left
the company, tried something else, went for coffee...

--
Galen Boyer
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 02-23-2008, 08:09 AM
Keith Jamieson
 
Posts: n/a
Default Re: Deadlock resolution

Make sure you have your foreign keys indexed. Unindexed foreign keys are a
major cause of deadlocks.


"Jeremy" <newspostings@hazelweb.co.uk> wrote in message
news:MPG.1a9af9c43efcadbb989aba@news.individual.ne t...
> Are there any tips & tricks folks have for resolving deadlocks reported
> in the alert log files?
>
> Currently on 8.1.7.4
>
>
> --
>
> jeremy



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 07:39 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com