How to Resolve Unique Constraint Errors Generated by the nhiReplDriver Process

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


In a distributed eHealth cluster, users may encounter the following error in the system.log file of the reporting front end (RFE):

Error nhiReplDriver Pgm nhiReplDriver: Database error: (ORA-00001: unique constraint ({SID}.NH_ELEMENT_IX2) violated

This occurs when the replication of group or element data from a back-end poller does not get replicated to all cluster members, which will ultimately show up as updates needed in the FindClusterDiffs log files as items named <Unknown>.

This problem may cause scheduled reports to fail or jobs to take a very long time to process (more than 6 hours) on the RFE.



On each system in the cluster, one by one, do the following. Please complete the process on each individual cluster member before moving on to the next. 

1. Stop the eHealth server processes 

    nhServer stop 

2. From the command line, run: 

    $NH_HOME/bin/sys/nhiGetReplDbgInfo -save  

    This will create a backup of all the tables that could be modified by this process. 

3. Log into sqlplus with the NH_USER account: 






4. From the SQL> prompt run each of these commands: 

    set serveroutput on size 1000000; 

    execute NH_CLEANUP_REPL_TABLES.CleanupReplTables; 

5. Exit from sqlplus 


6. Start the eHealth server processes 

    nhServer start 


When all of the cluster systems are done (this does not take long) run the following from the command line on the RFE: 

    nhSynchronize -cluster -allElements

This command will take several minutes to run, but should complete successfully. 

Finally, run 'nhFindClusterDiffs -cluster' from the RFE to confirm that everything is up to date.