1.149 SETENV

Valid For

Extract and Replicat

Any SETENV values should be set before any USERID, USERIDALIAS, FETCHUSERID, FETCHUSERIDALIAS, TRANLOGOPTIONS MININGUSER, MININGUSERALIAS, SOURCEDB or, TARGETDB entries in the parameter files.

Description

Use the SETENV parameter to set a value for an environment variable. When Extract or Replicat starts, it uses the specified value instead of the one that is set in the operating system environment. A variable set in the SETENV statement overrides any existing variables set at the operating system level. Use one SETENV statement per variable to be set.

For integrated extracts, you can set new environment variables if they are available from the lcr server. The new environment variables are:
  • USERNAME: Database login user name
  • OSUSERNAME: Operating System user name

  • MACHINENAME: Name of the host, machine, or server where the database is running

  • PROGRAMNAME: Name of program or application that started the transaction or session

  • CLIENTIDENTIFIER: Value set using DBMS_SESSION.set_identifier()

SETENV cannot be used with query parameters.

Default

None

Syntax

SETENV (
{environment_variable |
  GGS_CacheRetryCount |
  GGS_CacheRetryDelay}
= 'value'
)
environment_variable

The name of the environment variable to be set.

'value'

A value for the specified variable. Enclose the value within single quotes.

GGS_CacheRetryCount

(SQL Server) Oracle GoldenGate environment parameter that controls the number of times that Extract tries to read the source transaction log files when they are blocked because of excessive system activity. The default is 10 retries. After trying the specified number of times, Extract abends with an error that begins as follows:

GGS ERROR 600 [CFileInfo::Read] Timeout expired after 10 retries with 1000 ms delay waiting to read transaction log or backup files.

If you continue to see timeout messages in the report file or error log, increase this parameter to allow more retries.

GGS_CacheRetryDelay

(SQL Server) Oracle GoldenGate environment parameter that controls the number of milliseconds that Extract waits before trying again to read the transaction logs when the previous attempt has failed. The default is 1000 milliseconds delay.

Examples

Example 1   

Using separate SETENV statements allows a single instance of Oracle GoldenGate to connect to multiple Oracle database instances without having to change environment settings. The following parameter statements set a value for ORACLE_HOME and ORACLE_SID.

SETENV (ORACLE_HOME = '/home/oracle/ora9/product')
SETENV (ORACLE_SID = 'ora9')
Example 2   

The following parameter statements set values for Oracle GoldenGate in a SQL Server environment where Extract tries to read the transaction log for a maximum of 20 times before abending, with a delay of 3000 milliseconds between tries.

SETENV (GGS_CacheRetryCount = 20)
SETENV (GGS_CacheRetryDelay = 3000)