Ehealth - How to restore an eHealth database from backup

book

Article ID: 37325

calendar_today

Updated On:

Products

CA eHealth

Issue/Introduction

INTRODUCTION

This document explains the procedure to destroy, create, and load a database save in eHealth. Use this procedure when problem situations require the database to be reloaded, such as database corruption or other irretrievable errors as instructed by CA Technical Support.

ENVIRONMENT

eHealth 6.2.x and above
All supported platforms

INSTRUCTIONS

In the instructions below, we will use the generic terms NH_HOME and ORACLE_SID. When entering commands you should replace these with the actual values of these variables. If you don't know the values you can look them up with these simple commands:

Windows:

echo %NH_HOME%
echo %ORACLE_SID%

Unix/Linux:

echo $NH_HOME
echo $ORACLE_SID

Part 1: Back Up the Layout Configuration File (LCF)

If you are a Windows user please be logged into the eHealth server as the NH_USER account; typically this is "ehealth". If Unix/Linux, please run as the root user.

The Layout Configuration File contains information that Oracle uses to determine the names and locations of all tablespaces and datafiles in the database. Since this file is deleted when you destroy the database it needs to be backed up for use when creating the new, empty database. The file is stored in the NH_HOME/oracle/database directory and uses the name format <hostname>_ORACLE_SID.lcf.

  1. Move into the NH_HOME/oracle/database directory.

  2. Rename <hostname>_ORACLE_SID.lcf to <hostname>_ORACLE_SID1.lcf

Part 2: Destroy the Current Database 

Before loading the new database, the current database must be destroyed and recreated.

  1. Stop eHealth and the eHealth web services

    In Windows, open the Services control panel and stop the following services:

    eHealth httpd6x
    eHealth Tomcat6x
    eHealth6x

    In Unix/Linux, run the following commands:

    nhServer stop
    nhHttpd stop

  2. Destroy the database with the following command. This may take several minutes to run.

    nhDestroyDb -s ORACLE_SID

  3. WINDOWS ONLY: You must restart the server before continuing to Part 3.

Part 3: Create a New Database

Use the following command to create a new, empty database. Note that depending on the size of your database this command could potentially take an hour or more to complete. 

nhCreateDb -i NH_HOME/oracle/database/hostname_ORACLE_SID1.lcf

Part 4: Load the Database Backup

Now that an empty database has been set up using the same layout as the original, you can safely load your backup files into the new database location.

  1. Use the nhLoad command to restore the database from backup. Note that depending on the size of the backup this could take several hours to complete. If you are workkng on a Windows server, please stop services before running this command, as explained in Part 2 Step 1.

    nhLoadDb -p <path to the backup tdb directory>

  2. Once the load completes successfully you can restart services.

    In Windows, open the Services control panel and start the following services:

    eHealth httpd6x
    eHealth Tomcat6x
    eHealth6x

    In Unix/Linux, run the following commands:

    nhServer start
    nhHttpd start

 

ADDITIONAL INFORMATION

For detailed information on database backups, please review the eHealth Administration Guide. For more information regarding the nhDestroyDb, nhCreateDb, and nhLoadDb, please review the eHealth Command and Environment Variable Reference Guide.

Environment

Release: LHDEVC99000-6.3-eHealth-Live Health Upgrade Elements
Component:

Resolution

Ehealth is out of support now.