During an upgrade using the Software Update Manager (SUM) with the Database Migration Option (DMO) option, errors may occur in the phase EU_CLONE_MIG_DT_RUN with below error
***************************************************************************************************************************
A3WEIMP 047 PRIMARY KEY ( “MANDT” , “E_FINIS” , “EPN_PREFIX” , “EPN_BASE” , “EPN_SUFFIX” , “LOC_CODE” , “CREATED_ON” , “CREATED_TIME” )’
A3WEIMP 047 (HDB) dbrc = 26 ‘unique constraint violated’
A3WEIMP 047 (HDB) SQL error = 349
A3WEIMP 047 (HDB) cannot CREATE UNIQUE INDEX; duplicate key found: [5] Several documents with the same ID exist in the index;SAPHANADB:/ <NAMESPACE>//BDL_NPSA.$trexexternalkey$ content not unique, cannot define unique constraint. rowCount != distinctCount
A3WEIMP 047 (HDB) DBCreate failed
A2EEIMP 049 Index creation failed before – listing duplicate records for ‘/<NAMESPACE>/BDL_NPSA~0’ with key fields: MANDT E_FINIS EPN_PREFIX EPN_BASE EPN_SUFFIX LOC_CODE CREATED_ON CREATED_TIME
A4EEIMP 051 Duplicate record with key: ‘120’ ‘1001713’ ’95VW’ ‘5B489’ ‘AB’ ‘DE’ ‘20230822’ ‘000100’ (occurs 3 times).
A3EEIMP 052 Found 1 duplicate keys in 3 records.
A1EEIMP 008 Task failed with error: (HDB) DbSlExecute failed for DDL statement ‘ALTER TABLE “/<NAMESPACE>//BDL_NPSA”
A1EEIMP 008 ADD CONSTRAINT “/<NAMESPACE>/BDL_NPSA~0”
A1EEIMP 008 PRIMARY KEY ( “MANDT” , “E_FINIS” , “EPN_PREFIX” , “EPN_BASE” , “EPN_SUFFIX” , “LOC_CODE” , “CREATED_ON” , “CREATED_TIME” )’
A1EEIMP 008 (HDB) dbrc = 26 ‘unique constraint violated’
A1EEIMP 008 (HDB) SQL error = 349
A1EEIMP 008 (HDB) cannot CREATE UNIQUE INDEX; duplicate key found: [5] Several documents with the same ID exist in the index;SAPHANADB:/FORDEU/BDL_NPSA.$trexexternalkey$ content not unique, cannot define unique constraint. rowCount != distinctCount
A1EEIMP 008 (HDB) DBCreate failed
A2EETSK 007 Finished create for object “/<NAMESPACE>/BDL_NPSA~0” of type “primary index” with error in 0.190 sec #20250922081128
***************************************************************************************************************************
The error indicates that there are duplicate entries in the table of target DB. This is causing the creation of a unique index to fail, as there are multiple records with the same key. The duplicate entries come from the source DB as shown below:
Source Database
Target Database Table
To fix/mitigate the issue, following actions can be taken:
Case 1: Duplicate entries can be deleted
Identify the duplicate entries in the source database and delete them from the source database.
If it is HANA database, please use the HANA scripts HANA_Data_DuplicateKeys_CommandGenerator_1.00.100+ and HANA_Data_DuplicateKeys_columnStore_Deletion_CommandGenerator attached in SAP Note 1969700.
Once the entries are deleted, retry the step in SUM tool.
Case 2: If customer is not allowing to delete the duplicate entries from Source database.
Ignore the index creation in Target DB with below steps:
Identify the MIGRATE_DT_REPAIR_IMP.TSK file under ../SUM/abap/load/migrate_dt_repair directory.
Edit the index entry (which is having the issue) in the file as below:
P <Index name > C ign
With this, SUM process will skip the index creation for this table.
Repeat the SUM phase again.
Note: If the index is required later, it can be created manually after the target system is available.
During an upgrade using the Software Update Manager (SUM) with the Database Migration Option (DMO) option, errors may occur in the phase EU_CLONE_MIG_DT_RUN with below error***************************************************************************************************************************A3WEIMP 047 PRIMARY KEY ( “MANDT” , “E_FINIS” , “EPN_PREFIX” , “EPN_BASE” , “EPN_SUFFIX” , “LOC_CODE” , “CREATED_ON” , “CREATED_TIME” )’A3WEIMP 047 (HDB) dbrc = 26 ‘unique constraint violated’A3WEIMP 047 (HDB) SQL error = 349A3WEIMP 047 (HDB) cannot CREATE UNIQUE INDEX; duplicate key found: [5] Several documents with the same ID exist in the index;SAPHANADB:/ <NAMESPACE>//BDL_NPSA.$trexexternalkey$ content not unique, cannot define unique constraint. rowCount != distinctCountA3WEIMP 047 (HDB) DBCreate failedA2EEIMP 049 Index creation failed before – listing duplicate records for ‘/<NAMESPACE>/BDL_NPSA~0’ with key fields: MANDT E_FINIS EPN_PREFIX EPN_BASE EPN_SUFFIX LOC_CODE CREATED_ON CREATED_TIMEA4EEIMP 051 Duplicate record with key: ‘120’ ‘1001713’ ’95VW’ ‘5B489’ ‘AB’ ‘DE’ ‘20230822’ ‘000100’ (occurs 3 times).A3EEIMP 052 Found 1 duplicate keys in 3 records.A1EEIMP 008 Task failed with error: (HDB) DbSlExecute failed for DDL statement ‘ALTER TABLE “/<NAMESPACE>//BDL_NPSA”A1EEIMP 008 ADD CONSTRAINT “/<NAMESPACE>/BDL_NPSA~0″A1EEIMP 008 PRIMARY KEY ( “MANDT” , “E_FINIS” , “EPN_PREFIX” , “EPN_BASE” , “EPN_SUFFIX” , “LOC_CODE” , “CREATED_ON” , “CREATED_TIME” )’A1EEIMP 008 (HDB) dbrc = 26 ‘unique constraint violated’A1EEIMP 008 (HDB) SQL error = 349A1EEIMP 008 (HDB) cannot CREATE UNIQUE INDEX; duplicate key found: [5] Several documents with the same ID exist in the index;SAPHANADB:/FORDEU/BDL_NPSA.$trexexternalkey$ content not unique, cannot define unique constraint. rowCount != distinctCountA1EEIMP 008 (HDB) DBCreate failedA2EETSK 007 Finished create for object “/<NAMESPACE>/BDL_NPSA~0” of type “primary index” with error in 0.190 sec #20250922081128 ***************************************************************************************************************************The error indicates that there are duplicate entries in the table of target DB. This is causing the creation of a unique index to fail, as there are multiple records with the same key. The duplicate entries come from the source DB as shown below: Source DatabaseTarget Database TableTo fix/mitigate the issue, following actions can be taken:Case 1: Duplicate entries can be deletedIdentify the duplicate entries in the source database and delete them from the source database.If it is HANA database, please use the HANA scripts HANA_Data_DuplicateKeys_CommandGenerator_1.00.100+ and HANA_Data_DuplicateKeys_columnStore_Deletion_CommandGenerator attached in SAP Note 1969700.Once the entries are deleted, retry the step in SUM tool. Case 2: If customer is not allowing to delete the duplicate entries from Source database.Ignore the index creation in Target DB with below steps:Identify the MIGRATE_DT_REPAIR_IMP.TSK file under ../SUM/abap/load/migrate_dt_repair directory.Edit the index entry (which is having the issue) in the file as below:P <Index name > C ign With this, SUM process will skip the index creation for this table.Repeat the SUM phase again.Note: If the index is required later, it can be created manually after the target system is available. Read More Technology Blog Posts by SAP articles
#SAP
#SAPTechnologyblog