Oracle Error ORA-14064: Index with Unusable partition exists on unique/primary constraint key

Oracle Error Message

ORA-14064: Index with Unusable partition exists on unique/primary constraint key

Reason for the Error

User attempted to add or enable a primary key/unique constraint on column(s) of a table on which there exists an index one or more partitions of which are marked Index Unusable.

Solution

Drop the existing index or rebuild unusable partitions it using ALTER INDEX REBUILD PARTITION