About the Oracle RMAN environment in NetBackup for Oracle
The Oracle RMAN program inherits the environment of the program or shell from which it was started. The environment may come from a number of places:
The global environment or profile for the host
The profile of the user
The NetBackup primary server
A non-NetBackup scheduler
A backup script
An interactive terminal session
Additionally, once RMAN is started it connects to the database and starts the Oracle database server processes that perform the backup. If the connection is by local logon and password (without a TNS alias), the Oracle database server process is a child of the RMAN program. The Oracle database server process inherits the environment from RMAN. Because the NetBackup for Oracle agent is a shared library loaded into the Oracle database server process it too inherits that environment.
However, if RMAN connects to the database by SQL*Net (logon and password@TNSalias) the Oracle database server process is a child of the SQL*Net listener service. This SQL*Net listener service was started previously and independently of RMAN. As a result, the NetBackup for Oracle agent does not inherit the environment from RMAN. Instead, the agent inherits the environment from which the listener service was started
To avoid unexpected results, it is recommended to configure RMAN to always use the send command to pass the desired variables and values to NetBackup explicitly. Alternatively the RMAN ENV parameter can be used to make the variables and values available to NetBackup.
Example 1. Use the send command to specify the policy and server to use for a database backup. As this example shows, specify the variables in the string in the RMAN script after all channels have been allocated and before the backup command.
run {
allocate channel t1 type 'SBT_TAPE';
allocate channel t2 type 'SBT_TAPE';
send 'NB_ORA_POLICY=your_policy,NB_ORA_SERV=your_server';
backup (database format 'bk_%U_%t');
release channel t1;
release channel t2;
}Example 2. Use the parms operand to specify the policy and server to use for a database backup. The parms operand is set with each allocate channel command in the shell script.
run {
allocate channel t1 DEVICE TYPE 'SBT_TAPE'
PARMS "SBT_LIBRARY=/usr/openv/netbackup/bin/libobk.so,
ENV=(NB_ORA_POLICY=your_policy,NB_ORA_SERV=your_server)";
allocate channel t2 DEVICE TYPE 'SBT_TAPE'
PARMS "SBT_LIBRARY=/usr/openv/netbackup/bin/libobk.so,
ENV=(NB_ORA_POLICY=your_policy,NB_ORA_SERV=your_server)";
backup (database format 'bk_%s_%p_%t');
release channel t1;
release channel t2;
}