Why does the application backup job for an Oracle RMAN backup use an unexpected policy or Application Schedule?

Article: 100024513
Last Published: 2013-10-24
Ratings: 0 0
Product(s): NetBackup & Alta Data Protection

Problem

When RMAN is initiated from the Oracle client host, the Application backup jobs may use an unexpected policy and/or schedule.  Even when the backup is initiated from an Automatic schedule on the master server, the Application jobs may use a different policy and/or schedule.
 

Cause

There are two factors that contribute to this situation.

First, when a backup is initiated from an Automatic schedule on the master server, the names of the policy and Automatic schedule are passed from the master server to the client host via the environmental variables NB_ORA_POLICY and NB_ORA_PC_SCHED.  These NetBackup variables are available to the shell program that starts RMAN.

However, the Oracle server process that performs the backup is usually not a child of the RMAN process and in fact may not even be running on the same host as RMAN.  Because of this, the environment variables are unavailable to the process that queues the backup requests for the Application jobs.

Second, because RMAN and the Oracle server process may not provide the name of specific policy or Application schedule, the NetBackup master server will arbitrarily use any policy of type Oracle for this client and arbitrarily use any Application schedule therein with an open window.

This may result in the Application backup jobs using an unexpected storage unit, volume pool, multiplexing, retention, or copies.
 

Solution

If there is more than one Oracle policy for the client, or the policy has more than one Application schedule, then the user must ensure that the RMAN commands pass the desired policy and schedule name to the Oracle server process of which NetBackup for Oracle is a part.

In this example, there are backup policies for two Oracle databases on the same host.  There is a unique backup policy for each database.  Each policy contains automatic and application schedules for both monthly and weekly backups where the monthly backup schedules use a different pool and retention.  The backup script must ensure that RMAN sends the correct policy and schedule to ensure the correct storage attributes.

# Save the policy that initiated the backup from the master server (or set manually based on SID).
USE_POLICY="$NB_ORA_POLICY"

# Select the Application schedule based on the Automatic schedule (or set manually)
if [ "$NB_ORA_PC_SCHED" = "run_monthly" ]; then
     USE_SCHED="store_monthly"
else
     USE_SCHED="store_weekly"
fi

# Start RMAN and ensure that the correct names are passed to the Oracle server process.
rman <options> <<-EOD
run {
     ALLOCATE CHANNEL <options> TYPE 'SBT_TAPE' ;
     SEND "NB_ORA_POLICY=$USE_POLICY,NB_ORA_SCHED=$USE_SCHED" ;
     BACKUP <options> ;
     RELEASE CHANNEL <options> ;
}
EOD

Notice that the environment variable name received from the master server is NB_ORA_PC_SCHED while the parameter name passed from RMAN is NB_ORA_SCHED.  The former is an automatic schedule, the latter is an application schedule.
 

 


Applies To

Any version of NetBackup
Any version of Oracle

Was this content helpful?