ORA-14039 When Creating UNIQUE Partitioned Index with a DESC Column (Doc ID 1064998.1)

Last updated on MARCH 27, 2014

Applies to:

Oracle Server - Enterprise Edition - Version 8.1.6.1 to 11.2.0.2 [Release 8.1.6 to 11.2]
Information in this document applies to any platform.

Symptoms

Creating a UNIQUE local index on a partitioned table generates the error "ORA-14039: partitioning columns must form a subset of key columns of a UNIQUE index."   The local index contains the partitioning key columns, as required, but also includes the DESC keyword on those columns.

Example:

CREATE TABLE TEST
(
EMPLID VARCHAR2(11) NOT NULL,
COMPANY VARCHAR2(3) NOT NULL,
BALANCE_YEAR NUMBER(*,0) NOT NULL,
BALANCE_QTR NUMBER(*,0) NOT NULL
)
PARTITION BY RANGE(BALANCE_YEAR, BALANCE_QTR)
(PARTITION PS_DEDUCTION_BAL_2009Q1 VALUES LESS THAN (2009, 2),
 PARTITION PS_DEDUCTION_BAL_2009Q2 VALUES LESS THAN (2009, 3)
) ;
 
-- Note BALANCE_YEAR, BALANCE_QTR are the partition
-- keys
CREATE UNIQUE INDEX TEST_IDX
ON TEST(EMPLID,BALANCE_YEAR DESC,BALANCE_QTR DESC) LOCAL;

ERROR at line 2:
ORA-14039: partitioning columns must form a subset of key columns of a UNIQUE index



Cause

Sign In with your My Oracle Support account

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

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms