Customizing Oracle VDB environment variables
Overview
This topic describes how to customize the set of environment variables sourced prior to administering an Oracle virtual database (VDB). Certain Oracle database parameters are sensitive to the environment variables present when you start or administer the database. For this reason, the Delphix Engine allows you to dictate custom environment variables that will be set prior to any administrative action, such as provision, start, stop, rollback, or refresh.
You can specify environment variables by two different means:
Name-value pair – A literal variable name and value to be set
Environment file – An environment file to be sourced
Environment variables for Oracle RAC databases might vary in value between cluster nodes. Therefore, environment variable specifications for an Oracle RAC database must specify the cluster node to which they apply.
Setting custom environment variables
Prerequisites
If you are adding any environment variables that are environment files, these files must be accessible on the target environment.
Procedure
You can configure custom environment variables in the Provision Wizard.
On the Target Environment tab, click Advanced. or
You can also configure these variables on the Configuration tab when the VDB is disabled.
Click the Plus icon to add an environment variable.
Choose a format for the environment variable.
Name-Value Pair
Enter a Name to identify the variable.
Enter the variable's Value.
For Oracle RAC databases, you must also specify the cluster node to which this environment variable applies.
Environment File
Enter an absolute path to an environment file on the target environment. This path can be followed by parameters. Paths and parameters are separated by spaces.
Escaping Spaces
To specify literal spaces, escape them with a backslash ("hello\ world" -> "hello world"). To specify literal backslashes, escape them with a backslash ("foo\" -> "foo"). Any other character preceded by a backslash will retain both the backslash and the original character ("\b" -> "\b"). Escaping is done in order from left to right ("part1\ part2" -> "part1" "part2" will be two parameters).
For Oracle RAC databases, you must also specify the cluster node to which this environment variable applies.
Save the custom environment variables by completing provisioning, or clicking the Confirm. These environment variables will take effect when you start the Oracle VDB.
Environment variable denylist
The Delphix Engine denylists the following environment variables; they cannot be set by the user.
ORACLE_SID
ORACLE_BASE
ORACLE_HOME
CRS_HOME
ORACLE_UNQNAME
ORAENV_ASK
LOGON_STR
DLPX_SHELL
SQLPLUS_PLSQL_MODIFIERS
SQLPLUS_DML_MODIFIERS
SQLPLUS_DDL_MODIFIERS
If a Name-Value pair has any one of these prohibited environment variables as the name, an error will be raised.
If an environment file sets one of these variables, the Delphix Engine will override this value when the Oracle VDB is started.
The following environment variables will be set before invoking the user-specified script, and thus can be accessed within the script.
ORACLE_SID
ORACLE_BASE
ORACLE_HOME
CRS_HOME
ORACLE_UNQNAME
User-Input sanitation for environment variables
For security purposes, user-input provided through the custom environment variables feature retains its literal value when interpreted, including ', ", and undefinedORACLE_HOME
undefinedORACLE_SID
undefinedORACLE_UNQNAME
undefinedPATH
Caveats
Environment variables are sourced on provision, start, stop, rollback, and refresh. Custom environment variables are not applicable to V2P.
Custom environment variables do not propagate to child VDBs and must be set again on provision.
Custom environment variables do not persist after migration. On migration of a VDB with custom environment variables, an alert will be raised that the custom environment variables have been removed from the VDB. In order to view the alert, go to System > Event Viewer.
Custom environment variables are not available within scripts executed by VDB Hook Operations.