Saturday, December 22, 2007

How to Install, Configure, Check and Troubleshoot VERITAS NetBackup 4.5 for Oracle

How to Install, Configure,
Check and Troubleshoot
VERITAS NetBackup 4.5 for Oracle


PURPOSE

The purpose of this document is to act as a 'quick start' guide for
Installing, Configuring, Checking and Troubleshooting VERITAS NetBackup
for Oracle and its integration with Oracle RMAN.


SCOPE & APPLICATION

This document is aimed at Support Personnel. It is not intended as a
replacement for detailed VERITAS NetBackup or RMAN documentation. For
specific information about the NetBackup server software, refer to:
- NetBackup System Administrator's Guide - UNIX


Related Documents:

The following documents provide related information. For a more detailed
listing of NetBackup documents, refer to NetBackup Release Notes.
For a UNIX server, refer to these documents:
- NetBackup 4.5 for Oracle System Administrator's Guide for UNIX
How to install, configure and manage NetBackup for Oracle on a
UNIX system.
- NetBackup System Administrator's Guide for UNIX
How to configure and manage NetBackup on a UNIX system.
- NetBackup Media Manager System Administrator's Guide for UNIX
Explains how to configure and manage the storage devices and media on
UNIX NetBackup servers. Media Manager is part of NetBackup.
- NetBackup Troubleshooting Guide - UNIX
Provides troubleshooting information for UNIX-based NetBackup
products. You can also refer to www.support.veritas.com, access the
Knowledge Base Search option and search for TechNotes.


1. Introduction
===============

How Does NetBackup for Oracle on UNIX Work?

For a backup:
1. The rman command starts the requested operation on the databases.
2. When the process requires media to store backup data, RMAN starts a
user-directed backup by issuing a backup request.
3. The NetBackup master server connects to NetBackup for Oracle on UNIX on
the client and transfers the database data to secondary storage. A
restore works in essentially the same manner except that RMAN issues a
restore request. This causes NetBackup to retrieve the data from
secondary storage and send it to NetBackup for Oracle on UNIX on the
client.

Since the Oracle Recovery Manager supports parallel operations, a single
rman execution can start more than one backup or restore on the
NetBackup system.


2. Installation
===============

NOTE: To determine which Oracle version levels are supported, refer to the
Database Agent Platform Support secction in the NetBackup Release Notes.

Installation Prerequisites
--------------------------
Before installing NetBackup for Oracle on UNIX, be sure you have completed the
installation of the NetBackup server software on the server.

Note: For HP and Solaris clients, the NetBackup for Oracle installation package
includes three different NetBackup for Oracle database agents. This
combination is for installation purposes only. Each NetBackup for Oracle
database agent will continue to function with no dependencies on the other
agents. See the release notes for further explanation.


Installing NetBackup for Oracle on UNIX
There are two ways to install database agent software.
- Remote Installation
Loads the software on a master server.
The user will then push the database software out to affected clients. Refer
to the Netbackup Installation Guide.
- Local Installation
Loads and installs the software only to the local machine.

Local Installation of NetBackup for Oracle on UNIX
--------------------------------------------------
During a local installation, the NetBackup for Oracle on UNIX files are extracted
and installed. The local machine can be a client or a master server that also
happens to be a client.

Installation Requirements
-------------------------
- The version of the NetBackup Client and the version of NetBackup for Oracle on
UNIX are the same (e.g., 4.5).
- The local machine must have adequate disk space.
- Less than one megabyte of additional disk space is required in the
install_path/netbackup directory. However, more disk space may be necessary at
run time.
- NetBackup version 4.5 client software is installed and operational.
This also means that the install_path/netbackup directory already exists.

Local Install Procedure
-----------------------
1. Log in as the root user on the machine.
% su - root
- If the local machine is a client, go to step 3.
- If the local machine is a server, go to step 2.
2. Make sure a valid license key for NetBackup for Oracle on UNIX has been
registered.
To view or add license keys, perform one of the following:
- Run the command install_path/netbackup/bin/admincmd/get_license_key.
- Open the NetBackup Administration Console and from the Help menu choose
License Keys.
3. Insert the CD-ROM into the drive.
4. Change the working directory to the CD-ROM directory.
% cd /CD_mount_point
5. Load and install the software by executing the install script.
Note: It is expected that the NetBackup version level (for example, 4.5) running
on the local machine matches the version level of the database agent being installed.
% ./install
a) Select the NetBackup Database Agent Software option.
The following prompt will appear:
Do you want to do a local installation? (y/n) [n]
b) Answer y.
You are presented with a menu of all database agents available on the CD-ROM.
c) Select the NetBackup for Oracle+ option.
d) Enter q to quit selecting options.
A prompt will appear asking if the list is correct.
e) Answer y.

If installation has successfully completed, there will be a version file in directory
install_path/netbackup/ext/ that contains the version of NetBackup for Oracle on UNIX
that was installed and an installation timestamp.


Install Oracle8 Recovery Manager
--------------------------------
To configure the Oracle8 Recovery Manager, refer to the Oracle8 Server Backup and
Recovery Guide.
Linking RMAN with a library provided by NetBackup for Oracle on UNIX is the only
NetBackup requirement. Before writing to sequential devices such as tape, you must
link the Oracle8 Server software with the media management API library installed by
NetBackup for Oracle on UNIX. Oracle uses this library when it needs to write to,
or read from devices supported by Media Manager.

The default location for the NetBackup API library is /install_path/netbackup/bin,
while its name is:
- libobk.so on NCR, SGI, Sequent, Linux, and Data General
- libobk.so.1 on Solaris, Tru64 and Digital UNIX (32-bit)
- libobk.so64.1 on Solaris (64-bit)
- libobk.sl on HP-UX (32-bit)
- libobk.sl64 on HP-UX (64-bit)
- libobk.a on AIX
- libobk.a64 on AIX (64-bit)
- libobk.so64 on SGI (64-bit)

Linking Oracle8 with NetBackup for Oracle on UNIX
-------------------------------------------------
This section documents the preferred way to link Oracle with the NetBackup API library.
The linking process is not consistent across hardware platforms and Oracle Server
release levels and on some platforms, it is not consistent across OS levels. For this
writing, it was not possible to include all of the supported platform, OS level, and
Oracle Server level combinations. However, OS levels are specified when known differences
occur. Runtime problems may occur if these linking instructions are not followed.

To link Oracle8 with NetBackup for Oracle on UNIX
1. Become the Oracle user.
% su - oracle
2. Shutdown all of the Oracle instances (SIDs). The following example is for Oracle8i.
svrmgrl
SVRMGR> connect internal
shutdown
exit
Change the ORACLE_SID environment variable to any other SID that uses this Oracle
installation and repeat above commands.
3. Set up automatic or manual linking.

a) Automatic Linking
Run the oracle_link script located in install_path/netbackup/bin/
This script determines the Oracle version level and then links Oracle to NetBackup
accordingly. All output from this script will be captured in a /tmp/make_trace.pid file.
To change the trace file location, change the MAKE_TRACE variable in the oracle_link script.

b) Manual Linking
Make a copy of the existing Oracle executable.
% cd ${ORACLE_HOME}/bin
% cp oracle oracle.orig

Starting with version 8.0.4, Oracle is shipped with default media management software.
To disable this media management software you must remove or rename the libobk file from
${ORACLE_HOME}/lib. It may be a file or a symbolic link. To satisfy this and other linking
requirements, follow the instructions below for your specific platform and version of Oracle.

On (32-bit or 64-bit) Solaris using 32-bit Oracle software.
a. Create a symbolic link from Oracle to the NetBackup API library

Oracle8 Release 8.0.3, 8.0.4, 8.0.5, 8.0.5.1, and 8.0.6 and
Oracle8i Release 8.1.5 and 8.1.7
$ cd ${ORACLE_HOME}/lib
$ ls -l libobk.so
If libobk.so exists.
$ mv libobk.so libobk.so.orig
$ ln -s /install_path/netbackup/bin/libobk.so.1 libobk.so

Oracle8i Release 8.1.6
$ cd ${ORACLE_HOME}/lib
$ ls -l libdsbtsh8.so
$ If libdsbtsh8.so exists.
$ mv libdsbtsh8.so libdsbtsh8.so.orig
$ ln -s /install_path/netbackup/bin/libobk.so.1 libdsbtsh8.so

Oracle8i Release 8.1.5, 8.1.6, and 8.1.7
This is the only required step. You no longer have to make a new Oracle
executable to use the NetBackup for Oracle API library. With Oracle 8i, the Oracle
executable always looks for the shared library: ${ORACLE_HOME}/lib/libobk.so.

b. Make a new Oracle executable
$ cd ${ORACLE_HOME}/rdbms/lib

Oracle8 Release 8.0.3, 8.0.4, 8.0.5, 8.0.5.1, and 8.0.6
$ make -f ins_rdbms.mk ioracle

Procedure to verify library is linked, VERITAS path should be first one.
$ ldd $ORACLE_HOME/bin/oracle
libobk.so => /install_path/netbackup/bin/libobk.so
libnsl.so.1 => /usr/lib/libnsl.so.1
libsocket.so.1 => /usr/lib/libsocket.so.1
libdl.so.1 => /usr/lib/libdl.so.1
libc.so.1 => /usr/lib/libc.so.1
libaio.so.1 => /usr/lib/libaio.so.1
libm.so.1 => /usr/lib/libm.so.1
libmp.so.2 => /usr/lib/libmp.so.2

On 64-bit Solaris using 64-bit Oracle software
Use the same procedure as with 32 bits software but
change the directory `lib' to `lib64'


Install Oracle9i Recovery Manager
---------------------------------
To configure the Oracle9i Recovery Manager, refer to the Oracle9i Server Backup
and Recovery Guide.
Linking RMAN with a library provided by NetBackup for Oracle on UNIX is the only
NetBackup requirement. Before writing to sequential devices such as tape, you must
link the Oracle9i Server software with the media management API library installed
by NetBackup for Oracle on UNIX. Oracle uses this library when it needs to write to,
or read from devices supported by Media Manager.

The default location for the NetBackup API library is /usr/openv/netbackup/bin; while
its name is:
- libobk.a64 on AIX (64-bit)
- libobk.so on NCR, SGI, Sequent, Linux, and Data General
- libobk.so.1 on Solaris, Tru64 and Digital UNIX (32-bit)
- libobk.so64.1 on Solaris (64-bit)
- libobk.sl on HP-UX (32-bit)
- libobk.sl64 on HP-UX (64-bit)
- libobk.a on AIX
- libobk.so64 on SGI (64-bit)


Linking Oracle9i with NetBackup for Oracle on UNIX
--------------------------------------------------
This section documents the preferred way to link Oracle with the NetBackup API library.
The linking process is not consistent across hardware platforms and Oracle Server release
levels and on some platforms, it is not consistent across OS levels. For this writing, it was
not possible to include all of the supported platform, OS level, and Oracle Server level
combinations. However, OS levels are specified when known differences occur.
Runtime problems may occur if these linking instructions are not followed.

To link Oracle9i with NetBackup for Oracle on UNIX
1. Become the Oracle user.
$ su - oracle
2. Shutdown all of the Oracle instances (SIDs).
$ sqlplus /nolog
SQL> connect sys/change_on_install as sysdba (login/password)
shutdown
exit
Change then ORACLE_SID environment variable to any other SID that uses this
Oracle installation and repeat above commands.
3. Set up automatic or manual linking.

- Automatic Linking
See Oracle8/8i
- Manual Linking
Starting with version 8.0.4, Oracle is shipped with default media management
software. To disable this media management software you must remove or
rename the libobk file from ${ORACLE_HOME}/lib. It may be a file or a symbolic
link. To satisfy this and other linking requirements, follow the instructions below
for your specific platform and version of Oracle.

Solaris (32-bit or 64-bit) using 32-bit Oracle software.
a. Create a symbolic link from Oracle to the NetBackup API library
$ cd ${ORACLE_HOME}/lib
$ ls -l libobk.so
$ If libobk.so exists.
$ mv libobk.so libobk.so.orig
$ ln -s /usr/openv/netbackup/bin/libobk.so.1 libobk.so

Solaris 64-bit using 64-bit Oracle software.
a. Create a symbolic link from Oracle to the NetBackup API library
$ cd ${ORACLE_HOME}/lib
$ ls -l libobk.so
If libobk.so exists.
$ mv libobk.so libobk.so.orig
$ ln -s /usr/openv/netbackup/bin/libobk.so64.1 libobk.so

This is the only required step. You no longer have to make a new Oracle
executable to use the NetBackup for Oracle API library. With Oracle8i the Oracle
executable always looks for the shared library: ${ORACLE_HOME}/lib/libobk.so.


Linking Rollback Procedure
If you run into problems and are unable to re-link Oracle with NetBackup for
Oracle on UNIX, you can roll back what you have done by entering the following
command:
$ cd $ORACLE_HOME/bin
$ cp oracle.orig oracle
$ cd $ORACLE_HOME/lib
$ mv libobk.so.orig libobk.so
(or whatever the API library file was originally called).


Install Oracle Recovery Catalog
===============================

Create a recovery catalog, as detailed in Note 50875.1.
The recovery catalog schema can be initially sized at 20MB.

Setup SQLNet Connectivity to Recovery Catalog
=============================================
A TCP loopback test to the catalog should be performed.

% sqlplus rman/rman@catalog
where the SQL*Net alias for the catalog database is 'catalog'.

Setup SQLNet Connectivity to Target Database
===============================================
A user with SYSDBA privileges is required to connect to the target database.

i. set up remote logins to the target database
a. add the following to the init.ora:
remote_login_passwordfile=exclusive
b. create a password file
orapwd file=$ORACLE_HOME/dbs/orapw$SID password=oracle
ii. for the above changes to take affect, stop/start the target instance
iii. create a user, and grant SYSDBA priveleges
This step is optional, as the 'internal' could be used.
SVRMGR> create user targdba identified by targdba
temporary tablespace temp
default tablespace users quota unlimited on users;
SVRMGR> grant connect, resource to targdba;
SVRMGR> grant sysdba to targdba;

Note, if (i) and (ii) have not succeeded, this step will fail with
ORA 1994 - GRANT failed: cannot add users to public password file

iv. Do a loopback test as the SYSDBA user

% sqlplus targdba/targdba@target
or
% sqlplus internal/oracle@target
where the SQLnet alias for the target database is 'target'.

Enable Archiving
================
RMAN catalog and the target database may need to have archiving enabled.
eg, init.ora changes:
log_archive_dest = /oracle/OFA_base/app/oracle/admin/V817/arch/arch_
log_archive_format = t%t_s%s.arc
log_archive_start = true

SQL> startup mount
SQL> alter database archivelog;
SQL> alter database open;


Configuration
=============

Configuration Using the NetBackup Administration Console for UNIX
Although the database agent is installed on the NetBackup client, some configuration
procedures are performed using the NetBackup Administration Console on the server.

These procedures include:
- Configuring the Media Manager
- Setting the Maximum Jobs per Client global attribute
- Configuring a NetBackup policy
- Testing NetBackup for Oracle on UNIX configuration settings
See the next section for instructions on starting the NetBackup Administration Console.

To launch the NetBackup Administration Console for UNIX
1. Log onto the UNIX server as root.
2. Start the NetBackup Administration Console.
$ install_path/netbackup/bin/jnbSA &
The Login dialog box appears.
3. Type the name of the master server where you initially want to manage NetBackup.
You can specify any NetBackup master server. Indicate the User and Password.
4. Click Login. The NetBackup Administration Console appears.

Configuring the Media Manager
-----------------------------
Use the Media Manager to configure tapes or other storage units for a NetBackup for
Oracle configuration.
The number of volumes required will depend on the devices used, the size of the Oracle
databases that you are backing up, and the frequency of backups.

Setting the Maximum Jobs per Client Global Attribute
----------------------------------------------------
The Maximum jobs per client attribute value is figured with the following formula.
Max Jobs per Client = Number of Streams x Number of Policies
Where:
Number of Streams: Is the number of backup streams between the database server and
NetBackup. Each separate stream starts a new backup job on the client.
Number of Policies: Is the number of policies that may back up this client at the same time.
This number can be greater than one. For example, a client may be in two
policies in order to back up two different databases. These backup windows
may overlap.

For Oracle backups and restores, the number of jobs is hard to determine, as Oracle internally
determines when and how many streams to run in parallel to optimize performance.To avoid any
problems, we recommend that you enter a value of 99 for the Maximum jobs per client global attribute.

- To set the Maximum jobs per client attribute on a UNIX server
Use this procedure to set the Maximum jobs per client global attribute using the
NetBackup Administration Console - Java interface on a Java-capable platform.
1. In the left pane of the NetBackup Administration Console, expand Host Properties
and select Master Servers.
2. In the right pane, double-click on the server icon.
Click Global Attributes.
The Master Server Properties dialog box appears.
The default value is 1 for Maximum jobs per client.
3. Change the Maximum jobs per client value to a value equal to the maximum number
of backups allowed per client.
Tip: To avoid any problems, we recommend that you enter a value of 99 for
the Maximum jobs per client global attribute.

Configuring a NetBackup Policy
------------------------------
A NetBackup policy defines the backup criteria for a specific group of one or more clients.
These criteria include:
- storage unit and media to use
- backup schedules
- backup templates or script files to be executed on the clients
- clients to be backed up

To use NetBackup for Oracle on UNIX, at least one Oracle policy with the appropriate
schedules needs to be defined. A configuration can have a single policy that includes
all clients or there can be many policies, some of which include only one client. Most
requirements for Oracle policies are the same as for file system backups. In addition
to the attributes described here, there are other attributes for a policy to consider.
Refer to the NetBackup System Administrator's Guide for detailed configuration instructions
and information on all the attributes available.

Adding New Policies
-------------------
Use this procedure when configuring a policy from a UNIX server.
- To add a new policy
1. Log onto the server as root.
2. Start the NetBackup Administration Console.
3. If your site has more than one master server, choose the one to which you want
to add the policy.
4. In the left pane, click on Policies. The right pane splits into a All Policies
pane and a details pane.
5. In the All Policies pane, right-click on the Master Server, and click New.

The Add a New Policy dialog box appears.
a. In the Policy name box, type a unique name for the new policy.
b. Choose whether to use the wizard for configuring the policy.
The wizard guides you through the setup process and simplifies it by automatically
choosing default values that are good for most configurations. If necessary, you can
change the defaults later by editing the policy.
- To use the wizard, select the Use add policy wizard box and click OK. The wizard
starts and you create the policy by following the prompts. When prompted, select
the Oracle policy type.
- If you require more control over the settings than the wizard provides, do not
select the Use add policy wizard box and proceed to step 6.
6. Click OK.
A dialog box appears in which you can specify the general attributes for the policy.
7. From the Policy type box, select the Oracle policy type.
8. Complete the entries on the Attributes tab as explained in "Description of Attributes"
and click Apply to save the attribute entries.
9. Add other policy information:
To add schedules, see "Adding New Schedules."
To add templates or shell scripts, see "Specifying the List of Scripts."
To add clients, see "Adding Clients to a Policy."

Adding New Schedules
--------------------

Each policy has its own set of schedules. These schedules control initiation
of automatic backups and also specify when user operations can be initiated.
A Oracle backup requires at least two specific schedule types: an Application
Backup schedule and an Automatic Backup schedule. You can also create additional
schedules. The following procedures explain how to configure the required schedule
types, and how to add other new schedules.

To configure an Application Backup schedule
-------------------------------------------
1. Under the policy name, select Schedules.
2. In the right pane, double-click on the schedule named Default-Application-Backup.
A dialog box appears. The title bar shows the name of the policy to
which you are adding the schedule.

All Oracle database operations are performed through NetBackup for Oracle on
UNIX using an Application Backup schedule. This includes those backups started
automatically. You must configure an Application Backup schedule for each Oracle
policy you create. If you do not do this, you will not be able to perform a backup.
To help satisfy this requirement, an Application Backup schedule named
Default-Application-Backup is automatically created when you configure a new
Oracle policy.
3. Specify the other properties for the schedule as explained in "Schedule Properties."
The backup window for an Application Backup schedule must encompass the time period
during which all NetBackup jobs, scheduled and unscheduled, will occur. This is
necessary because the Application Backup schedule starts processes that are required
for all NetBackup for Oracle on UNIX backups, including those started automatically.

For example, assume that you:
- expect users to perform NetBackup operations during business hours, 0800 to 1300.
- configured automatic backups to start between 1800 and 2200.
The Application Backup schedule must have a start time of 0800 and a duration of 14 hours.

Tip: Set the time period for the Application Backup schedule for 24 hours per day,
seven days per week. This will ensure that your NetBackup for Oracle on UNIX
operations are never locked out due to the Application Backup schedule.

To configure an automatic backup schedule
-----------------------------------------
1. In the All Policies pane, expand the policy you wish to configure. Right-click
Schedules and choose New.
A dialog box appears. The title bar shows the name of the policy to which you are
adding the schedules.
2. Specify a unique name for the schedule.
3. Select the Type of Backup.
For information on the types of backups available for this policy, see "Types of
Backups."
4. Specify the other properties for the schedule as explained in "Schedule Properties."
When a schedule is executed, NetBackup sets environment variables based on which
type of automatic backup schedule is selected. These environment variables can then
be used to conditionally start a backup.
To add other schedules, repeat step 1 through step 4.

Schedule Properties
-------------------
Some of the schedule properties have a different meaning for database backups than for
a regular file system backup. These properties are explained below. Other schedule
properties will vary according to your specific backup strategy and system configuration.
Consult the NetBackup System Administrator's Guide for detailed explanations of the
schedule properties.

Type of backup: Specifies the type of backup that this schedule will control.
The selection list shows only the backup types that apply to the
policy you are configuring. For more information see "Types of Backups."

Frequency: This setting is used only for scheduled backups, and not for user-directed
backups. Frequency specifies the period of time that will elapse until the
next backup operation can begin on this schedule. For example, if the
frequency is seven days and a successful backup occurs on Wednesday, the
next full backup will not occur until the following Wednesday. Normally,
incremental backups will have a shorter frequency than full backups.

Calendar: This setting is used only for scheduled backups, and not for user-directed
backups. The Calendar option allows you to schedule backup operations based
on specific dates, recurring week days, or recurring days of the month.

Retention: Frequency based scheduling
The retention period for an Application Backup schedule refers to the length
of time that NetBackup keeps backup images. The retention period for an
Automatic Full Backup, Automatic Differential Incremental Backup, or Automatic
Cumulative Incremental Backup schedule controls how long NetBackup keeps
records of when scheduled backups have occurred.

The NetBackup scheduler compares the latest record to the frequency to determine whether
a backup is due. This means that if you set the retention period to expire the record too
early, the scheduled backup frequency will be unpredictable. However, if you set the
retention period to be longer than necessary, the NetBackup catalog will accumulate
unnecessary records.

Therefore, set a retention period that is longer than the frequency setting for the
schedule.
For example, if the frequency setting is set to one week, set the retention period to be
more than one week.

Note Oracle is not notified when NetBackup expires a backup image. You must use Oracle
RMAN repository maintenance commands to periodically delete expired backup sets
from the Oracle RMAN repository.

Calendar based scheduling -
The retention period for an Application Backup schedule refers to the length of time
that NetBackup keeps backup images. The retention period for an Automatic Full Backup,
Automatic Differential Incremental Backup, or Automatic Cumulative Incremental Backup
schedule controls how long NetBackup keeps records of when scheduled backups have
occurred. However, this setting is not significant for calendar based scheduling.

Multiple copies: If you are licensed for the Inline Tape Copy feature and wish to specify
multiple copies for your Oracle policy, configure Multiple copies on the
Application Backup schedule.



Expiration of Backup Files
--------------------------

NetBackup and Oracle each maintain a repository for backup image information. Currently,
automatic expiration of backup images from both repositories is not supported. The
following describes how to expire images and synchronize the NetBackup and the Oracle
repositories.

Expiration of Backup Images from the NetBackup Repository Using Retention Level.
NetBackup automatically controls the expiration of the Oracle backup images from its
repository using the retention setting in an Application Backup schedule. Use the
retention setting to specify the length of time before NetBackup expires a backup
image. Note that the retention setting has a slightly different meaning for an
Application Backup schedule and an automatic backup schedule. See "Schedule Properties"
for more details.
When you use the retention setting to expire backup images, you must perform periodic
Oracle repository maintenance to remove references to expired backup files.

Oracle Recovery Manager Repository Maintenance.
Manually remove references to backup images from the Oracle RMAN repository. Use RMAN
repository maintenance commands to remove references to backup files. You can use these
commands to delete backup image information from both the Oracle RMAN repository and
the NetBackup repository.
When a request is issued to delete a backup file from the RMAN repository, RMAN sends
the request to NetBackup for Oracle to delete the corresponding image from the
NetBackup repository, regardless of the retention level.


Specifying the List of Scripts
------------------------------
The File list in a database policy has a different meaning than the File list has for
other policies. Normally, in a Standard policy, you would list files and directories to
be backed up. But since you are now configuring a database policy, you will list templates
or scripts.

Add templates or scripts only if you are setting up a policy for automatic scheduling. All
templates or scripts listed in the Files list will be executed for the Automatic Full
Backup, Automatic Differential Incremental Backup, or Automatic Cumulative Incremental
Backup schedules as specified under the Schedules tab.
All templates or scripts specified in the Files list are executed during manual or
automatic backups. NetBackup will start backups by running the templates or scripts in
the order that they appear in the Files list.

To add templates or scripts to the Scripts List
Caution Be sure to use the correct NetBackup for Oracle template or shell script name
in the file list to prevent an error or possibly a wrong operation.
1. In the left pane, click Policies.
2. In the All Policies pane, expand the policy you want to add the templates or shell
scripts.
3. Right-click on Files and choose New.

The Add File dialog box appears. The title bar shows the name of the policy to which
you are adding the scripts.
4. Type the name of the Oracle template or shell script.

Shell scripts:
Be sure to specify the full pathname when listing Oracle scripts. For example:
install_path/netbackup/ext/db_ext/oracle/samples/rman/cold_databas e_backup.sh
Be sure that the Oracle scripts listed here are installed on each client in the Client
list.

Templates:
Since templates are stored in a known location on the master server, only the template
filename should be entered. For example:
weekly_full_backup.tpl
5. Click Add.
6. To add more scripts, repeat step 4 and step 5.

Adding Clients to a Policy
The client list is the list of clients on which your NetBackup for Oracle on UNIX
backups will be performed. A NetBackup client must be in at least one policy but can
be in more than one.

To add clients to a policy
1. In the left pane, expand Policies.
2. In the All Policies pane, expand the policy you wish to configure.
3. Right-click on Clients and choose New.
The Add Client dialog box appears. The title bar shows the name of the policy where you
are adding clients.
4. In the Client name text box, type the name of the client that you are adding.

On the client the following should be installed:
- Oracle
- NetBackup client or server
- NetBackup for Oracle on UNIX
- the backup shell script(s) (unless you are using templates)
5. Choose the hardware and operating system type and click Add.
6. If this is the last client, click OK. If you are going to add more clients, repeat
step 4 and step 5.

Configuring the Run-Time Environment
------------------------------------
The following is the order of precedence for the run-time configuration variable settings
(when applicable).
1. vendor-specific string with send command
2. parms operand
3. environment variables
4. user bp.conf
5. master bp.conf

Environment Variables Set Up by NetBackup for Oracle on UNIX
------------------------------------------------------------
When a schedule executes, NetBackup sets environment variables for templates
and shell scripts to use when performing a NetBackup operation. These variables
can be used to perform conditional operations. These variables are set only if
the backup is started from the server (either automatically by the NetBackup
scheduler or manually through the administrator interface).

NB_ORA_SERV: Name of the NetBackup Server.
NB_ORA_POLICY: Name of the Oracle policy.
NB_ORA_CLIENT: Name of the NetBackup client that hosts the Oracle database.
NB_ORA_FULL: Set to 1 if this is an Automatic Full Backup.
NB_ORA_INCR: Set to 1 if this is an Automatic Differential Incremental Backup.
NB_ORA_CINC: Set to 1 if this is an Automatic Cumulative Incremental Backup.

Environment Variables Set Up by User
------------------------------------
Environment variables set by the user will take precedence over those set up by
NetBackup for Oracle.
The NetBackup for Oracle on UNIX variables that follow can be set for use in the Oracle
user environment.

NB_ORA_SERV: Specifies the name of NetBackup master server.
NB_ORA_CLIENT: Specifies the name of the Oracle client. It is especially useful for
redirecting a restore to a different client.
NB_ORA_POLICY: Specifies the name of the policy to use for the Oracle backup.
NB_ORA_SCHED: Specifies the name of the Application Backup schedule to use for theOracle backup.

Oracle RMAN Environment
-----------------------
The way to set environment variables depends upon the version of Oracle you are using.

Note: When connecting to a database using a TNS alias, you must use a send command or
a parms operand to specify environment variables. In other words, when accessing
a database through a listener, the environment variables set at the system level
are not visible when RMAN is running.

Templates:
----------
With templates, NetBackup for Oracle on UNIX environment variables are specified on
the NetBackup for Oracle Configuration Variables Wizard page.

Shell scripts:
--------------
Use the send command or the parms operand to specify Netbackup for Oracle on
UNIX environment variables for use during a backup or restore. The send command
was introduced with Oracle8i. If you are using an Oracle8.0.x version of RMAN you
must use the parms operand.

The send command sends a vendor-specific quoted string to NetBackup for Oracle on UNIX.
For example, the following will specify what policy and server to use for a database backup.

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');
}

Specify the variables in the string in the RMAN script after all channels have been
allocated and before the backup command.
The parms operand can also be used to set environment variables at runtime. The
following example uses the parms operand to specify what policy and server to use
for a database backup. parms is set with each allocate channel command in the shell script.

run {
allocate channel t1 type 'sbt_tape'
parms="ENV=(NB_ORA_POLICY=your_policy, NB_ORA_SERV=your_server)";
allocate channel t2 type 'sbt_tape'
parms="ENV=(NB_ORA_POLICY=your_policy, NB_ORA_SERV=your_server)";

backup
(database format 'bk_%s_%p_%t');
}

For more information on the send command and parms operand of an rman command, see
the Oracle Server Backup and Recovery Guide.


Creating a bp.conf File
-----------------------

A NetBackup for Oracle on UNIX user can create an Oracle client bp.conf file in
the Oracle user's home directory on the NetBackup for Oracle on UNIX client host.
When a NetBackup for Oracle on UNIX operation is started, the user's bp.conf file
is searched before the master configuration file (install_path/netbackup/bp.conf) on
the client. Any option found at the user level takes precedence over the same option
in the master level configuration.

The following options can be set in the user's bp.conf file:
BPBACKUP_POLICY: The name of the policy to use for the Oracle backup.
BPBACKUP_SCHED: The name of the Application Backup type of schedule to use
for the Oracle backup.
CLIENT_NAME: The name of the Oracle client. It is especially useful for a
redirected restore operation.
CLIENT_READ_TIMEOUT: This option specifies the number of seconds the Oracle client will
initially wait for a response from the NetBackup server. The default
value is 900.
SERVER: The name of the NetBackup master server.
VERBOSE: This option causes NetBackup to include more information in
its logs. See the NetBackup System Administrator's Guide - UNIX for
more details and default values.

The following shows example bp.conf entries for an Oracle user:
SERVER=jupiter
CLIENT_READ_TIMEOUT=1200
VERBOSE=1


Creating Templates and Shell Scripts
------------------------------------
RMAN templates and RMAN shell scripts contain commands that are used to
execute NetBackup for Oracle backup and recovery jobs. Templates and scripts must be
created before NetBackup for Oracle can perform scheduled backups. These are the
template files or shell scripts that are specified in policy configuration on the NetBackup
server.

Recovery Manager (RMAN)
=======================

RMAN Templates and Shell Scripts
--------------------------------

Templates:
The NetBackup for Oracle Backup Wizard is used to create backup templates. This wizard
is initiated from the NetBackup Backup, Archive, and Restore interface. The NetBackup
for Oracle Backup Wizard does not support all of the RMAN commands and options provided
by Oracle. A shell script should be written for situations where a template does not
provide all of the required functionality.

Shell scripts:
Shell scripts are written by the user and must conform to RMAN and UNIX shell syntax.
Sample backup and recovery shell scripts are installed on the client with the NetBackup
for Oracle agent. Modify these scripts to meet your individual requirements.
NetBackup for Oracle also provides a utility, bpdbsbora, that can generate a shell
script from a Backup Wizard template. This allows a user to create a template with the
Wizard, then generate a shell script from it. The user can then run the shell script,
or modify the shell script further.

Storing RMAN Templates and Shell Scripts
----------------------------------------

Templates:
The NetBackup for Oracle Backup Wizard saves a backup template to a NetBackup specific
location on the current NetBackup master server. A backup template is retrieved from
the master server as part of a backup (server-directed, scheduled, or user-directed)
and is executed on the client. Backup templates are associated with a policy by
specifying its name in the policy file or script list. Because backup templates are
stored on the server in a known location, server directed and scheduled backups will
use the same copy of the template for each client in the policy client list.

The NetBackup for Oracle Recovery Wizard saves a restore template to a user specified
location on the client. The location specified should include a fully qualified path
to a directory where the user has write access.
Templates store encrypted passwords that are decrypted at runtime.

Shell scripts:
RMAN shell scripts must reside on the NetBackup client. Backup shell scripts are
associated with a policy by specifying the file name (including path) in the policy
file or script list. This means that for server-directed or scheduled backups, each
client in the policy's client list must have a copy of the script with the same name
in the same location. The backup and recovery processes sometimes require passwords
for Oracle database access and/or system user accounts. RMAN shell scripts, because a
Shell interprets them, store passwords in clear text.



Creating RMAN Templates Using the NetBackup for Oracle Backup Wizard
--------------------------------------------------------------------

NetBackup for Oracle includes a Backup Wizard that solicits information about desired
RMAN backup operations. The wizard uses the information to create a template that can be
run immediately or saved in a NetBackup specific location on the current master server
for later use.
Please review your Oracle Backup and Recovery Guide for more information on backup
strategies and RMAN functionality.

To start the NetBackup Backup, Archive, and Restore interface, execute:
% install_path/netbackup/bin/jbpSA &

Creating RMAN Shell Scripts Using bpdbsbora
-------------------------------------------

bpdbsbora is a NetBackup for Oracle command line utility used to initiate template
based user-directed backup and recovery. This utility is also used to generate RMAN
shell scripts from templates created by the Backup Wizard.

At the command prompt, type:
% bpdbsbora -backup -g