Environment Variables
Fivetran HVR offers a set of environment variables for tuning, tracing and managing different processes involved in replication, refresh, compare, etc.
In certain cases, environment variables are provided to a customer as a temporary workaround and must be used under the guidance of the HVR technical support.
The following methods are available to define environment variables in HVR:
To determine which method to use, it is important to understand which process the environment variable affects in each specific situation. For example, some environment variables are only effective if defined on a capture process or a hub process, while others have an effect on the entire HVR system.
Action Environment sets an operating system environment variable for a HVR process on the location where the action is defined. An environment variable defined with action Environment does not have an effect on the HVR Agent listener process. It will only apply to the HVR process that is spawned by the HVR Agent listener. The same is true for a systemd/xinetd setup running on a remote machine.
It is not possible to set environment variables on HVR hub server using the Environment action. To do this, job attributes should be used. Environment variables defined using this method apply only to job processes running ona HVR hub server machine, i.e. the hub processes and all local child processes. However, these environment variables will not be exported to remote child processes (on a remote machine running the HVR Agent Listener process or any systemd or xinetd setup). For example, if you define ENV1=VAL1 on a capture job using job attributes and the capture location uses HVR Agent, then the process running on that agent machine will not have ENV1=VAL1 set. If instead, you defined it with the Environment action on that capture location (or its location group), then the process running on the HVR Agent machine will also have ENV1=VAL1 set.
For the case with job attributes, to pass environment variables to the remote child processes, you must use the HVR_EXPORT environment variable. It accepts a list of 'name=value' pairs separated by a semicolon and exports all the specified environment variables to the remote child processes.
Command Line
You can specify an environment variable for any command you run from a terminal. This can be done either by specifying the environment variable for the command only or for your terminal process.
Setting an environment variable on the command line can have an effect on the correct processes, but note that command lines sometimes do not execute the code you need directly. For example, command hvrstart with option -i starts a job interactively, so this would be the correct process to trace capture, for example. But without option -i, it tells the Scheduler to start the job, so the environment of hvrstart has no effect on the environment of the capture job.
To specify an environment variable for the command only:
On Windows or Linux/Unix, run the following command
hvr -E HVR_PROC_TRACE=1 hvrstart -i hub chn
Alternatively, on Linux/Unix only, run the following command
HVR_PROC_TRACE=1 hvrstart -i hub chn
To set the variable in your terminal process, run the following command:
export HVR_PROC_TRACE=1 hvrstart -i hub chn
Action Environment
An environment variable set with the Environment action will apply only to the child processes of the location that the action is defined for. The hub process will not be affected.
Job Attributes
An environment variable set using job attributes applies to a job process, i.e. the hub process and all local child processes.