Oracle RMAN 11g Backup and Recovery (66 page)

166
Part II: Setup Principles and Practices

To add scripts or templates to the backup selections list, follow these steps:
1.
From the Administration Console, double-click the policy name in the Policies list.

2.
In the Change Policy dialog box, click the Backup Selections tab.

3.
Click New.

4.
In the Add Backup Selection dialog box, shown in Figure 7-6, enter the shell script or template name. Use the Add button to add the script or template to the selection list.

5.
Click OK.

Defining Policy Clients

To add a database server (client) to a policy, follow these steps:

1.
From the Administration Console, double-click the policy name in the Policies list.

2.
In the Change Policy dialog box, click the Clients tab.

3.
Click New to open the Add Client dialog box, shown in Figure 7-7.

4.
In the Client Name box, type the name of the client you are adding.

5.
Choose the hardware and operating system type from the drop-down list.

6.
Click OK or click Add to set up another client.

FIGURE 7-6
Backup selection

Chapter 7: Enhancing RMAN with VERITAS NetBackup
for Oracle
167

FIGURE 7-7
Define policy clients

Managing Expired Backup Images

The NetBackup Media Manager and RMAN both have the ability to manage backup retention periods. This can be a problem if their retention settings don’t match. Automatic expiration of backup images from both repositories is not supported. A work-around is to use the Retention setting in the Application Backup schedule and then to synchronize the NetBackup and RMAN

repositories.

Delete Expired Backups Using NetBackup Repository

NetBackup controls the expiration of the Oracle backup images from its repository by using the Retention setting in an Application Backup schedule. The setting specifies the length of time before the backup image expires and is deleted. When you use NetBackup retention to delete backup images, you must do regular Oracle repository maintenance to remove references to expired backup files.

Delete Expired Backups Using RMAN

RMAN has a manual command to remove all database and archive log backups that have reached their retention limits. You can use this command to delete database backups from both the RMAN catalog and the NetBackup repository. When a request is issued to delete a backup file

168
Part II: Setup Principles and Practices

from the RMAN repository, RMAN sends the request to NetBackup to delete the corresponding images from its repository, regardless of the retention level. The code for deleting expired backups is shown next:

RMAN> allocate channel for maintenance type 'SBT TAPE';

RMAN> crosscheck backup;

RMAN> delete expired backup;

The
crosscheck
command should be used only in cases where files marked with the status

“Available” that no longer exist can be expired and marked deleted. RMAN should control the retention using the following command. If you configure the channel with the tape parameters, there is no need to allocate channels. This feature is available in Oracle 9
i
Database and newer versions.

RMAN> allocate channel for maintenance type 'SBT TAPE';

RMAN> delete noprompt obsolete;

RMAN Sample Scripts

Something particularly clever about the NetBackup
for Oracle
agent installation is that it includes RMAN backup and recovery sample scripts that are pre-instrumented (that is, they already include code snippets or templates) with code for using NetBackup. Look for the sample scripts in

//netbackup/ext/db_ext/oracle/samples/rman.

These sample scripts will be included:

cold database backup.sh

hot database backup proxy.sh

cold duplex database backup full.sh

hot tablespace backup.sh

database restore.sh

hot tablespace backup proxy.sh

hot database backup.sh

pit database restore.sh

New scripts can be generated from the Administration Console. For anyone who has suffered through the time-consuming effort of trying to locate elusive punctuation errors, these scripts come as a pleasant surprise.

The following is an RMAN code snippet for calling NetBackup:

rman target / catalog /@rman cat db log run

{

allocate channel t1 type 'SBT TAPE'

parms "ENV (NB ORA SERV ,

NB ORA POLICY RMAN DEFAULT, NB ORA CLIENT )";

backup database format 'db %d%U%t'

}

The
NetBackup Administrator’s Guide
recommends adding a %t at the end of the format string, since NetBackup uses a timestamp as part of its search criteria for catalog images. You can also do this by using
configure
.

Chapter 7: Enhancing RMAN with VERITAS NetBackup
for Oracle
169

The following is an RMAN code snippet for calling NetBackup that uses
configure
commands:

rman target / catalog /@rman cat db log rman> CONFIGURE CHANNEL DEVICE TYPE 'SBT TAPE' PARMS

'SBT LIBRARY //netbackup/bin/libobk.so64.1,

ENV (NB ORA SERV , NB ORA POLICY , NB ORA CLIENT )';

rman> CONFIGURE DEVICE TYPE 'SBT TAPE' FORMAT 'db %d%U%t'

rman> backup database;

Troubleshooting

Inevitably, something will break in the environment. Knowing how to prioritize problems in advance helps to resolve them more smoothly. This section highlights steps to help troubleshoot issues.

The following are general troubleshooting steps to take:

1.
Verify Oracle agent installation by making sure that the proper libraries exist in /

path>/netbackup/bin. Refer to Table 7-2 earlier in the chapter to determine which library (for example, libobk.a) corresponds to your operating system.

2.
Check the database server (client) to ensure that the bphdb executable exists. This is used by both the NetBackup scheduler and the GUI to start backups.

3.
Check that the following executables exist:

//netbackup/bin/bpdbsbora


//netbackup/bin/bpubsora


//lib/libdbsbrman.so


//lib/libnbberman.so


4.
Check that the following //netbackup/logs directories exist with 777 permissions:


On the database server (client): bpdbsbora, dbclient, bphdb, and bpcd


On the master server: bprd and bpdbm


On the media server: bpbrm and bptm

Use NetBackup Logs

NetBackup generates logs for backup and restore operations. These logs can be used to investigate media manager problems, but RMAN errors will be written to the RMAN logs. There are two types of NetBackup logs:


Progress logs
Located in //netbackup/logs/user_ops/username/logs, these logs are generated for any backup or restore operations. These files can sometimes be large and cumbersome. They contain sizable amounts of data. The key here is knowing

Other books

Compass by Jeanne McDonald
The Secret History of Moscow by Ekaterina Sedia
Welcome to New Haven by Dawn Doyle
Their Virgin Neighbor by Saba Sparks
Listen by Kate Veitch
Stories by Doris Lessing
The Governess Affair by Courtney Milan