Database Error Messages

Release
toggle
  • 23ai
  • 21c
  • 19c
Updated
Jun 24, 2024

OCI-01452

cannot CREATE UNIQUE INDEX; duplicate keys found

Cause

A CREATE UNIQUE INDEX statement specified one or more columns that currently contained duplicate values. All values in the indexed columns must be unique by row to create a UNIQUE INDEX.


Action

If the entries need not be unique, remove the keyword UNIQUE from the CREATE INDEX statement, then re-execute the statement. If the entries must be unique, as in a primary key, then remove duplicate values before creating the UNIQUE index.