My Oracle Support Banner

UNABLE TO CREATE PRIMARY KEY ON COMPOSITE PARTITIONED TABLE ORA-1408 (Doc ID 988714.1)

Last updated on OCTOBER 22, 2019

Applies to:

Oracle Database - Enterprise Edition - Version 10.1.0.5 to 11.2.0.1.0 [Release 10.1 to 11.2]
Information in this document applies to any platform.

Symptoms

Adding a primary key constraint to a composite partitioned table generates an "ORA-01408: such column list already indexed" error.
ORA-01408: such column list already indexed


Testcase:
---------

CREATE TABLE <table_name> (<column-1> NUMBER,
<column-2> NUMBER,<column-3> NUMBER(3),<column-4> VARCHAR2(25),
<column-5> VARCHAR2(2),<column-6> VARCHAR2(4),<column-7> NUMBER,
<column-8> NUMBER(2),<column-9> NUMBER,<column-10> NUMBER(2))
TABLESPACE users
PARTITION BY RANGE (<column-3>)
SUBPARTITION BY LIST (<column-10>)
SUBPARTITION TEMPLATE
( SUBPARTITION D01 VALUES (1),
SUBPARTITION D02 VALUES (2),
SUBPARTITION D03 VALUES (3),
SUBPARTITION D04 VALUES (4),
SUBPARTITION D05 VALUES (5),
SUBPARTITION D06 VALUES (6),
SUBPARTITION D07 VALUES (7),
SUBPARTITION D08 VALUES (8),
SUBPARTITION D09 VALUES (9),
SUBPARTITION D10 VALUES (10),
SUBPARTITION D11 VALUES (DEFAULT)
)
(
PARTITION P1 VALUES LESS THAN (1) TABLESPACE USERS,
PARTITION P2 VALUES LESS THAN (2) TABLESPACE USERS,
PARTITION P3 VALUES LESS THAN (3) TABLESPACE USERS,
PARTITION PMAX VALUES LESS THAN (MAXVALUE) TABLESPACE USERS);



--Create index

CREATE INDEX <index_name> ON <table_name>
(<column-1>, <column-2>, <column-3>, <column-4>, type)
LOCAL(
PARTITION P1 TABLESPACE USERS,
PARTITION P2 TABLESPACE USERS,
PARTITION P3 TABLESPACE USERS,
PARTITION PMAX TABLESPACE USERS);



-- Adding PK raises ORA-01408 error

ALTER TABLE <table_name>
ADD CONSTRAINT <primary_key_name> PRIMARY KEY (<column-1>, <column-2>, <column-3>, <column-4>, <column-5>);

ORA-01408: such column list already indexed

Changes

 

Cause

To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!


In this Document
Symptoms
Changes
Cause
Solution


My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.