Being Open-minded

Doug's Oracle Blog

  • Home
  • Papers
  • Books
  • C.V.
  • Fun
  • Oracle Blog
  • Personal Blog

Jul 10: Being Open-minded

I think that one of the most important skills of a good DBA and one of the most difficult to maintain as your experience grows is to stay open-minded.


When I got into work this morning, there was an email waiting for me from a frustrated developer who wanted to know why one of the production batch jobs had failed twice in the past week with an ORA-00060 Deadlock detected error. He'd asked around a number of DBAs and wasn't getting too much joy out of them. I can understand that because deadlocks are normally down to poor application code and there's little a DBA can do to fix that after the fact. I said I'd see what I could do, though, and dug out the trace file that's generated automatically to have a look.


I emailed him the trace file with my comments. That's another thing that DBAs don't do often enough in my opinion - give the user more technical information so that they become more informed themselves and be part of any decision making. If your customers are developers then, the usual jokes aside, they're not usually idiots and should be able to understand well-explained fundamentals. This particular developer really appreciated the chance to see the trace file and it was no effort at all for me to supply it. It also helped that I could show him this section of the trace file ;-)

The following deadlock is not an ORACLE error. It is a
deadlock due to user error in the design of an application
or from issuing incorrect ad-hoc SQL. The following
information may aid in determining the deadlock:
I admit my comments were very much along the lines of 'Not an Oracle problem .... bad application code .... Oracle will tell you the same.' I offered to open an SR with Oracle support though because this is an important job and saying 'bad code - tough' isn't a reasonable response.


However, as I looked at the trace file, this section bothered me ...


Deadlock graph:
---------Blocker(s)-------- ---------Waiter(s)---------
Resource Name process session holds waits process session holds waits
TX-00310008-00004b13 43 847 X 47 649 S
TX-0027002d-000133e7 47 649 X 43 847 S
If the code was at fault, I expected to see both sessions waiting on an X mode lock, but instead they were both waiting on S mode. I thought about it some more, did some more research on Metalink and thought about the batch job, which is run as 6 concurrent streams.


Eventually I started to suspect that this might be an ITL deadlock, as described in Metalink Note 62354.1. Oracle Support also suggested this might be the issue so this afternoon I used


alter table table1 move initrans 6;
alter index index1 rebuild online;
alter index index2 rebuild online;

and we'll see if we've fixed the problem.


Missing information added later .... This is a 9.2.0.7 instance and the value of INITRANS prior to the fix was? the default of 1. PCTFREE was left at the default value of 10, but might be increased later if this is an ongoing problem.?


Interestingly, when I was hunting around on Google for more info, a certain lilac-suited gentleman showed up. I'm sure he'll be delighted to be near the top of the list for something technical ;-) However, it's a shame I didn't remember these blogs before working this out for myself ....

Posted by Doug Burns Comments: (6) Trackbacks: (2)

Trackbacks
Trackback specific URI for this entry

PingBack
Weblog: www.asktherealtom.ch
Tracked: Oct 12, 14:11
Not all Deadlocks are created the same
I've blogged about deadlocks in Oracle at least once before. I said then that although the following message in deadlock trace files is usually true, it isn't always. The following deadlock is not an Oracle error. Deadlocks of  this type can b
Weblog: Doug's Oracle Blog
Tracked: Mar 11, 02:04

Comments
Display comments as (Linear | Threaded)

#1 - Pete_S said:
2006-07-10 20:28 - (Reply)

We took the initrans route and have been deadlock free since Feb - and we used to get two or three a week. I had another couple of possible 'fixes' up my sleve - increasing the PCTFREE value as I suspected my problem was caused by the average row length increasing from 10 to 28 in the batch and the block becoming full, or more drasticaly converting the table to an IOT to force likely concurrent transactions to hit different blocks. But certainly initrans is simple and needs less test ;-)

BTW we dw types can do other stuff too - - not bad for a non-dba huh?

#2 - Doug Burns said:
2006-07-10 23:44 - (Reply)

"increasing the PCTFREE value as I suspected my problem was caused by the average row length increasing from 10 to 28 in the batch and the block becoming full"

That's definitely at the core of the problem too but we're going to evaluate that properly next. The alter table move increased the free space in the block for now.

"BTW we dw types can do other stuff too - - not bad for a non-dba huh?"

Indeed! But that also adds weight to my argument. You do straight DBA work too but you wouldn't call yourself a DBA, right? I do a bit of DW work but that's no reason to call myself a DW DBA ;-)

Get back to your own corner ;-)

#3 - Pete_S said:
2006-07-11 11:31 - (Reply)

...The alter table move increased the free space in the block for now...
- you need to watch out for the move hiding the problem and the initrans fixing it. Just a move alone is likely to give some respite from deadlocks as the table is reorganised. Which is why we gave it a month or so to see if the problem came back

#4 - Doug Burns 2006-07-11 11:46 - (Reply)

Yes, thats the plan. We can watch the average row length and see how it develops before making firm decisions on pctfree. It's slightly re-assuring that this has taken about 9 months to develop into a problem so it should give us some time to work it out properly ...

#5 - PdV said:
2009-03-07 18:42 - (Reply)

We always google-find this post when deadlock occurs... Good Message.

It helped us when we stumbled across deadlocks and a nice new bug, and recently when we had ora-00060 once again.

But in our last case it Really was the Bitmap-index. And it was. Metalink 171795.1. But it took a while to convince others.

And in most deadlock cases, the Oracle error-text is right: Code Logic.

#6 - Doug Burns said:
2009-03-08 06:22 - (Reply)

Piet,

Thanks for adding another possible cause. You're right - lots of people come here via Google, so that will help.

Cheers,

Doug


Add Comment

Standard emoticons like :-) and ;-) are converted to images.
E-Mail addresses will not be displayed and will only be used for E-Mail notifications.
BBCode format allowed
 
 

Statistics on Partitioned Tables

Contents

Part 1 - Default options - GLOBAL AND PARTITION
Part 2 - Estimated Global Stats
Part 3 - Stats Aggregation Problems I
Part 4 - Stats Aggregation Problems II
Part 5 - Minimal Stats Aggregation
Part 6a - COPY_TABLE_STATS - Intro
Part 6b - COPY_TABLE_STATS - Mistakes
Part 6c - COPY_TABLE_STATS - Bugs and Patches
Part 6d - COPY_TABLE_STATS - A Light-bulb Moment
Part 6e - COPY_TABLE_STATS - Bug 10268597

Comments

Doug Burns about 10053 Trace Files - Different Plan in Different Environments
Tue, 02.04.2013 08:57
You're welcome. Now I just nee d to pull my finger out and ac tually come up [...]
Howard Rogers about 10053 Trace Files - Different Plan in Different Environments
Mon, 01.04.2013 23:08
Makes a big difference, so tha nks for that! With two brow ser windows, o [...]
stelioscharalambides.com about 10053 Trace Files
Sat, 30.03.2013 16:28

Upcoming Presentations

Bookmark

Open All | Close All

Syndicate This Blog

  • XML RSS 2.0 feed
  • ATOM/XML ATOM 1.0 feed
  • XML RSS 2.0 Comments
  • Feedburner Feed

Powered by

Serendipity PHP Weblog

Show tagged entries

xml 11g
xml ACE
xml adaptive thresholds
xml ASH
xml Audit Vault
xml AWR
xml Blogging
xml conferences
xml Cuddly Toys
xml Database Refresh
xml DBMS_STATS
xml Direct Path Reads
xml Fun
xml grid control
xml hotsos 2010
xml listener
xml Locking
xml oow
xml oow2009
xml optimiser
xml OTN
xml Parallel
xml Partitions
xml Patching
xml swingbench
xml The Reality Gap
xml time matters
xml ukoug
xml ukoug2009
xml Unix/Shell
xml Useful Links

Disclaimer

For the avoidance of any doubt, all views expressed here are my own and not those of past or current employers, clients, friends, Oracle Corporation, my Mum or, indeed, Flatcat. If you want to sue someone, I suggest you pick on Tigger, but I hope you have a good lawyer. Frankly, I doubt any of the former agree with my views or would want to be associated with them in any way.

Design by Andreas Viklund | Conversion to s9y by Carl