Jul 29: 11.2.0.3 Interval Partitioning Constraint Creation Bug
Trackbacks
Trackback specific URI for this entry
No Trackbacks
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);
ORA-00600: internal error code, arguments: [kkpoxPaxdInit0], [], [], [], [], [], [], [], [], [], [], []
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)
#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
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
11g
ACE
adaptive thresholds
ASH
Audit Vault
AWR
Blogging
conferences
Cuddly Toys
Database Refresh
DBMS_STATS
Direct Path Reads
Fun
grid control
hotsos 2010
listener
Locking
oow
oow2009
optimiser
OTN
Parallel
Partitions
Patching
swingbench
The Reality Gap
time matters
ukoug
ukoug2009
Unix/Shell
Useful LinksDesign by Andreas Viklund | Conversion to s9y by Carl