Problem Summary:  How to Create a Refresh Job and Run via HVR Scheduler

Viewing 1 post (of 1 total)
  • Author
  • #18180
    Donna Zehl

    Problem Summary:  How to Create a Refresh Job and Run via HVR Scheduler


    Tag: 5.5 (28528)



    Create a simple shell script to kick off a refresh of a table job from the HVR scheduler. It will check if current date = date in the file, then run the refresh job.



    So lets take this file  ‘Myplans.csv’  with the example contents



    And we have this script created

    currentdate=$(date "+%Y-%m-%d")
    export HVR_HOME=/opt/hvr/hvr_home
    export HVR_CONFIG=/opt/hvr/hvr_config
    echo $file
    if [ ! -f "$file" ]
        echo "$0: File '${file}' not found."
       dbdate=$(grep "$(date +"%Y-%m-%d")" $file)
       if [ "${currentdate}" = "${dbdate}" ]; then
            $HVR_HOME/bin/hvrrefresh -s -rMysource -lMytarget hubdb/password chn1      
            echo "Refresh did not start"



            Note : The above script uses the -s parameter which will only create the refresh job in the scheduler but won’t start it.  If you run this script without the ‘-s’ parameter to start job immediately or you can keep this parameter to keep the job suspended then start the refresh job with hvrstart command.


    Here is a snippet from the hvrrefresh wiki page@  with more details:

    Schedule invocation of refresh scripts using the HVR Scheduler. Without this option the default behavior is to perform the refresh immediately. The jobs created by this option are named chnrefrl1l2. These jobs are initially created in SUSPEND state. They can be invoked using command hvrstart as in the following example:

         $ hvrstart –u –w hubdb chn–refr

    The previous command unsuspends the jobs and instructs the scheduler to run them. Output from the jobs is copied to the hvrstart command’s stdout and the command finishes when all jobs have finished. Jobs created are cyclic which means that after they have run they go back to PENDING state again. They are not generated by a trig_delay attribute which means that once they complete they will stay in PENDING state without getting retriggered. Once a refresh job has been created with option –s then it can only be run on the command line (without HVR Scheduler) as follows:

     $ hvrstart –i hubdb chn–refr–loc1–loc2



Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.

© 2020 HVR

Test drive Contact us