I am attempting an upgrade from 3.2.1 to version 4.x, and my upgrade fails due to a foreign key constraint violation relating to Role or Function; how do I resolve this issue?
This error is usually due to one or more specific Roles that have been removed from xMatters, and results in an error message similar to one of the following:
error occurred during batching: ORA-02291: integrity constraint (ALARMPOINT.AGPG_TARGETAGID_FK2) violated - parent key not found INSERT INTO ROLE_PERM_GRANTS (SRC_ROLE_ID, TARGET_ROLE_ID, ROLE_PERM_ID) VALUES (16, 5, 2)
error occurred during batching: ORA-02291: integrity constraint (ALARMPOINT.ORP_ORGID_FK2) violated - parent key not found INSERT INTO ORG_FUNC_PERMS (ORG_FUNC_ID, PERM_ID) VALUES (290,18404)
To address this issue, xMatters has provided database scripts that will restore the missing Roles.
To run the scripts:
- Restore your database to a state prior to the failed upgrade attempt.
- Download the attached Add_Roles_SQL.zip file and extract the contents.
- In the extracted folder structure, locate the add_roles.sql specific to your database.
- Run the add_roles.sql script.
- Upgrade xMatters.
Once the upgrade is complete, you can safely delete the Roles again.
JDN-1189 Originally created by Don Clark