Using Parameter Substitution

You can use parameter substitution to assign values to Oracle GoldenGate parameters automatically at run time, instead of assigning static values when you create the parameter file. That way, if values change from run to run, you can avoid having to edit the parameter file or maintain multiple files with different settings. You can simply export the required value at runtime. Parameter substitution can be used for any Oracle GoldenGate process.

To Use Parameter Substitution

  1. For each parameter for which substitution is to occur, declare a runtime parameter instead of a value, and precede the runtime parameter name with a question mark (?) as shown in the following example.
    SOURCEISFILE
    EXTFILE ?EXTFILE
    MAP hr. ?TABNAME, TARGET hr. TABNAME;
    
  2. Before starting the Oracle GoldenGate process, use the shell of the operating system to pass the runtime values by means of an environment variable, as shown in the following examples:

Example 11-37 Parameter substitution on Windows

C:\> set EXTFILE=C:\ggs\extfile
C:\> set TABNAME=PROD.ACCOUNTS
C:\> replicat paramfile c:\ggs\dirprm\parmfl

Example 11-38 Parameter substitution on UNIX (korn shell)

$ EXTFILE=/ggs/extfile
$ export EXTFILE
$ TABNAME=PROD.ACCOUNTS
$ export TABNAME
$ replicat paramfile ggs/dirprm/parmfl