How to configure Oracle Recovery Manager backup frequency and image retention in VERITAS NetBackup (tm)
| Article:TECH27133 | | | Created: 2003-01-31 | | | Updated: 2005-01-16 | | | Article URL http://www.symantec.com/docs/TECH27133 |
Problem
How to configure Oracle Recovery Manager backup frequency and image retention in VERITAS NetBackup (tm)
Solution
These backups are controlled by a script which sets up the
Oracle environment and runs the Oracle Recovery Manager (RMAN) utility. The RMAN
utility then interacts with the NetBackup Oracle extension to transport the data
to tape. The manner in which the script is initiated and how NetBackup receives
the backup image from RMAN can cause confusion with regard to the frequency of
backups and retention of backup images.
Typically, there are two parts to the policy configuration on the NetBackup master server. The first part is the creation of a full backup schedule and possibly one or more incremental backup schedules. These schedules execute the script which sets up the Oracle environment and runs RMAN. Hence, the window and frequency of these schedules determines when the backup will run and should be set appropriately. Set the retention on this schedule to a value larger than the frequency. This retention value controls the length of time NetBackup retains the information about the last execution of the schedule and is used with frequency to determine the next time to run the schedule. This part of the configuration is optional if a third-party scheduler will be used to execute the RMAN script.
The second part of the policy configuration is the creation of a schedule of type Application Backup, which receives the backup requests from RMAN and writes the images to tape. This schedule typically has a 24x7 backup window to allow it to accept jobs from the client at any time. Because this is the schedule that receives the images, the images are assigned the retention configured for this schedule, regardless of how the backup was initiated (full schedule, incremental schedule, running backup script by hand). The frequency setting on the Application Backup schedule is not used because these backups are all user-directed by RMAN. This schedule is automatically created when a new policy of type Oracle is created. Do not delete this schedule.
Observe the NetBackup Activity Monitor after starting an Oracle backup. The first job to appear is the controlling job from the full or incremental schedule which runs the script to initiate RMAN. Once RMAN gathers the data files into one or more backup sets, additional jobs will appear in the Activity Monitor under the Application Backup schedule. There will be one of the latter jobs for each backup set piece created by RMAN. Those jobs will appear sequentially as RMAN allocates channels, and they will complete as each backup set piece is written to tape as a NetBackup image. Once all of the Application Backup jobs complete and RMAN terminates, then the first job will also finish.
What about different retention levels for full versus incremental schedules?
Because of the above implementation, all backup images resulting from the full and incremental schedules in a single policy will have the same retention, that of the Application Backup schedule (e.g. Default-Application-Backup). If it is desired to have different retention levels for full and incremental backup images, then two additional configuration steps are necessary.
Note that the discussion below does not apply to backups performed using the NetBackup Oracle Template Wizard. This functionality is only available when a backup script is being used to perform the backups.
1. On the master server, configure a second Application Backup schedule (e.g. Incremental-Application-Backup) in the policy. Set the retention for this schedule to the desired value and provide a 24x7 or otherwise appropriate window to receive the backup images. Also set MPX, volume pool, and other attributes as desired.
2. On the database client host, customize the RMAN backup script to evaluate the variables (NB_ORA_FULL, NB_ORA_CINC, NB_ORA_INCR, and NB_ORA_POLICY) passed from the NetBackup automatic schedule job, and then generate an appropriate RMAN command to forward appropriate variables (NB_ORA_SCHED) to the NetBackup user-directed backup job. For example:
Typically, there are two parts to the policy configuration on the NetBackup master server. The first part is the creation of a full backup schedule and possibly one or more incremental backup schedules. These schedules execute the script which sets up the Oracle environment and runs RMAN. Hence, the window and frequency of these schedules determines when the backup will run and should be set appropriately. Set the retention on this schedule to a value larger than the frequency. This retention value controls the length of time NetBackup retains the information about the last execution of the schedule and is used with frequency to determine the next time to run the schedule. This part of the configuration is optional if a third-party scheduler will be used to execute the RMAN script.
The second part of the policy configuration is the creation of a schedule of type Application Backup, which receives the backup requests from RMAN and writes the images to tape. This schedule typically has a 24x7 backup window to allow it to accept jobs from the client at any time. Because this is the schedule that receives the images, the images are assigned the retention configured for this schedule, regardless of how the backup was initiated (full schedule, incremental schedule, running backup script by hand). The frequency setting on the Application Backup schedule is not used because these backups are all user-directed by RMAN. This schedule is automatically created when a new policy of type Oracle is created. Do not delete this schedule.
Observe the NetBackup Activity Monitor after starting an Oracle backup. The first job to appear is the controlling job from the full or incremental schedule which runs the script to initiate RMAN. Once RMAN gathers the data files into one or more backup sets, additional jobs will appear in the Activity Monitor under the Application Backup schedule. There will be one of the latter jobs for each backup set piece created by RMAN. Those jobs will appear sequentially as RMAN allocates channels, and they will complete as each backup set piece is written to tape as a NetBackup image. Once all of the Application Backup jobs complete and RMAN terminates, then the first job will also finish.
What about different retention levels for full versus incremental schedules?
Because of the above implementation, all backup images resulting from the full and incremental schedules in a single policy will have the same retention, that of the Application Backup schedule (e.g. Default-Application-Backup). If it is desired to have different retention levels for full and incremental backup images, then two additional configuration steps are necessary.
Note that the discussion below does not apply to backups performed using the NetBackup Oracle Template Wizard. This functionality is only available when a backup script is being used to perform the backups.
1. On the master server, configure a second Application Backup schedule (e.g. Incremental-Application-Backup) in the policy. Set the retention for this schedule to the desired value and provide a 24x7 or otherwise appropriate window to receive the backup images. Also set MPX, volume pool, and other attributes as desired.
2. On the database client host, customize the RMAN backup script to evaluate the variables (NB_ORA_FULL, NB_ORA_CINC, NB_ORA_INCR, and NB_ORA_POLICY) passed from the NetBackup automatic schedule job, and then generate an appropriate RMAN command to forward appropriate variables (NB_ORA_SCHED) to the NetBackup user-directed backup job. For example:
# Determine which schedule
should receive the backup images.
# Both schedules should be of
type 'Application Backup.'
if [ ... some condition ... ];
then
SCHED_NAME="Default-Application-Backup"
else
SCHED_NAME="Incremental-Application-Backup"
fi
# Forward the selected schedule
name to NetBackup with the data to backup.
# Use either the send statement
or the allocate parms clause as appropriate.
rman ... # For Oracle
pre-8i
allocate ...
parms="ENV=(NB_ORA_SCHED=$SCHED_NAME)";
backup ... ;
rman ... # For Oracle 8i &
9i
send
'NB_ORA_SCHED=$SCHED_NAME';
backup ... ;
For additional details, see the NetBackup 4.5 for Oracle System Administrator's Guide, pages 65-75,92-94,153-174.
What if there are multiple NetBackup policies for multiple Oracle instances on the client?
Special consideration is necessary when there are multiple NetBackup policies of type Oracle for the client. In such a configuration, RMAN does not automatically inform the NetBackup user-directed backup job of which policy to use for each backup. By default, NetBackup will use the first policy located, of type Oracle, for the client making the backup request. To use a specific policy and schedule, forward the NB_ORA_POLICY and NB_ORA_SCHED variables from RMAN to NetBackup. For example:
rman ...
allocate channel ... ;
send
'NB_ORA_POLICY=oracle_policy_name, NB_ORA_SCHED=oracle_schedule_name';
backup ... ;
If the backup is performed using a template, then please set these variables using the 'Backup policy name' and 'Schedule name' fields in the template wizard.
What if different retention levels are needed for off-site media?
If RMAN backups are to be performed for both local and off-site media storage, it is recommended to use in-line tape copy via NetBackup Vault. This will create multiple copies of a backup image simultaneously and each copy may specify a different retention. Please contact your VERITAS NetBackup sales team for information about licensing this feature. Alternatively, create a separate policy and schedules for the off-site backups, so that failures of those jobs are appropriately rescheduled by NetBackup. If using a separate policy, please be aware that RMAN does not have knowledge of which tapes are local versus off-site. Hence, care must be taken when configuring RMAN to perform restore operations where the most recent full backup was written to tapes which are now off-site.
|
|
Legacy ID
261087
Article URL http://www.symantec.com/docs/TECH27133
Terms of use for this information are found in Legal Notices









Thank you.