Support Article
DeploymentManager migration failure with unique constraint error
SA-4199
Summary
Developer is upgrading their CDM v6.1.1 to v6.8. While running the 671-68 migration script(dma_migration_6.7.1_to_68_oracle.sql) provided in the CDM 68 binaries, the below Unique Constraint error thrown
INSERT INTO OHM_PERMISSION ( PERMISSION_ID, MODULE_PERMISSION, NAME, DESCRIPTION, METHODS,
DEFAULT_GROUPS ) VALUES (7, 'Configuration', 'tracer', 'Monitoring and Runtime Tracer', 'TracerActions.start,TracerActions.stop,TracerActions.clear,TracerActions.showTracer,TracerActions.fetchOperations,,RSActions.monitorConfig,DecisionMonitorActions.fetchDecisionResponseTimes,DecisionMonitorActions.resetDecisionMonitorTimes, Application administration,admin,DecisionMonitorActions.fetchVersionsForRTP,DecisionMonitorActions.clearDecisionResponseTimes', 'Application administration,admin,')
Error at Command Line : 1 Column : 1
Error report -
SQL Error: ORA-00001: unique constraint (DMA_USER.SYS_C004163) violated
Error Messages
Error starting at line : 1 in command -
INSERT INTO OHM_PERMISSION ( PERMISSION_ID, MODULE_PERMISSION, NAME, DESCRIPTION, METHODS,
DEFAULT_GROUPS ) VALUES (7, 'Configuration', 'tracer', 'Monitoring and Runtime Tracer', 'TracerActions.start,TracerActions.stop,TracerActions.clear,TracerActions.showTracer,TracerActions.fetchOperations,,RSActions.monitorConfig,DecisionMonitorActions.fetchDecisionResponseTimes,DecisionMonitorActions.resetDecisionMonitorTimes, Application administration,admin,DecisionMonitorActions.fetchVersionsForRTP,DecisionMonitorActions.clearDecisionResponseTimes', 'Application administration,admin,')
Error at Command Line : 1 Column : 1
Error report -
SQL Error: ORA-00001: unique constraint (DMA_USER.SYS_C004163) violated
00001. 00000 - "unique constraint (%s.%s) violated"
*Cause: An UPDATE or INSERT statement attempted to insert a duplicate key.
For Trusted Oracle configured in DBMS MAC mode, you may see
this message if a duplicate entry exists at a different level.
*Action: Either remove the unique restriction or do not insert the key.
Error starting at line : 4 in command -
INSERT INTO OHM_GROUP_PERMISSION ( GROUP_ID, PERMISSION_ID ) VALUES (1, 7)
Error at Command Line : 4 Column : 1
Error report -
SQL Error: ORA-00001: unique constraint (DMA_USER.SYS_C004168) violated
00001. 00000 - "unique constraint (%s.%s) violated"
*Cause: An UPDATE or INSERT statement attempted to insert a duplicate key.
For Trusted Oracle configured in DBMS MAC mode, you may see
this message if a duplicate entry exists at a different level.
*Action: Either remove the unique restriction or do not insert the key.
Steps to Reproduce
Run the migration scripts provided in the CDM v6.8 binaries from V6.1.1 onwards until v671 to v68.
Root Cause
DMA migration from 6.7.1 to 6.8 (dma_migration_6.7.1_to_68_oracle.sql) fails because of the unique constraint violation on the OHM_PERMISSION.PERMISSION_ID column because of the hard coded value.
Resolution
HotFix-897 provided containing the updated migration scripts to use the latest sequence value for the PERMISSION_ID column value. Reach out to pega support for more details.
Published January 31, 2016 - Updated October 8, 2020
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.