How to detect and resolve broken element associations in eHealth

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

Question:

How to detect and resolve broken element associations in eHealth

 

Answer:

If there is an issue with nhiCfgServer stopping, etc, and you suspect there may be broken element associations, you can check the server for broken associations.

Log into sqlplus and run following commands:

 

select count(*) from nh_elem_assoc where element_id not in (select element_id from nh_element);

select count(*) from nh_elem_assoc where parent_id not in (select element_id from nh_element);

 

If either of these queries return a value greater than 0, there are broken associations.

 

To deleted broken associations, do the following:

1. Take a backup of the nh_elem_assoc table:

create table nh_elem_assoc_bak as select * from nh_elem_assoc;

 

2. Delete the broken associations using the following statements within an sqlplus session as the $NH_USER:

delete from nh_elem_assoc where element_id not in(select element_id from nh_element);

delete from nh_elem_assoc where parent_id not in(select element_id from nh_element);

commit;

exit

This should resolve the issue, and queries should show 0 broken associations.