Most database tables require a primary index. (Some tables in the Data Dictionary do not have primary indexes and a global temporary trace table is not allowed to have a primary index.) To create a primary index, use the CREATE TABLE statement.
If you do not assign a primary index explicitly when you create a table, the database assigns a primary index, based on the following rules.
| Primary Index | Primary Key | Unique Column Constraint | Result |
|---|---|---|---|
| No | Yes | No | Primary key column is a UPI. |
| No | No | Yes | First column or columns having a UNIQUE constraint are a UPI. |
| No | Yes | Yes | Primary key column is a UPI. |
| No | No | No | First column of table is a NUPI. If data type of first column is a LOB, CREATE TABLE operation ends and system returns an error message. |
The best practice is to specify a primary index instead of having the database select a default primary index.