11.2.0.3 Interval Partitioning Constraint Crea ...

Doug's Oracle Blog

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

Jul 29: 11.2.0.3 Interval Partitioning Constraint Creation Bug

A small problem that cropped up on a client site this week which might warrant a quick post to help any Google desperadoes that might find themselves in the same spot, not least because there's an easy workaround.

The existing application schema creation scripts used the following type of syntax to create Primary Key constraints and the underlying index in one shot against Interval Partitioned Tables. (Note, this is a simple test case I created for the Service Request that you should be able to try in other environments.)

CREATE TABLE TEST (PK_COLUMN NUMBER, NON_PK_COLUMN VARCHAR2(30))
PARTITION BY RANGE (PK_COLUMN)
INTERVAL( 1)
(
PARTITION RUN_0 VALUES LESS THAN (1)
);

ALTER TABLE TEST
ADD CONSTRAINT TEST_PK PRIMARY KEY (PK_COLUMN)
USING INDEX (CREATE INDEX TEST_PK ON TEST (PK_COLUMN)
LOCAL);

If you try to run this on an 11.2.0.2 database instance, it works fine. Run it on 11.2.0.3 and you'll get the following error.

ORA-00600: internal error code, arguments: [kkpoxPaxdInit0], [], [], [], [], [], [], [], [], [], [], []

A hunt on My Oracle Support didn't yield much apart from Bug 14230768 which looks like it's at a very early stage of discovery and being fixed. As far as I can tell from my own playing around, this only happens if you're using Interval Partitioning (which might explain why this hasn't been spotted at more sites) and the simple workaround is to split the constraint work into two steps.

CREATE TABLE TEST (PK_COLUMN NUMBER, NON_PK_COLUMN VARCHAR2(30))
PARTITION BY RANGE (PK_COLUMN)
INTERVAL( 1)
(
PARTITION RUN_0 VALUES LESS THAN (1)
);

CREATE INDEX TEST_PK ON TEST (PK_COLUMN)
LOCAL;

ALTER TABLE TEST
ADD CONSTRAINT TEST_PK PRIMARY KEY (PK_COLUMN)

Posted by Doug Burns Comments: (4) Trackbacks: (0)

Trackbacks
Trackback specific URI for this entry

No Trackbacks

Comments
Display comments as (Linear | Threaded)

#1 - Stew Ashton 2012-07-29 10:44 - (Reply)

Doug, I don't have an 11.2.0.3 to test on. What happens if the index you create is UNIQUE? It seems like that would be the more common scenario for a PK constraint...

#2 - Doug Burns said:
2012-07-29 11:12 - (Reply)

Excellent question, Stew. I came to this app when this DDL already existed and I admit I hadn't even noticed that! Even when putting the test case together ... *sigh*

More to the point, when UNIQUE is used on the index, it works. So, not only is it the correct approach but it avoids the bug.

Thanks!

Another reminder for me of the power of blogging and online exchange ...

#3 - Wolfgang Breitling 2012-07-31 15:33 - (Reply)

Why not do it all in the create table ddl?

CREATE TABLE TEST
(PK_COLUMN NUMBER,
NON_PK_COLUMN VARCHAR2(30),
CONSTRAINT TEST_PK PRIMARY KEY (PK_COLUMN) USING INDEX LOCAL ENABLE
)
PARTITION BY RANGE (PK_COLUMN) INTERVAL (1)
(PARTITION RUN_0 VALUES LESS THAN (1)) ;

#4 - Doug Burns said:
2012-07-31 22:50 - (Reply)

Wolfgang,

Again, that would make more sense. I suppose there are a couple of answers to your question, none of them very good.

1) When I asked around as to the source of the DDL, it came out of a design tool/generator. I'm not sure which one but a human didn't write it.

2) Inertia and laziness. I hadn't even bothered to look at the DDL critically until we hit the problem on 11.2.0.3

We'll be rewriting it all now anyway


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