Following error is seen in eHealth log.
06/06/14 15:34:18,Error,Pgm nhiRegStats[Active]: Sql Error occurred during operation select r.sample_time, r.element_id, nvl(r.delta_time,0),
Microsoft Windows 2008 32 bit and 64 bit.
Solaris 10 and RHEL 5.6 and above.
Please run the following command from eHealth server:
$NH_HOME/bin/sys/nhisql "select count(*) from nh_reg0_wip where delta_time < 0"
If the returned count is anything other than zero then the issue is with the poll times for some rows of data came in as negative values. Since a negative time is impossible, the nhiRegStats process which actions the data fails out continuously.
This issue can be fixed by changing those values to a positive number. Please follow the steps below to resolve.
- Open a command line interface window and switch to a bash prompt
The cursor will become a dollar sign ($)
- Make a backup copy of the problem table before making changes
exp $NH_USER/$NH_USER@$NH_DB_CONNECT_STRING tables=nh_reg0_wip file=nh_reg0_backup.dmp
- Stop eHealth
- Start sqlplus
- Update the problem table and commit changes with two commands, then exit
update NH_REG0_WIP set delta_time = 299 where delta_time < 0;
- Start eHealth
- Exit the Bash prompt
Note: You may experience a temporary performance issue after fixing the negative values, as the nhiRegStats process will start working on the accumulated data that it couldn't touch while the error was in effect. You will want to watch the DB drive to be sure that there are no space issue during this time. If you see that the drive is filling up, you can run the following command to clear out old archive logs.
e:/ehealth/bin/nhDbMaint -u $NH_USER -d $NH_RDBMS_NAME -deleteArchiveLogs