ERROR
When performing a compress operation, the following error may be encountered:
"Underlying DBMS error[ORA-00001: unique constraint (SDEADMIN.A789_PK) violated][SDE.DEFAULT]
Failed to execute (Compress)."
The error with additional information is also written to the sde error log:
"[Tue Apr 29 18:24:18 2008] [2156433] [H0454] SDE_Oracle Error: 1 ORA-00001: unique constraint (SDEADMIN.A789_PK) violated
[Tue Apr 29 18:24:18 2008] [2156433] [H0454] DB_registered_table_trim_state (SDEADMIN.CDTJOBDESIGNUNIT,8321579) Execute error (1).
Error when updating kept rows in adds table.
[Tue Apr 29 18:24:18 2008] [2156433] [H0454] Warning: Unable to trim state 8313585->8321579 for table SDEADMIN.CDTJOBDESIGNUNIT, error = -51
[Tue Apr 29 18:24:18 2008] [2156433] [H0454] DBMS error code: 1
ORA-00001: unique constraint (SDEADMIN.A789_PK) violated."
The unique constraint error indicates there are inconsistent entries present in the versioned table's delta tables, which are causing rows to become duplicates.
The compress operation encounters the error when compressing a lineage of states into one state. In the lineage being trimmed, there are multiple entries in the delta tables referencing a given ROWID value (ObjectID), which result in duplicate values.
Code:
SQL> SELECT table_name FROM sde.table_registry WHERE registration_id = 789;
TABLE_NAME
----------------
CDTJOBDESIGNUNIT
Code:
[Tue Apr 29 18:24:18 2008] [2156433] [H0454] Warning: Unable to trim state 8313585->8321579 for table SDEADMIN.CDTJOBDESIGNUNIT, error = -51
Code:
[Tue Apr 29 18:24:18 2008] [2156433] [H0454] Warning: Unable to trim state 8313585->8321579 for table SDEADMIN.CDTJOBDESIGNUNIT, error = -51
[Tue Apr 29 18:24:18 2008] [2156433] [H0454] DBMS error code: 1
ORA-00001: unique constraint (SDEADMIN.A789_PK) violated
Code:
SQL> SELECT owner, name FROM sde.versions
2 WHERE state_id IN
3 (SELECT DISTINCT lineage_id
4 FROM sde.state_lineages
5 WHERE lineage_name IN
6 (SELECT DISTINCT lineage_name
7 FROM sde.state_lineages
8 WHERE lineage_id = 8321579))
9 ORDER BY sde.state_id;
OWNER NAME
---------- ----------
SDE DEFAULT
Code:
C:\> sdegdbrepair -o repair_tables -d oracle10g -r SDEADMIN.CDTJOBDESIGNUNIT -V DEFAULT -u sde -p sde
ESRI ArcSDE Server Repair Utility Thu Aug 14 16:30:38 2008
----------------------------------------------------------------
Repair Instance Delta Tables, Are you sure? (Y/N): y
Repair operation completed without error.
Get help from ArcGIS experts
Download the Esri Support App