ORA-00001: unique constraint (APPLSYS.AD_SNAPSHOT_FILES_U2) violated
Today while cloning a DEV instance, I got below error while running adadmin utilitu to update the snapshot information
AD Administration error:
adusnapUpdateGlobalView(): Error while executing statementAD Administration error:
ORA-00001: unique constraint (APPLSYS.AD_SNAPSHOT_FILES_U2) violated
ORA-06512: at “APPS.AD_FILE_UTIL”, line 2398
ORA-06512: at line 3AD Administration error:
adusnapStoreInDB(): Error calling adusnapUpdateGlobalView()Failed to store APPL_TOP Snapshot to tables
adusnapMaintainSnapshot() : Error calling adusnapUpdateCurrentView()
Error calling adusnapMaintainSnapshot
Fix applied to resolve the issue
Ran below 2 SQLs in the cloned instance using APPS user
- select distinct(snapshot_id) from ad_snapshot_files
- select distinct(snapshot_id) from AD_SNAPSHOT_BUGFIXES
And looked for any value with ‘minus’ sign. You need to remvoe/delete the record with “minus” sign. (Dont DELETE the other entry). I used below DELETE statements to delete the duplicate (with minus sign) record
- delete from ad_snapshot_files where snapshot_id=–<value_with_minus_sign>
- delete from AD_SNAPSHOT_BUGFIXES where snapshot_id=-<value_with_minus_sign>
If the offending records are not deleted from both the tables above, adadmin will error out again. This happened with me. I first removed only from ad_snapshot_files table and adadmin errored out again.
Restarted the adamdin utility and continued with the previous session. All went fine.
-Anand