NetBackup for DB2 environment variables
The NetBackup automatic scheduler creates the environment variables in the following table when it runs a NetBackup for DB2 backup or restore script. You can use the DB2_FULL, DB2_INCR, or DB2_CINC variables within a script to specify a backup type.
Note:
Only the NetBackup backup and restore scripts use the environment variables in the following table. These variables are unknown to the DB2 backup and restore commands. For example, the backup command and the restore command do not process the DB2_POLICY variable. Instead, the scripts use the POLICY name. This policy is defined in the $DB2_INSTANCE_HOME/db2.conf file (UNIX) or the install_path\NetBackup\dbext\db2\db2.conf file (Windows).
Table: DB2 environment variables describes the DB2 environment variables.
Table: DB2 environment variables
Environment variable | Purpose |
|---|---|
DB2_POLICY | Name of the NetBackup for DB2 policy from which the Automatic Backup was started. This policy name is not necessarily the same policy name that is in the db2.conf file. This variable is set only if the backup is initiated from the server, either automatically by the NetBackup scheduler or manually through the administrator interface. |
DB2_SERVER | Name of the NetBackup server. |
DB2_CLIENT | Name of DB2 client. |
DB2_SCHED | Name of the NetBackup schedule. Enabled only if the backup is initiated from the server, either automatically by the NetBackup scheduler or manually through the administrator interface. |
DB2_SCHEDULED | Set to 1 if this backup is a scheduled backup type (Automatic Backup). |
DB2_USER_INITIATED | Set to 1 if this backup is a user-initiated backup type (Application Backup backup). |
DB2_FULL | Set to 1 for an Automatic full backup. |
DB2_INCR | Set to 1 for an Automatic Differential incremental backup. |
DB2_CINC | Set to 1 for an Automatic Cumulative incremental backup. |
DB2_CATALOG_HOST | The catalog name under which backup images are cataloged. |
DB2_PARENT_JOBID | Parent job ID of the current backup job. Note: DB2_PARENT_JOBID parameter must be specified as OPTIONS for every DB2 backup command in the script. For Windows, the command is used as follows: BACKUP DATABASE %db2_name% %db2_action% LOAD %db2_nblib% %db2_sessions% OPTIONS "DB2_PARENT_JOBID = %DB2_PARENT_JOBID%" For UNIX/Linux, the command is used as follows: db2 BACKUP DATABASE $MY_DB2 $MY_SCHED LOAD $MY_LIB OPEN 4 SESSIONS OPTIONS "DB2_PARENT_JOBID=$DB2_PARENT_JOBID" BUFFER 1024 For more information about the syntax, refer to the sample DB2 backup scripts that are installed on the client. |