SQL> SQL> -- On a composite partitioned table. SQL> -- To partition the PK index, the partition key and subpartition key SQL> -- must form a subset of the PK columns SQL> SQL> drop table part_range_hash; drop table part_range_hash * ERROR at line 1: ORA-00942: table or view does not exist SQL> SQL> create table part_range_hash (c1 number(3), c2 varchar2(2), c3 char(1)) 2 partition by range (c1) 3 subpartition by hash (c3) 4 (partition p1 values less than (100) 5 (subpartition p1_d1, 6 subpartition p1_d2, 7 subpartition p1_d3), 8 partition p2 values less than (200), 9 partition p3 values less than (maxvalue) 10 ); Table created. SQL> SQL> alter table part_range_hash add constraint part_range_hash_pk primary key (c1); Table altered. SQL> select index_type, uniqueness, status, partitioned from user_indexes where 2 index_name='PART_RANGE_HASH_PK'; INDEX_TYPE UNIQUENES STATUS PAR --------------------------- --------- -------- --- NORMAL UNIQUE VALID NO SQL> SQL> -- Create a non-unique, partitioned,local index SQL> alter table part_range_hash drop constraint part_range_hash_pk; Table altered. SQL> create index part_range_hash_pk on part_range_hash(c1) local; Index created. SQL> -- Now add the PK constraint SQL> -- Does not work for composite-partitioned table SQL> -- ORA-14188: sub-partitioning columns must form a subset of key columns of a UNIQUE index SQL> alter table part_range_HASH add constraint part_range_HASH_pk primary key (c1); alter table part_range_HASH add constraint part_range_HASH_pk primary key (c1) * ERROR at line 1: ORA-00955: name is already used by an existing object SQL> SQL> drop table part_range_hash; Table dropped. SQL> SQL> create table part_range_hash (c1 number(3), c2 varchar2(2), c3 char(1)) 2 partition by range (c1) 3 subpartition by hash (c3) 4 (partition p1 values less than (100) 5 (subpartition p1_d1, 6 subpartition p1_d2, 7 subpartition p1_d3), 8 partition p2 values less than (200) 9 (subpartition p2_d1, 10 subpartition p2_d2, 11 subpartition p2_d3), 12 partition p3 values less than (maxvalue) 13 (subpartition p3_d1, 14 subpartition p3_d2, 15 subpartition p3_d3) 16 ); Table created. SQL> SQL> create index part_range_hash_pk on part_range_hash(c1,c3) local; Index created. SQL> select index_type, uniqueness, status, partitioned from user_indexes where 2 index_name='PART_RANGE_HASH_PK'; INDEX_TYPE UNIQUENES STATUS PAR --------------------------- --------- -------- --- NORMAL NONUNIQUE N/A YES SQL> select partition_name, subpartition_name, status from user_ind_subpartitions 2 where index_name='PART_RANGE_HASH_PK'; PARTITION_NAME SUBPARTITION_NAME STATUS ------------------------------ ------------------------------ -------- P1 P1_D1 USABLE P1 P1_D2 USABLE P1 P1_D3 USABLE P2 P2_D1 USABLE P2 P2_D2 USABLE P2 P2_D3 USABLE P3 P3_D1 USABLE P3 P3_D2 USABLE P3 P3_D3 USABLE 9 rows selected. SQL> SQL> alter table part_range_HASH add constraint part_range_HASH_pk primary key (c1, c3); Table altered. SQL> select index_name, index_type, uniqueness, status, partitioned from user_indexes 2 where table_name='PART_RANGE_HASH'; INDEX_NAME INDEX_TYPE UNIQUENES STATUS ------------------------------ --------------------------- --------- -------- PAR --- PART_RANGE_HASH_PK NORMAL NONUNIQUE N/A YES SQL> SQL> drop table part_range_hash; Table dropped. SQL> SQL> spool off