Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> primary key, local partition index - prefixed/non-prefixed
Hi all...
I'm messing around with partitioning, and trying to create a primary key index which is locally partition to match the underlying table. Table looks something like this:
create table mytable (
id number,
last date)
tablespace data
storage (initial 64k next 64k pctincrease 0)
partition by range (last)
(partition lastq1_03 values less than(to_date('01-APR-2003','DD-MON-YYYY')),
partition lastq2_03 values less than(to_date('01-JUL-2003','DD-MON-YYYY')), partition lastq3_03 values less than(to_date('01-OCT-2003','DD-MON-YYYY')), partition lastq4_03 values less than(to_date('01-JAN-2004','DD-MON-YYYY')))enable row movement;
SQL> alter table mytable add primary key (id) using index
tablespace "INDX" local enable;
alter table mytable add primary key (id) using index
tablespace "INDX" local enable
*
ERROR at line 1:
ORA-14039: partitioning columns must form a subset of key columns of a
UNIQUE index
Basically what Oracle is saying is hey, your table is partitioned on last, and you want to create a local index on id, no can do. So how *DO* I do that, and for that matter, how do I manage with a foreign key constraint?
I've looked at the docs, but I really need a good example. If anyone can point me in the right direction, I'd appreciate it.
Thanks,
Sean
-- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: From INET: l-oracle_at_hypno.iheavy.com Fat City Network Services -- 858-538-5051 http://www.fatcity.com San Diego, California -- Mailing list and web hosting services --------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-LReceived on Fri Jan 10 2003 - 02:18:42 CST
(or the name of mailing list you want to be removed from). You may
also send the HELP command for other information (like subscribing).
![]() |
![]() |