How to Schedule an ASCII Database Save?

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


An Oracle database save in binary format cannot simply be loaded onto another eHealth system without first mirroring the filesystem and datafile layouts of the originating eHealth system. This is a limitation of the Oracle RMAN facility that eHealth uses to perform the Oracle database save and load operations via nhSaveDb and nhLoadDb. This makes the use of a binary save for disaster recovery purposes impractical. But database save in asc format can be loaded cross platforms. Thus we recommended scheduling an ASCII database save job to compliment the binary save job in the event that disaster recovery needs to be performed on another eHealth system. To create this job, there are two options:



1. Determine the current size of the eHealth database through running a command of 'nhDbStatus' to figure out how much disk space will be required for the database save:

2. Create a custom scheduled job type

    a. Using the nhSchedule command, create a custom job type called ASCII Database Save via:
         nhSchedule -defineType "ASCII Database Save" -load 100 -cmd "$NH_HOME/bin/nhSaveDb -ascii"
    b. Define the time at which this ASCII Database Save job will run and the destination path for the save using the nhScheduleCommand via:

        nhSchedule -schedule "ASCII Database Save" -time <save time> -daily <save schedule> -args "-p <save to path>

        For example, to schedule an ASCII database save to occur every Sunday at 2:00 AM and save to the /export/spiderman/DBSAVES/weeklyAscii.tdb directory, use the following command:

            nhSchedule -schedule "ASCII Database Save" -time "02:00 AM" -daily ynnnnnn -args "/export/spiderman/DBSAVES/weeklyAscii.tdb"

   c. Enable the new ASCII Database Save job via the nhSchedule command:

        nhSchedule -enable <job ID returned from command 1b>


2. Modify the existing binary Database Save job to use the -ascii command flag:

    a. nhSchedule -modify <job ID of the existing database save job> -args "-ascii -p <path to database save location>

Once the custom job has been saved, you can view the status of the job either from the eHealth scheduled job interface or via the nhSchedule -list -full command..

Related Issues/Questions:
How to schedule an ASCII database save
How to setup an automated ASCII DB save
What is the difference between an ASCII save and a Binary save
Can I load an Oracle binary save onto a new eHealth system

Problem Environment:
eHealth 5.5 and later

Additional Information:
An Oracle ASCII save will export only the data contained within each datafile of the database. This will result in an increased save time but a decreased space consumption of the save. This is due to the fact that a binary save will simply copy the datafile to the save location. The saved datafile will contain the unused space within the original datafile.