CSE tasks fail with unique index/constraint DOBJI1 violation errors, due to an object id partition corruption in the DMAX table.

Document ID : KB000009463
Last Modified Date : 14/02/2018
Show Technical Document Details
Introduction:

If the object id partitions in the DMAX table of the CSE Encyclopedia database become corrupt, this can cause CSE tasks such as model upload, model copy etc to fail with an error caused by violation of the unique index/constraint DOBJI1.

Instructions:

If CSE tasks such as model upload, model copy etc give errors similar to the following, it is an indication that the object id partitions in the Encyclopedia database DMAX table have become corrupt:

Oracle:
Error:ORA-00001: unique constraint (ENCY.DOBJI1) violated
...
Obj create constructor: insert error
Object id = xxxxx
Otc = yyy

SQL Server:
'Cannot insert duplicate key row in object 'DOBJ' with unique index 'DOBJI1'. '
...
Obj create constructor: insert error
Object id = xxxxx
Otc = yyy

The corruption means that the CSE is trying to reuse an object id that already exists in the DOBJ table. To correct the corruption the following steps should be performed:

  1. To first confirm there is an object id partition corruption, run the following command:

    initdb -c "DBNAME=<dbname> DBUSER=<user> DBPSWD=<pswd>" -r
    where:
    "DBNAME=<dbname> DBUSER=<user> DBPSWD=<password>" represents the connect information for the Ency. DB, & should match the Ency. DB line 'DBNAME=...' from the CSE iefmd.ini file.

    NOTE: The '-r' parameter is required to create an object id partition report for the DMAX table.

    If the output contains any 'WARNING!' messages about 'invalid' MAXDOBJ partitions, then a corruption is confirmed.

  2. At a convenient downtime stop the CSE.

    Perform a backup of both CSE Encyclopedia & Coordination databases.

  3. For the remaining steps, the Encyclopedia database needs to be up, but the CSE SHOULD NOT be restarted. This is necessary to prevent further object id activity while the required changes are made.

  4. Run the following command (similar to step 1):

    initdb -c "DBNAME=<dbname> DBUSER=<user> DBPSWD=<pswd>" -r 2> initdb_r.out

    In this case, the file initdb_r.out will contain the object id partition report. For each 'Part' that is shown as 'invalid', some SQL should be run to update the max value for that 'Part' to the value shown in the 'it must be at least value' e.g.

    For 'Part 1': 
    UPDATE DMAX
    SET MAX_INT_VALUE=<'it must be at least' value for Part 1>
    WHERE MAX_TYPE='MAXDOBJ'
    AND MAX_RELEASE='1';

    For 'Part 2': 
    UPDATE DMAX
    SET MAX_INT_VALUE=<'it must be at least' value for Part 2>
    WHERE MAX_TYPE='MAXDOBJ'
    AND MAX_RELEASE='2';
    ....

    For 'Part n': 
    UPDATE DMAX
    SET MAX_INT_VALUE=<'it must be at least' value for Part n>
    WHERE MAX_TYPE='MAXDOBJ'
    AND MAX_RELEASE='n';

  5. After completing the above, re-run the command

    initdb -c "DBNAME=<dbname> DBUSER=<user> DBPSWD=<pswd>" -r 2> initdb_r2.out

    There should be no warnings shown in the new output file initdb_r2.out.

  6. At this stage it is also necessary to verify the ancestry object ids on the CSE. For further information on this subject please see Technical Document TEC379420, specifically the section How to check if my current CSE has problems.

  7. Restart the CSE & retest the task that was failing.