Error: Failed to register as versioned. Unique indexes can't be specified for multiversioned tables

Error Message

When attempting to register a feature class that has a unique constraint as versioned, the following error is returned:

"Failed to register as versioned. Unique indexes can't be specified for multiversioned tables."


This is by design.

Solution or Workaround

It is possible to place the unique constraint on the base tables but the constraints must be added after the table has been registered as versioned.

This has some implications though. If you are editing the data, when you do a compress of the database, the changes from the delta tables may get written to the base table. If the compress tries to write data to the base table, and the constraint is broken, the compress will fail, and it will be your responsibility to work out why this has occurred.

If the violation is encountered on the compress, then it is the user's responsibility to detect and resolve the violation (as to what table and what row).

For example:

. Load a shapefile with ArcCatalog.
. Registered the layer as versioned.
. Add a Unique constraint to the business table.
. Use ArcMap to add one record, where the value for the unique constraint is violated.
. Reconciled and posted with the default.
. Compress the database with ArcCatalog.

On compress, an error message appears indicating there was an underlying DBMS error. Checking in the sde.errlog shows:

Warning: Unable to trim state 0->134 for table GISDBA.TABLE1, error = -51
DBMS error code: 1
ORA-00001: unique constraint (GISDBA.TABLE1_UK21052267347523) violated

Now it is up to the user to either remove the unique constraint, or to work out which row has broken the constraint, and fix it.

    Related Information