How to destroy and recreate the ehealth database.

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


How to destroy and recreate the ehealth database.


There may arise a need to destroy a typically malfunctioning database and create a new one.  After that is done you would load a prior database save into the newly created database recovering your system.


All supported eHealth versions and their supported Operating Systems


To destroy and recreate the eHealth database, do the following: 

1. Logon to the eHealth system as $NH_USER.

2. cd to the $NH_HOME directory

3. If on Unix, source the nethealthrc.csh

4. Stop the eHealth server:

    nhServer stop

5. Unix users, switch to the 'root' user

6. Make a backup copy of the LCF file, which is located in $NH_HOME/oracle/database/ and has the naming format "<HOSTNAME>_<ORACLE_SID>.lcf" 

For example, run this command:
   cp /opt/eHealth/myServer_EHEALTH.lcf /opt/eHealth/myServer_EHEALTH.lcf.ORIG

7. Run the following command: 

     nhDestroyDb -s EHEALTH

8. (Still as the Root user) Run the following command: 

     nhCreateDb -i <LCF file>

where <LCF file> is the file saved in step 6.


9. (Switch back the $NH_USER) Run the following command: 

     nhLoadDb -p $NH_HOME/db/save/myDb.tdb

10. Restart the eHealth server: nhServer start