Skip to main content
SnapCenter Software 4.6
A newer release of this product is available.

Predefined environment variables for backup specific prescript and postscript

Contributors netapp-soumikd

SnapCenter allows you to use the predefined environment variables when you execute the prescript and postscript while creating backup policies. This functionality is supported for all Oracle configurations except for VMDK.

SnapCenter predefines the values of the parameters that will be directly accessible in the environment where the shell scripts are executed. You do not have to manually specify the values of these parameters when executing the scripts.

Supported predefined environment variables for creating backup policy

  • SC_JOB_ID specifies the job ID of the operation.

    Example: 256

  • SC_ORACLE_SID specifies the system identifier of the database.

    If the operation involves multiple databases, the parameter will contain database names separated by pipe.

    This parameter will be populated for application volumes.

    Example: NFSB32|NFSB31

  • SC_HOST specifies the host name of the database.

    For RAC, host name will be the name of the host on which backup is performed.

    This parameter will be populated for application volumes.

    Example: scsmohost2.gdl.englabe.netapp.com

  • SC_OS_USER specifies the operating system owner of the database.

    The data will be formatted as <db1>@<osuser1>|<db2>@<osuser2>.

    Example: NFSB31@oracle|NFSB32@oracle

  • SC_OS_GROUP specifies the operating system group of the database.

    The data will be formatted as <db1>@<osgroup1>|<db2>@<osgroup2>.

    Example: NFSB31@install|NFSB32@oinstall

  • SC_BACKUP_TYPE" specifies the backup type (online full, online data, online log, offline shutdown, offline mount)

    Examples:

    • For full backup: ONLINEFULL

    • data only backup: ONLINEDATA

    • For log only backup: ONLINELOG

  • SC_BACKUP_NAME specifies the name of the backup.

    This parameter will be populated for application volumes.

    Example: DATA@RG2_scspr2417819002_07-20-2021_12.16.48.9267_0|LOG@RG2_scspr2417819002_07-20-2021_12.16.48.9267_1|AV@RG2_scspr2417819002_07-20-2021_12.16.48.9267

  • SC_BACKUP_ID specifies the backup ID.

    This parameter will be populated for application volumes.

    Example: DATA@203|LOG@205|AV@207

  • SC_ORACLE_HOME specifies the path of the Oracle home directory.

    Example: NFSB32@/ora01/app/oracle/product/18.1.0/db_1|NFSB31@/ora01/app/oracle/product/18.1.0/db_1

  • SC_BACKUP_RETENTION specifies the retention period defined in the policy.

    Examples:

    • For full backup: Hourly|DATA@DAYS:3|LOG@COUNT:4

    • For on-demand data only backup: Ondemand|DATA@COUNT:2

    • For on-demand log only backup: Ondemand|LOG@COUNT:2

  • SC_RESOURCE_GROUP_NAME specifies the name of the resource group.

    Example: RG1

  • SC_BACKUP_POLICY_NAME specifies the name of the backup policy.

    Example: backup_policy

  • SC_AV_NAME specifies the names of the application volumes.

    Example: AV1|AV2

  • SC_PRIMARY_DATA_VOLUME_FULL_PATH specifies the storage mapping of SVM to volume for data files directory. It will be the name of the parent volume for luns and qtrees.

    The data will be formatted as <db1>@<SVM1:volume1>|<db2>@<SVM2:volume2>.

    Examples:

    • For 2 databases in the same resource group: NFSB32@buck:/vol/scspr2417819002_NFS_CDB_NFSB32_DATA|NFSB31@buck:/vol/scspr2417819002_NFS_CDB_NFSB31_DATA

    • For single database with data files spread across multiple volumes: buck:/vol/scspr2417819002_NFS_CDB_NFSB31_DATA,herculus:/vol/scspr2417819002_NFS

  • SC_PRIMARY_ARCHIVELOGS_VOLUME_FULL_PATH specifies the storage mapping of SVM to volume for logs file directory. It will be the name of the parent volume for luns and qtrees.

    Examples:

    • For single database instance: buck:/vol/scspr2417819002_NFS_CDB_NFSB31_REDO

    • For multiple database instances: NFSB31@buck:/vol/scspr2417819002_NFS_CDB_NFSB31_REDO|NFSB32@buck:/vol/scspr2417819002_NFS_CDB_NFSB32_REDO

  • SC_PRIMARY_FULL_SNAPSHOT_NAME_FOR_TAG specifies the list of Snapshots containing storage system name and volume name.

    Examples:

    • For single database instance: buck:/vol/scspr2417819002_NFS_CDB_NFSB32_DATA/RG2_scspr2417819002_07-21-2021_02.28.26.3973_0,buck:/vol/scspr2417819002_NFS_CDB_NFSB32_REDO/RG2_scspr2417819002_07-21-2021_02.28.26.3973_1

    • For multiple database instances: NFSB32@buck:/vol/scspr2417819002_NFS_CDB_NFSB32_DATA/RG2_scspr2417819002_07-21-2021_02.28.26.3973_0,buck:/vol/scspr2417819002_NFS_CDB_NFSB32_REDO/RG2_scspr2417819002_07-21-2021_02.28.26.3973_1|NFSB31@buck:/vol/scspr2417819002_NFS_CDB_NFSB31_DATA/RG2_scspr2417819002_07-21-2021_02.28.26.3973_0,buck:/vol/scspr2417819002_NFS_CDB_NFSB31_REDO/RG2_scspr2417819002_07-21-2021_02.28.26.3973_1

  • SC_PRIMARY_SNAPSHOT_NAMES specifies the names of the primary Snapshots created during the backup.

    Examples:

    • For single database instance: RG2_scspr2417819002_07-21-2021_02.28.26.3973_0,RG2_scspr2417819002_07-21-2021_02.28.26.3973_1

    • For multiple database instances: NFSB32@RG2_scspr2417819002_07-21-2021_02.28.26.3973_0,RG2_scspr2417819002_07-21-2021_02.28.26.3973_1|NFSB31@RG2_scspr2417819002_07-21-2021_02.28.26.3973_0,RG2_scspr2417819002_07-21-2021_02.28.26.3973_1

    • For consistency group Snapshots that involves 2 volumes: cg3_R80404CBEF5V1_04-05-2021_03.08.03.4945_0_bfc279cc-28ad-465c-9d60-5487ac17b25d_2021_4_5_3_8_58_350

  • SC_PRIMARY_MOUNT_POINTS specifies the mount point details which are part of the backup.

    The details include the directory on which volumes are mounted and not the immediate parent of the file under backup. For an ASM configuration, it is the name of the disk group.

    The data will be formatted as <db1>@<mountpoint1,mountpoint2>|<db2>@<mountpoint1,mountpoint2>.

    Examples:

    • For single database instance: /mnt/nfsdb3_data,/mnt/nfsdb3_log,/mnt/nfsdb3_data1

    • For multiple database instances: NFSB31@/mnt/nfsdb31_data,/mnt/nfsdb31_log,/mnt/nfsdb31_data1|NFSB32@/mnt/nfsdb32_data,/mnt/nfsdb32_log,/mnt/nfsdb32_data1

    • For ASM: +DATA2DG,+LOG2DG

  • SC_PRIMARY_SNAPSHOTS_AND_MOUNT_POINTS specifies the names of the snapshots created during the backup of each of the mount points.

    Examples:

    • For single database instance: RG2_scspr2417819002_07-21-2021_02.28.26.3973_0:/mnt/nfsb32_data,RG2_scspr2417819002_07-21-2021_02.28.26.3973_1:/mnt/nfsb31_log

    • For multiple database instances: NFSB32@RG2_scspr2417819002_07-21-2021_02.28.26.3973_0:/mnt/nfsb32_data,RG2_scspr2417819002_07-21-2021_02.28.26.3973_1:/mnt/nfsb31_log|NFSB31@RG2_scspr2417819002_07-21-2021_02.28.26.3973_0:/mnt/nfsb31_data,RG2_scspr2417819002_07-21-2021_02.28.26.3973_1:/mnt/nfsb32_log

  • SC_ARCHIVELOGS_LOCATIONS specifies the location of the archive logs directory.

    The directory names will be the immediate parent of the archive log files. If the archive logs are placed in more than one location then all the locations will be captured. This also includes the FRA scenarios. If softlinks are used for directory then the same will be populated.

    Examples:

    • For single database on NFS: /mnt/nfsdb2_log

    • For multiple databases on NFS and for the NFSB31 database archive logs that are placed in two different locations: NFSB31@/mnt/nfsdb31_log1,/mnt/nfsdb31_log2|NFSB32@/mnt/nfsdb32_log

    • For ASM: +LOG2DG/ASMDB2/ARCHIVELOG/2021_07_15

  • SC_REDO_LOGS_LOCATIONS specifies the location of the redo logs directory.

    The directory names will be the immediate parent of the redo log files. If softlinks are used for directory then the same will be populated.

    Examples:

    • For single database on NFS: /mnt/nfsdb2_data/newdb1

    • For multiple databases on NFS: NFSB31@/mnt/nfsdb31_data/newdb31|NFSB32@/mnt/nfsdb32_data/newdb32

    • For ASM: +LOG2DG/ASMDB2/ONLINELOG

  • SC_CONTROL_FILES_LOCATIONS specifies the location of the control files directory.

    The directory names will be the immediate parent of the control files. If softlinks are used for directory then the same will be populated.

    Examples:

    • For single database on NFS: /mnt/nfsdb2_data/fra/newdb1,/mnt/nfsdb2_data/newdb1

    • For multiple databases on NFS: NFSB31@/mnt/nfsdb31_data/fra/newdb31,/mnt/nfsdb31_data/newdb31|NFSB32@/mnt/nfsdb32_data/fra/newdb32,/mnt/nfsdb32_data/newdb32

    • For ASM: +LOG2DG/ASMDB2/CONTROLFILE

  • SC_DATA_FILES_LOCATIONS" specifies the location of the data files directory.

    The directory names will be the immediate parent of the data files. If softlinks are used for directory then the same will be populated.

    Examples:

    • For single database on NFS: /mnt/nfsdb3_data1,/mnt/nfsdb3_data/NEWDB3/datafile

    • For multiple databases on NFS: NFSB31@/mnt/nfsdb31_data1,/mnt/nfsdb31_data/NEWDB31/datafile|NFSB32@/mnt/nfsdb32_data1,/mnt/nfsdb32_data/NEWDB32/datafile

    • For ASM: +DATA2DG/ASMDB2/DATAFILE,+DATA2DG/ASMDB2/TEMPFILE

  • SC_SNAPSHOT_LABEL specifies the name of the secondary labels.

    Examples: Hourly, Daily, Weekly, Monthly, or custom label.

Supported delimiters

  • : is used to separate SVM name and volume name

    Example: buck:/vol/scspr2417819002_NFS_CDB_NFSB32_DATA/RG2_scspr2417819002_07-21-2021_02.28.26.3973_0,buck:/vol/scspr2417819002_NFS_CDB_NFSB32_REDO/RG2_scspr2417819002_07-21-2021_02.28.26.3973_1

  • @ is used to separate data from its database name and to separate the value from its key.

    Examples:

    • NFSB32@buck:/vol/scspr2417819002_NFS_CDB_NFSB32_DATA/RG2_scspr2417819002_07-21-2021_02.28.26.3973_0,buck:/vol/scspr2417819002_NFS_CDB_NFSB32_REDO/RG2_scspr2417819002_07-21-2021_02.28.26.3973_1|NFSB31@buck:/vol/scspr2417819002_NFS_CDB_NFSB31_DATA/RG2_scspr2417819002_07-21-2021_02.28.26.3973_0,buck:/vol/scspr2417819002_NFS_CDB_NFSB31_REDO/RG2_scspr2417819002_07-21-2021_02.28.26.3973_1

    • NFSB31@oracle|NFSB32@oracle

  • | is used to separate the data between two different databases and to separate the data between two different entities for SC_BACKUP_ID, SC_BACKUP_RETENTION, and SC_BACKUP_NAME parameters.

    Examples:

    • DATA@203|LOG@205

    • Hourly|DATA@DAYS:3|LOG@COUNT:4

    • DATA@RG2_scspr2417819002_07-20-2021_12.16.48.9267_0|LOG@RG2_scspr2417819002_07-20-2021_12.16.48.9267_1

  • / is used to separate the volume name from it's Snapshot for SC_PRIMARY_SNAPSHOT_NAMES and SC_PRIMARY_FULL_SNAPSHOT_NAME_FOR_TAG parameters.

    Example: NFSB32@buck:/vol/scspr2417819002_NFS_CDB_NFSB32_DATA/RG2_scspr2417819002_07-21-2021_02.28.26.3973_0,buck:/vol/scspr2417819002_NFS_CDB_NFSB32_REDO/RG2_scspr2417819002_07-21-2021_02.28.26.3973_1

  • , is used to separate set of variables for the same DB.

    Example: NFSB32@buck:/vol/scspr2417819002_NFS_CDB_NFSB32_DATA/RG2_scspr2417819002_07-21-2021_02.28.26.3973_0,buck:/vol/scspr2417819002_NFS_CDB_NFSB32_REDO/RG2_scspr2417819002_07-21-2021_02.28.26.3973_1|NFSB31@buck:/vol/scspr2417819002_NFS_CDB_NFSB31_DATA/RG2_scspr2417819002_07-21-2021_02.28.26.3973_0,buck:/vol/scspr2417819002_NFS_CDB_NFSB31_REDO/RG2_scspr2417819002_07-21-2021_02.28.26.3973_1