Netbackup For Oracle
Netbackup For Oracle
Release 7.0
Legal Notice
Copyright 2008 Symantec Corporation. All rights reserved. Symantec, the Symantec Logo, and NetBackup are trademarks or registered trademarks of Symantec Corporation or its affiliates in the U.S. and other countries. Other names may be trademarks of their respective owners. This Symantec product may contain third party software for which Symantec is required to provide attribution to the third party (Third Party Programs). Some of the Third Party Programs are available under open source or free software licenses. The License Agreement accompanying the Software does not alter any rights or obligations you may have under those open source or free software licenses. Please see the Third Party Legal Notice Appendix to this Documentation or TPIP ReadMe File accompanying this Symantec product for more information on the Third Party Programs. Portions of this software are derived from the RSA Data Security, Inc. MD5 Message-Digest Algorithm. Copyright 1991-92, RSA Data Security, Inc. Created 1991. All rights reserved. The product described in this document is distributed under licenses restricting its use, copying, distribution, and decompilation/reverse engineering. No part of this document may be reproduced in any form by any means without prior written authorization of Symantec Corporation and its licensors, if any. THE DOCUMENTATION IS PROVIDED "AS IS" AND ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELD TO BE LEGALLY INVALID. SYMANTEC CORPORATION SHALL NOT BE LIABLE FOR INCIDENTAL OR CONSEQUENTIAL DAMAGES IN CONNECTION WITH THE FURNISHING, PERFORMANCE, OR USE OF THIS DOCUMENTATION. THE INFORMATION CONTAINED IN THIS DOCUMENTATION IS SUBJECT TO CHANGE WITHOUT NOTICE. The Licensed Software and Documentation are deemed to be commercial computer software as defined in FAR 12.212 and subject to restricted rights as defined in FAR Section 52.227-19 "Commercial Computer Software - Restricted Rights" and DFARS 227.7202, "Rights in Commercial Computer Software or Commercial Computer Software Documentation", as applicable, and any successor regulations. Any use, modification, reproduction release, performance, display or disclosure of the Licensed Software and Documentation by the U.S. Government shall be solely in accordance with the terms of this Agreement.
Technical Support
Symantec Technical Support maintains support centers globally. Technical Supports primary role is to respond to specific queries about product features and functionality. The Technical Support group also creates content for our online Knowledge Base. The Technical Support group works collaboratively with the other functional areas within Symantec to answer your questions in a timely fashion. For example, the Technical Support group works with Product Engineering and Symantec Security Response to provide alerting services and virus definition updates. Symantecs maintenance offerings include the following:
A range of support options that give you the flexibility to select the right amount of service for any size organization Telephone and Web-based support that provides rapid response and up-to-the-minute information Upgrade assurance that delivers automatic software upgrade protection Global support that is available 24 hours a day, 7 days a week Advanced features, including Account Management Services
For information about Symantecs Maintenance Programs, you can visit our Web site at the following URL: www.symantec.com/techsupp/
Product release level Hardware information Available memory, disk space, and NIC information Operating system
Version and patch level Network topology Router, gateway, and IP address information Problem description:
Error messages and log files Troubleshooting that was performed before contacting Symantec Recent software configuration changes and network changes
Customer service
Customer service information is available at the following URL: www.symantec.com/techsupp/ Customer Service is available to assist with the following types of issues:
Questions regarding product licensing or serialization Product registration updates, such as address or name changes General product information (features, language availability, local dealers) Latest information about product updates and upgrades Information about upgrade assurance and maintenance contracts Information about the Symantec Buying Programs Advice about Symantec's technical support options Nontechnical presales questions Issues that are related to CD-ROMs or manuals
Consulting Services
Educational Services
To access more information about Enterprise services, please visit our Web site at the following URL: www.symantec.com Select your country or language from the site index.
Contents
Chapter 2
Contents
About linking the Oracle Recovery Manager (RMAN) with NetBackup ............................................................................ Verifying environment variables and shutting down Oracle ........... Linking the Oracle Recovery Manager (RMAN) with NetBackup ...................................................................... About the Oracle recovery catalog ...................................................
34 35 36 41
Chapter 3
Configuration
....................................................................... 43 43 43 44 44 45 46 47 47 49 51 51 51 53 54 55 58 58 58 59 60 61 61 64 65 66 66 67 68
About user interface terminology .................................................... Configuring permissions for log files ............................................... Configuring the Maximum jobs per client ......................................... Formula for Maximum jobs per client ........................................ About configuring a backup policy for an Oracle database ................... Adding a new NetBackup for Oracle policy .................................. About policy attributes for NetBackup for Oracle ......................... About adding schedules to a NetBackup for Oracle policy .............. About the NetBackup for Oracle backup types ............................. About backup schedules, templates, and scripts ........................... About backup schedules and Snapshot Client features .................. About NetBackup for Oracle schedule properties .......................... Managing expired backup images .............................................. Adding clients to a NetBackup for Oracle policy ........................... Adding backup selections to a Oracle policy ................................ About configuring the runtime environment ..................................... About the order of precedence for runtime configuration variable settings when using scheduled backups with templates ........... About the order of precedence for runtime configuration variable settings for all other Oracle backups .................................... About the Oracle RMAN environment ........................................ About the environment variables set by a user in the XML export parameter file ................................................................. About the environment variables set by NetBackup for Oracle ............................................................................ About the RMAN SEND command variables ................................ About the bp.conf file .............................................................. About creating templates and shell scripts ........................................ Starting the NetBackup Backup, Archive, and Restore interface ......................................................................... Recovery Manager (RMAN) templates and shell scripts ................. Creating RMAN templates using the NetBackup for Oracle RMAN template generation wizard ............................................... Creating an RMAN script from a template ..................................
Contents
Creating RMAN scripts manually .............................................. About XML export templates and shell scripts ............................. Creating XML export templates using the NetBackup for Oracle wizard ........................................................................... Creating an XML export script from a template ............................ Creating XML export scripts manually ....................................... About storing templates .......................................................... About storing shell scripts ....................................................... Testing configuration settings ........................................................
69 72 73 74 74 76 76 76
Chapter 4
10
Contents
Running the XML import wizard on the client ............................ Using bpdbsbora .................................................................. Running an XML import script on the client .............................. Running bporaimp on the client .............................................. bporaimp parameters ............................................................ About redirecting a restore of an XML export archive to a different client ...............................................................
Chapter 5
Chapter 6
Contents
11
Sequence of operation: Backup ................................................ Sequence of operation: Restore ............................................... Database objects supported by advanced backup methods ............ Multistreaming .................................................................... RMAN multiple channels ....................................................... Restoring data files to a new location ....................................... Redirecting a restore to a different client .................................. Symbolic links and raw data files ............................................. Quick I/O data files ............................................................... RMAN incremental backups ................................................... Proxy backup examples ......................................................... About configuring snapshot backups with NetBackup for Oracle ......... Configuration requirements for snapshot backups with NetBackup for Oracle ...................................................... Configuring the Oracle policy with Snapshot Client backup methods ....................................................................... Configuring a snapshot policy for NetBackup for Oracle .............. About NAS snapshot policies with optional SnapVault capabilities .................................................................... Restoring from a snapshot backup ................................................. About restoring individual files from a snapshot backup .............. About restoring volumes and file systems using snapshot rollback ........................................................................ About configuring block-level incremental backups .......................... How does BLI work? .............................................................. About the Storage Checkpoint facility ...................................... Configuration requirements for BLI backups ............................. Configuring policies for BLI backups ........................................ About Snapshot Client effects ....................................................... About the types of backups ..................................................... About schedule properties for Snapshot Client backups ............... About templates and scripts ................................................... Environment variables ..........................................................
135 136 136 137 137 137 138 138 138 138 139 142 142 143 144 147 147 147 148 151 152 153 154 155 156 156 157 158 159
Chapter 7
12
Contents
About the dbclient directory on the NetBackup for Oracle database client ............................................................... bpdbsbora directory on the client ............................................ bporaexp64 directory on the client .......................................... bporaimp64 directories on the client ........................................ Setting the debug level on a UNIX or Linux client ............................. About NetBackup server reports .................................................... RMAN utility logs ....................................................................... Additional XML export and import logs .......................................... Troubleshooting backup or restore errors ....................................... Checking the logs to determine the source of the error ................ Verifying the RMAN script ..................................................... Troubleshooting each stage of the backup or restore ................... Troubleshooting XML export or XML import errors .......................... Checking the logs to determine the source of an error ................. Troubleshooting each stage of the XML export or XML import .......................................................................... Troubleshooting the browser interface and wizards .......................... Troubleshooting NetBackup for Oracle with Snapshot Client .............. Minimizing timeout failures on large database restores .....................
166 166 166 166 167 167 167 167 168 168 169 170 171 172 173 176 177 177
Appendix A
Appendix B
Best practices for protecting Oracle RAC with NetBackup ..................................................................... 187
Introduction .............................................................................. Operational characteristics .......................................................... RAC backup configurations .......................................................... Failover VIP exists and backup is not load balanced .................... Failover VIP exists and backup is load balanced ......................... Failover VIP is not available and backup is not load balanced ....................................................................... Failover VIP is not available, and backup is load balanced, one policy with custom script ................................................. 187 188 189 189 190 193 195
Contents
13
Failover VIP is not available and backup is load balanced, simple script with manual policy failover ..................................... 197 Catalog considerations ................................................................ 199
Appendix C
14
Contents
Chapter
Introduction
This chapter includes the following topics:
About NetBackup for Oracle Features of NetBackup for Oracle NetBackup for Oracle XML export and XML import archiving features NetBackup for Oracle terminology XML export and XML import terms Oracle terms Oracle RMAN terms NetBackup for Oracle overview RMAN NetBackup for Oracle XML export and XML import
16
Scheduling facilities
NetBackup for Oracle lets you take advantage of NetBackups multiplexing capabilities. Multiplexing directs multiple data streams to one backup device, thereby reducing the time necessary to complete the operation.
Transparent Oracle All backups and restores run simultaneously and transparently and regular file system without any action from the NetBackup administrator. backup and restore The database administrator can run database backup and restore operations operations through NetBackup. An administrator or any other authorized user can use NetBackup to run database backups and restores. Alternatively, you can use Oracles Recovery Manager (RMAN) as if NetBackup were not present. Sharing the same It is possible to share the same devices and media used for other storage units used for backups or to give Oracle exclusive use of certain devices and other file backups media. NetBackup for Oracle can use Media Manager, disk, and PureDisk storage units. Centralized and networked backup operations From the NetBackup master server, you can schedule database backups or start them manually for any client. The Oracle databases can also reside on hosts that are different from the devices on which NetBackup stores the backups. NetBackup provides the following graphical user interfaces for client users and administrators:
Backup, Archive, and Restore user interface NetBackup Administration Console for Java NetBackup Administration Console for Windows
A database administrator or NetBackup administrator can start backup or restore operations for Oracle from the NetBackup graphical user interface on the master server.
Introduction NetBackup for Oracle XML export and XML import archiving features
17
Compression
For more information on general NetBackup terminology, see the NetBackup Administrators Guide, Volume I.
NetBackup for Oracle XML export and XML import archiving features
Table 1-2 describes NetBackup for Oracle XML export and XML import archiving features.
18
NetBackup for Oracle XML export and XML import archiving features Description
System- and NetBackup for Oracle uses the eXtensible Markup Language (XML) database-independent standard to represent relational database table data that is archive format extracted from an Oracle database. The eXtensible Markup Language (XML) is a universal format for structured documents and data. The XML 1.0 standards are produced by the World Wide Web Consortium and include the XML Schema standard. Unicode UTF-8 is the character set encoding generated by NetBackup for Oracle. Standard XML processors support UTF-8. US7ASCII is a strict subset of UTF-8. Self-identifying archive format The XML Schema standard is used to describe the table data that is included in an archive. In this way, the archive contains the key to understanding the format of the data as well as the data itself. Parameter files specify the table data to include in an archive and the table data to extract from an archive for import into an Oracle database.
Command line interfaces that allow export and import at row-level granularity Restore destination option
NetBackup for Oracle can either restore XML data to an operating system directory or import the data back into the Oracle database.
Flexible archive image The NetBackup catalog contains information on the contents of searches the archive that can be searched by using flexible search criteria, such as tablename or user.
19
Figure 1-1
XML export
OS Directory
XML export
NetBackup for Oracle converts Oracle table data to XML format (XML schema, or metadata, and XML instance, or data). NetBackup stores the XML data on a NetBackup storage unit.
Archive
bporaexp/bporaexp64 NetBackup for Oracles XML export utility converts Oracle database table data into a self-identifying XML schema document command and instance document. They can be archived by NetBackup or redirected to an OS directory.
20
Figure 1-2
OS Directory
NetBackup
XML Format
OS Directory
Restore
XML import
bporaimp command
Oracle terms
Table 1-5 explains some Oracle terms as they pertain to NetBackup.
21
Incremental backup
An incremental backup is a backup of only those blocks that have changed since a previous backup. Oracle lets you create and restore incremental backups of data files, tablespaces, and a database. You can include a control file in an incremental backup set, but the control file is always included in its entirety. No blocks are skipped. RMAN lets you create multilevel backups. An integer identifies each level; for example, 0, 1, 2, and so on. A level 0 incremental backup, which is the base of subsequent incremental backups, copies all blocks containing data. When you generate a level n incremental backup in which n is greater than 0, you back up the following: All blocks that have been modified since the most recent backup at a level n or lower. This condition is the default type of incremental backup. It is called a differential incremental backup. All blocks that have been modified since the most recent backup at level n-1 or lower. This condition is called a cumulative incremental backup. The benefit to performing multilevel incremental backups is that you do not back up all of the blocks all of the time. Incremental backups at a level greater than zero (0) only copy blocks that were modified, which means that the backup size can be significantly smaller and the backup might require much less time. The size of the backup file depends solely upon the number of blocks that are modified and the incremental backup level.
In a differential level n incremental backup, you back up all blocks that have changed since the most recent backup at level n or lower. For example, in a differential level 2 backup, you back up all blocks that are modified since the last level 2, level 1, or level 0 backup. Incremental backups are differential by default.
22
instance
23
RMAN repository
rman command
The rman command starts an RMAN backup or restore. Your Oracle documentation describes this command. The RMAN script specifies the commands for RMAN to perform (for example, backups, and restores). For information on RMAN commands and script files, see your Oracle documentation. The following directory contains example RMAN shell scripts: /usr/openv/netbackup/ext/db_ext/oracle/samples/rman These example scripts run RMAN commands and are fully commented to explain the features used. You can review these examples and use them as a starting point for developing backup, restore, and recovery scripts.
RMAN script
24
Introduction RMAN
Figure 1-3
System containing Oracle database Recovery Catalog
Oracle database software supplies: Oracle Recovery Manager (RMAN) Oracle Call Interface (OCI)
Network (TCP/IP)
NetBackup master server or remote media server NetBackup software: NetBackup master server NetBackup media server
Storage unit
RMAN
The following sections explain how RMAN works and how RMAN works with NetBackup.
Introduction RMAN
25
During a backup or restore, RMAN controls the data streams going into or out of a database. RMAN can access storage devices when it is integrated with a media management system, such as the system provided by NetBackup.
NetBackup for Oracle includes a library of functions that enable RMAN to use NetBackup. See the instructions for how to link to this library. See About linking the Oracle Recovery Manager (RMAN) with NetBackup on page 34. When you use the RMAN backup command, each resulting backup set contains at least one backup piece (data file, data file copy, control file, or archive log) from the target database. You must give each backup piece a unique name using the format operand. Several substitution variables are available to aid in generating unique names. You can specify the format operand in the backup command or in the allocate channel command. NetBackup considers the backup piece name as the file being backed up, so this name must be unique in the catalog. Either NetBackup users or automatic schedules start database backups by specifying a template or shell script in the file list of the Oracle policy. The template or shell script specifies the backup commands that RMAN performs on the client. For a backup:
The rman command starts the requested operation on the databases. When the process requires media to store backup data, RMAN starts a user-directed backup by issuing a backup request. The NetBackup media server connects to NetBackup for Oracle 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 the client. RMAN supports parallel operations, so a single rman command can start more than one backup or restore on the NetBackup system. The status for an RMAN operation is stored in the RMAN catalog or in the database control file. This same status is indicated by the output of the RMAN command used to run the backup or restore. This status is the only status that
26
a database administrator must check to verify that a backup or restore has been successful. NetBackup also logs status, but only for its own part of the operation. The database administrator cannot use the NetBackup status to determine whether rman was successful. Errors can occur in rman that do not affect NetBackup and are not recorded in its logs.
Data file and archive log backup sets and backup pieces. Data file copies. Archived redo logs and their copies. Tablespaces and data files on the target database. Stored scripts. These are named, user-created sequences of RMAN and SQL commands.
Oracle recommends that you use RMAN with a recovery catalog, especially if you have 20 or more data files. However, you are not required to maintain a recovery catalog with RMAN. For information on the benefits and disadvantages of using a recovery catalog, see your Oracle documentation.
27
The XML format is used to provide a self-identifying and system-independent format ideal for database archiving.
Scheduler NetBackup
NetBackup for Oracle users or automatic schedules start database XML export archives by performing a manual backup of an Oracle policy, by invoking the script or template at the command line on the client, or by invoking a template through the Backup, Archive, and Restore interface. For an XML export archive:
28
The NetBackup for Oracle script or template calls the bporaexp utility with a specified parameter file. The query processor uses the parameters in the specified file to build an SQL query for each table. Oracles OCI API executes the queries on the Oracle instance to be archived. The query processor passes the output (including metadata and data for a single table or multiple tables) to the XML Generator. For each table passed, the XML generator builds one or more sets of XML schema and XML instance documents. XML data streams are backed up by NetBackup. Alternately, bporaexp allows the files to be saved to an operating system directory.
29
Figure 1-5
XML Parser
NetBackup
Archive name Table(s) metadata, Table(s) data Keyword Table name OCI Oracle DBMS XML data loader Script or template (bporaimp) (Parameter file)
NetBackup for Oracle users start database XML import restores by invoking a NetBackup for Oracle script or template at the client command line or by invoking an XML import restore template through the Backup, Archive, and Restore interface. For an XML import restore:
The NetBackup for Oracle script or template calls the bporaimp utility with a specified parameter file. The input parameters that identify the XML archive to restore are passed to NetBackup. NetBackup locates and reads the set of XML schema and instance documents from the NetBackup storage unit. The XML data stream is passed to an XML parser, which passes the data to the XML data loader.
30
The XML data loader uses Oracles OCI API to insert the data into the database. Optionally, bporaimp allows the XML data stream to bypass the XML parser and be sent to an operating system directory. In addition, users can restore the table metadata only into an operating system directory. bporaimp also allows import from an operating system directory into Oracle.
Chapter
Verifying the operating system and platform compatibility for NetBackup for Oracle NetBackup server and client software requirements for NetBackup for Oracle Oracle server software requirements for NetBackup for Oracle Requirements for installing NetBackup for Oracle in a NetBackup cluster Configuration and licensing requirements for NetBackup for Oracle with Snapshot Client Adding the NetBackup for Oracle license key About linking the Oracle Recovery Manager (RMAN) with NetBackup About the Oracle recovery catalog
Verifying the operating system and platform compatibility for NetBackup for Oracle
Verify that the NetBackup for Oracle agent is supported on your operating system or platform.
32
Installing NetBackup for Oracle NetBackup server and client software requirements for NetBackup for Oracle
2 3 4
In the Product Finder box, type NetBackup Enterprise Server and click the > icon. From the list on the right, click on Compatibility List. In the list of documents, click on the following document: NetBackup (tm) x.x Database Agent Software Compatibility List (Updated date_updated) For x.x, look for the current release. For date_updated, look for the most recent date.
For information on supported cluster environments for NetBackup for Oracle, see the following document: NetBackup (tm) Enterprise Server x.x / Enterprise Server x.x Cluster Compatibility List (Updated date_updated)
For information on support for Snapshot Client, see the following document: NetBackup (tm) x.x Snapshot Client (Advanced Client) OS, Arrays, and Database Agent Compatibility (Updated date_updated)
NetBackup server and client software requirements for NetBackup for Oracle
Every NetBackup server includes the NetBackup client software by default. Therefore, you can use NetBackup for Oracle on a NetBackup server or client (if NetBackup for Oracle is supported on that platform). Verify that the following requirements are met for the NetBackup server and client software:
The NetBackup server software is installed and operational on the NetBackup server. The NetBackup server platform can be any that NetBackup supports. See the NetBackup Installation Guide. The NetBackup client software is installed on the computer that has the databases you want to back up. Make sure that you configure any backup media that the storage unit uses. The number of media volumes that are required depends on several things:
Installing NetBackup for Oracle Oracle server software requirements for NetBackup for Oracle
33
The sizes of the databases that you want to back up The amount of data that you want to archive The size of your backups The frequency of backups or archives
Oracle server software must be installed and operational. One or more Oracle instances must exist.
See Verifying the operating system and platform compatibility for NetBackup for Oracle on page 31.
The NetBackup server software is installed and configured to work in a NetBackup cluster. See the NetBackup Installation Guide. See the NetBackup High Availability Guide. The Oracle server software is installed and operational on each node to which NetBackup can failover. On each node where NetBackup server resides, add the license key for the database agent.
34
Installing NetBackup for Oracle Configuration and licensing requirements for NetBackup for Oracle with Snapshot Client
Configuration and licensing requirements for NetBackup for Oracle with Snapshot Client
To use NetBackup for Oracle with Snapshot Client, you must have a license for NetBackup Snapshot Client.
1 2 3 4
On the master or the media server, open the NetBackup Administration Console. Choose Help > License Keys. Click the New icon. Type the license key and click Add.
To add a NetBackup for Oracle license key with the get_license_key command
From the master server or media server, run the following command:
/usr/openv/netbackup/bin/admincmd/get_license_key
When the system prompts you, type the host name of the NetBackup master server.
Installing NetBackup for Oracle About linking the Oracle Recovery Manager (RMAN) with NetBackup
35
OS level. This topic does not address all the supported combinations, but it specifies OS level differences. The default location for the NetBackup API library is /usr/openv/netbackup/bin. The name of the NetBackup API library differs, depending on your platform. Table 2-1 lists the library names for the supported platforms. Table 2-1 Platform
AIX HP Itanium HP-UX PARISC Linux x86 Linux Itanium IBM pSeries Solaris (SPARC) Solaris (Opteron)
Library name
libobk.a64 libobk.so libobk.sl64 libobk.so64 libobk.so libobk.so libobk.so.64.1 libobk.so.1
Make sure that your Oracle environment variables are defined. Define the variables as follows:
ORACLE_HOME ORACLE_SID The directory path to the Oracle software location. The name of the Oracle instance.
36
Installing NetBackup for Oracle About linking the Oracle Recovery Manager (RMAN) with NetBackup
Determine if you need to link or re-link the library with NetBackup. See Linking the Oracle Recovery Manager (RMAN) with NetBackup on page 36.
Note: If you have a later Oracle release, you do not have to use the make(1) command to make a new Oracle executable to use the NetBackup for Oracle API library because the Oracle executable always searches for the shared library (for example, $ORACLE_HOME/lib/libobk.so). The procedures reflect this change and describe the conditions under which you need to issue the make(1) command. To automatically link the Oracle Recovery Manager (RMAN) with NetBackup
Run the oracle_link script that is located in /usr/openv/netbackup/bin/. This script determines the Oracle version level and then links Oracle with the NetBackup API library. This script writes output to /tmp/make_trace.<pid>. To change the trace file location, change the MAKE_TRACE variable in the oracle_link script.
See Manually linking AIX (64-bit) on page 37. See Manually linking HP-UX PARISC (64-bit) on page 37. See Manually linking HP Itanium (64-bit) on page 38. See Manually linking Linux x86 (64-bit) and Linux IA-64 on page 38. See Manually linking IBM pSeries on page 39. See Manually linking Solaris (Opteron, 64-bit) on page 40.
Installing NetBackup for Oracle About linking the Oracle Recovery Manager (RMAN) with NetBackup
37
Type the following ls(1) command to determine whether the Oracle library exists:
ls -l libobk.*
(Conditional) Use the mv(1) command to move the Oracle library to an alternate location. Perform this step if the output from step 2 shows that libobk.a exists. For example:
mv libobk.a libobk.a.orig
Type the following ls(1) command to determine whether the Oracle library exists:
ls -l libobk.*
(Conditional) Use the mv(1) command to move the Oracle library to an alternate location.
38
Installing NetBackup for Oracle About linking the Oracle Recovery Manager (RMAN) with NetBackup
Perform this step if the output from step 2 shows that libobk.sl or libobk.a are present.
Type the following ls(1) command to determine whether the Oracle library exists:
ls -l libobk.so
(Conditional) Use the mv(1) command to move the Oracle library to an alternate location. Perform this step if the output from step 2 shows that libobk.so. For example:
mv libobk.so libobk.so.orig
Installing NetBackup for Oracle About linking the Oracle Recovery Manager (RMAN) with NetBackup
39
Type the following ls(1) command to determine whether the Oracle library exists:
ls -l libobk.so
(Conditional) Use the mv(1) command to move the Oracle library to an alternate location. Perform this step if the output from step 2 shows that libobk.so is present. For example:
mv libobk.so libobk.so.orig
Type the following ls(1) command to determine whether the Oracle library exists:
ls -l libobk.so
40
Installing NetBackup for Oracle About linking the Oracle Recovery Manager (RMAN) with NetBackup
(Conditional) Use the mv(1) command to move the Oracle library to an alternate location. Perform this step if the output from step 2 shows that libobk.so is present. For example:
mv libobk.so libobk.so.orig
Type the following ls(1) command to determine whether the Oracle library exists:
ls -l libobk.so
Use the mv(1) command to move the Oracle library to an alternate location. Perform this step if the output from step 2 shows that libobk.so is present. For example:
mv libobk.so libobk.so.orig
41
Type the following ls(1) command to determine whether the Oracle library exists:
ls -l libobk.so
(Conditional) Use the mv(1) command to move the Oracle library to an alternate location. Perform this step if the output from step 2 shows that libobk.so is present. For example:
mv libobk.so libobk.so.orig
Rolling back changes after you link the Oracle Recovery Manager (RMAN) with NetBackup
If you run into problems and cannot re-link Oracle with the NetBackup API library, you can roll back what you have done. To roll back changes after you link the Oracle Recovery Manager (RMAN) with NetBackup
42
The recovery catalog contains information about the following software components:
Datafile and archive log backup sets and backup pieces. Datafile copies. Archived redo logs and their copies. Tablespaces and data files on the target database. Stored scripts. These are named, user-created sequences of RMAN and SQL commands.
Oracle recommends that you use RMAN with a recovery catalog, especially if you have 20 or more data files. However, you are not required to maintain a recovery catalog with RMAN. For information on the benefits and disadvantages of using a recovery catalog, see your Oracle documentation.
Chapter
Configuration
This chapter includes the following topics:
About user interface terminology Configuring permissions for log files Configuring the Maximum jobs per client About configuring a backup policy for an Oracle database About configuring the runtime environment About creating templates and shell scripts Testing configuration settings
44
these directories can not only disable the collection of troubleshooting data, but also prevent the application itself from functioning correctly. Backup and restore operations will fail when permissions are too restrictive. We recommend that you make all of the usr/openv/netbackup/logs directories and subdirectories readable and writeable by all users (777 permissions). However, security requirements may prohibit global read-write access. If so, you can restrict permissions of specific directories to a single group or user if the following is true: All backup and restore operations related to that directory are initiated by processes that run as members of that group or as that user. Check that the /usr/openv/netbackup/logs/user_ops directory tree have 777 permissions. The items in this directory need to be accessible for the applications to operate correctly. If you restrict permissions on the other directories located in /usr/openv/netbackup/logs, backup and restore operations are not impacted. However, troubleshooting efforts may be hindered when processes do not have the appropriate permissions to update the debug logs therein.
1 2 3 4 5
In the left pane of the NetBackup Administration Console, expand NetBackup Management > Host Properties. Select Master Server. In the right pane, double-click the server icon. Click Global Attributes. Change the Maximum jobs per client value to 99. The Maximum jobs per client specifies the maximum number of concurrent backups that are allowed per client. The default is 1. See Formula for Maximum jobs per client on page 44.
45
number_of_streams 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 The number of policies of any type that can back up this client at the same time. This number can be greater than one. For example, a client can be in two policies in order to back up two different databases. These backup windows can overlap.
For Oracle backups and restores, the number of jobs is difficult to determine. This difficulty exists because Oracle internally determines when and how many streams to run in parallel to optimize performance. Note: Enter a large enough value for the Maximum jobs per client attribute to meet the number of jobs that Oracle runs. You may need to experiment with different values at your site.
Storage unit and media to use Policy attributes Backup schedules Clients to be backed up Backup templates or script files to be run on the clients
To back up a database environment, define at least one Oracle policy with the appropriate schedules. 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 database policies are the same as for file system backups. In addition to the policy attributes for this database agent, other attributes are available that you should consider. See the NetBackup Administrators Guide, Volume I. To add and configure a policy, see the following topics:
46
See About policy attributes for NetBackup for Oracle on page 47. See About adding schedules to a NetBackup for Oracle policy on page 47. See Adding clients to a NetBackup for Oracle policy on page 54. See Adding backup selections to a Oracle policy on page 55. See Adding backup selections to a Oracle policy on page 55.
1 2 3 4 5 6 7 8
Log on to the master server as administrator (Windows) or root (UNIX). Start the NetBackup Administration Console. If your site has more than one master server, choose the one on which you want to add the policy. (Windows) In the left pane, right-click Policies and choose New Policy. (Java interface) In the left pane, click Policies. In the All Policies pane, right-click the master server, and click New Policy. In the Add a New Policy dialog box, in the Policy name box, type a unique name for the new policy. Click OK. In the Add New Policy dialog box, in the Policy type list, select Oracle. The database agent policy type does not appear in the drop-down list unless your master server has a license key for the database agent.
Complete the entries on the Attributes tab. See About policy attributes for NetBackup for Oracle on page 47.
Add schedules. See About adding schedules to a NetBackup for Oracle policy on page 47. Add clients. See Adding clients to a NetBackup for Oracle policy on page 54. Add templates or scripts to the backup selections list. See Adding backup selections to a Oracle policy on page 55.
11 When you have added all the schedules, clients, and backup selections you
need, click OK.
47
Description
Determines the types of clients that can be in the policy. In some cases the policy type determines the types of backups that NetBackup can perform on those clients. To use the Oracle database agent, you must define at least one policy of type that is Oracle. For NetBackup for Oracle, the Keyword phrase entry is ignored. This option enables backups with Snapshot Client. See About NetBackup for Oracle with Snapshot Client on page 131.
48
In the Policy dialog box, click the Schedules tab. To access the Policy dialog box, double-click the policy name in the Policies list in the NetBackup Administration Console .
2 3
Double-click the schedule that is named Default-Application-Backup. Specify the other properties for the schedule. See About NetBackup for Oracle schedule properties on page 51.
Users perform database backup operations during business hours, 08:00 to 13:00. The automatic backups that use this policy start between 18:00 and 22:00.
In this scenario, the Application Backup schedule must have a start time of 0800 and a duration of 14 hours. Table 3-2 shows example settings for an Application Backup schedule. Table 3-2 Example settings for an NetBackup for Oracle Application Backup schedule Setting
2 weeks Sunday through Saturday 00:08:00 - 22:00:00
Schedule option
Retention Backup window
1 2 3 4
On the Policy dialog box, click the Schedules tab. Click New. Specify a unique name for the schedule. Select the Type of backup. See About the NetBackup for Oracle backup types on page 49.
49
Specify the other properties for the schedule. See About NetBackup for Oracle schedule properties on page 51. When an automatic schedule runs, NetBackup sets the environment variables that are based on the type of automatic backup schedule selected. You can use these environment variables to initiate a backup conditionally. See About the environment variables set by NetBackup for Oracle on page 61.
Click OK.
Type of backup
Automatic Full Backup
Setting
2 weeks
50
Application Backup
Automatic Full Backup An Automatic Full Backup copies all blocks into the backup set. It skips only the unused data file blocks. The Automatic Full Backup schedule enables scheduled NetBackup operations to be performed on the client. It is used to run a backup or XML export template or script automatically. Automatic Differential An Automatic Differential Incremental Backup backs up all blocks Incremental Backup that changed since the most recent full or incremental backup at level n or lower. For example, in a differential level 2 backup, NetBackup backs up all the blocks that were modified since the last level 2, level 1, or level 0 backup. Incremental backups are differential by default. For Oracle XML Exports, do not use an Automatic Cumulative Incremental Backup schedule or non-BLI (block level incremental) advanced methods of backup such as Snapshot Client. Automatic Cumulative An Automatic Cumulative Incremental Backup backs up all blocks Incremental Backup that changed since the most recent full backup at level n-1 or lower. For example, in a cumulative level 2 backup, NetBackup backs up all blocks that have changed since the most recent level 1 or level 0 backup. Cumulative incremental backups reduce the work that is needed for a restore. You need only one cumulative incremental backup from any particular level at restore time. However, cumulative backups typically require more space and time than Differential Incremental Backups. They duplicate the information in previous backups at the same level. For Oracle XML Exports, do not use an Automatic Cumulative Incremental Backup schedule or non-BLI (block level incremental) advanced methods of backup such as Snapshot Client.
51
Description
Specifies the type of backup that this schedule controls. The selection list shows only the backup types that apply to the policy you want to configure. See About the NetBackup for Oracle backup types on page 49.
52
Description
You can schedule a backup in one of the following ways: Frequency This setting is used only for scheduled backups. It is not used for user-directed backups. Frequency specifies the period of time that can elapse until the next backup or archive operation begins on this schedule. For example, assume that the frequency is seven days and a successful backup occurs on Wednesday. The next full backup does not occur until the following Wednesday. Typically, incremental backups have a shorter frequency than full backups. Calendar This setting is used only for scheduled backups. It is not used for user-directed backups. The Calendar option allows you to schedule backup operations that are based on specific dates, recurring week days, or recurring days of the month.
Retention
The retention period for an Application Backup schedule refers to the length of time that NetBackup keeps backup images (stream-based backups). The retention period for an automatic schedule controls how long NetBackup keeps records of when scheduled backups occurred (proxy backups). For example, if your database is backed up once every Sunday morning, you should select a retention period of at least 2 weeks. The retention period is affected by the type of schedule you select, as follows: Frequency-based scheduling 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. The NetBackup scheduler compares the latest record of the automatic backup schedule to the frequency of that automatic backup schedule 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 is unpredictable. However, if you set the retention period to be longer than necessary, the NetBackup catalog accumulates unnecessary records. Oracle is not notified when NetBackup expires a backup image. Use Oracle RMAN repository maintenance commands to periodically delete expired backup sets from the Oracle RMAN repository. Oracle XML export operations create archives for long-term storage and recovery. Set the retention level to a period of years or to infinity. Calendar-based scheduling The retention period setting is not significant for calendar-based scheduling.
Multiple copies
If you want to specify multiple copies of a backup for the policy, configure Multiple copies on the Application Backup schedule.
53
Set the NetBackup backup retention for Oracle backups to be either infinite or significantly longer than the RMAN retention. Set the RMAN retention to the number or duration to keep the backup sets in the RMAN catalog. If no RMAN catalog exists, then use SQL to set an appropriate value for "control_file_record_keep_time". The minimum appropriate time is the catalog backup retention time plus the maximum time between catalog maintenance operations. On a regular basis, run the RMAN delete obsolete command to expire obsolete images from the RMAN catalog, the control file, and from NetBackup. If a cross-check of the catalog is required, perform the cross-check after RAMN deletes the obsolete backups. Stagger the initiation of any RMAN catalog maintenance functions to limit the number of concurrent checks or deletion requests that RMAN makes of the NetBackup master server. Perform the RMAN catalog maintenance functions on a more frequent basis to limit the number of NetBackup catalog requests in a single session. Ensure that the format that is specified for all RMAN backup piece names (except for autobackups of the control file) ends with _%t. Avoid the creation of many small backup pieces of database files or archive logs.
54
To 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. More information is available on the RMAN repository maintenance commands. See Maintaining the RMAN repository on page 80. When a request is issued to delete a backup file from the RMAN repository, RMAN sends the request to NetBackup to delete the corresponding image from the NetBackup repository, regardless of the retention level.
Oracle NetBackup client or server The backup or XML export archive shell script(s), unless you use templates
In the Policy dialog box, click the Clients tab. To access the Policy dialog box, double-click the policy name in the Policies list in the NetBackup Administration Console.
2 3
Click New. Type the name of the client and press Enter (Windows) or click Add (Java). If Oracle is installed in a NetBackup cluster, specify the virtual Oracle name as the client name.
55
5 6 7
(Java) To add another client, repeat step 3. If this client is the last client you want to add, click OK. (Java) In the Policy dialog box, click Close.
Make sure the scripts reside on each client in the client list. Scripts can reside in any location. Make sure that NetBackup can access the location you choose and that NetBackup can run the scripts. Note that templates do not reside on the clients. Templates reside on the NetBackup master server. NetBackup installs sample scripts when you install the software; you can modify these scripts for your own use. Write the scripts to a location outside of the original installation location. In this way future NetBackup installations do not overwrite your sites scripts. If you use NetBackup for Oracle in a NetBackup server cluster, make sure that the scripts reside in a location that is available after a failover.
Add templates or scripts to the backup selections list only if you want to set up a policy for automatic backups. These templates or scripts are run for manual backups and for automatic schedules as specified under the Schedules tab. NetBackup runs the templates or scripts in the order that the templates or scripts appear in the backup selections list. See About creating templates and shell scripts on page 65.
56
Note: Be sure to specify the correct template and script names in the backup selections list to prevent an error or possibly a wrong operation. Make sure that the template or script resides on the client before you try to add it to the backup selections list. To add a template to the backup selections list from the Java interface
Open the Policy dialog box. To access the Policy dialog box, double-click the policy name in the Policies list in the NetBackup Administration Console.
2 3 4 5
Click the Backup Selections tab. Click New. From the Template Set list, choose the template type by operation. From the Script or Template list, select a template or type the name of a template. Include the .tpl extension. Do not include the full path. For example, weekly_full_backup.tpl.
6 7
To add a script to the backup selections list from the Java interface
Open the Policy dialog box. To access the Policy dialog box, double-click the policy name in the Policies list in the NetBackup Administration Console.
2 3 4
Click the Backup Selections tab. Click New. In the Script or Template box, type the full path name of a script on the client. For example:
/backup_scripts/db/cold_backup.sh C:\backup_scripts\db\cold_backup.cmd
5 6
57
To add a template to the backup selections list from the Windows interface
In the Policy dialog box, click the Backup Selections tab. To access the Policy dialog box, double-click the policy name in the Policies list in the NetBackup Administration Console.
2 3
Alternatively, you can type the name of the template with the .tpl extension. Do not include the full path. For example, weekly_full_backup.tpl.
4 5 6 7
From the Template set list, choose the template type by operation. From the Template list, choose the correct template. Click OK. Click OK.
To add a script to the backup selections list from the Windows interface
In the Policy dialog box, click the Backup Selections tab. To access the Policy dialog box, double-click the policy name in the Policies list in the NetBackup Administration Console.
2 3
Alternatively, you can type the full path name of the script on the client. For example:
/backup_scripts/db/cold_backup.sh C:\backup_scripts\db\cold_backup.cmd
4 5 6
Navigate to and select the script file. Click OK. Click OK.
58
About the order of precedence for runtime configuration variable settings when using scheduled backups with templates
The certain order applies when you use scheduled backups with templates. The following is the order of precedence for the runtime configuration variable settings:
Environment variables that NetBackup sets. See About the environment variables set by a user in the XML export parameter file on page 60. Environment variables that the user sets.
For RMAN backups, the user with the Oracle RMAN send command and parms operand sets these variables. See About the Oracle RMAN environment on page 59. For XML export archives, the user in the XML export parameter file sets these environment variables. See About the environment variables set by a user in the XML export parameter file on page 60.
User bp.conf. See About the bp.conf file on page 64. Master bp.conf. See About the bp.conf file on page 64.
About the order of precedence for runtime configuration variable settings for all other Oracle backups
A certain order applies when you use Oracle backups other than scheduled backups with templates.
59
The following is the order of precedence for the runtime configuration variable settings:
Environment variables that the user sets. For RMAN backups, the user with the Oracle RMAN send command and the parms operand sets these variables. See About the Oracle RMAN environment on page 59. For XML export archives, the user in the XML export parameter file sets these environment variables. See About the environment variables set by a user in the XML export parameter file on page 60.
The user can also set these variables on the Configuration Variables screen of the template generation wizards. However, variables set in this manner apply only for templates run from the client (through the wizard, or through Template Administration). When the scheduler runs these templates on the NetBackup master server, NetBackup overrides these variables.
Environment variables that NetBackup sets. See About the environment variables set by NetBackup for Oracle on page 61. User bp.conf See About the bp.conf file on page 64. Master bp.conf See About the bp.conf file on page 64.
60
See Creating RMAN templates using the NetBackup for Oracle RMAN template generation wizard on page 67.
Example 2. This example uses the parms operand to specify the 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_pol, NB_ORA_SERV=your_server)"; allocate channel t2 type 'SBT_TAPE' parms="ENV=(NB_ORA_POLICY=your_pol, NB_ORA_SERV=your_server)"; backup (database format 'bk_%s_%p_%t'); }
About the environment variables set by a user in the XML export parameter file
You can set the XML export parameter file in the Oracle users environment. If you use templates, use the template generation wizard to set these variables. See About the environment variables set by a user in the XML export parameter file on page 60.
61
Table 3-6 shows the NetBackup for Oracle environment variables. Table 3-6 NetBackup for Oracle environment variables Purpose
Specifies the name of NetBackup master server. Specifies the name of the Oracle client. Specifies the name of the policy to use for the Oracle backup. Specifies the name of the Application Backup schedule to use for the Oracle backup.
Environment variable
NB_ORA_SERV NB_ORA_CLIENT NB_ORA_POLICY NB_ORA_SCHED
Environment variable
NB_ORA_SERV NB_ORA_POLICY NB_ORA_CLIENT NB_ORA_FULL NB_ORA_INCR NB_ORA_CINC
62
BKUP_IMAGE_PERM
Specifies the name of the Oracle client. Specifies which copy of the backup to use for the restore. Enables (YES) and disables (NO) metadata collection for Guided Recovery operations. Enables the parent ID of the job ID to be displayed in the Activity Monitor (only valid if it is a scheduled job). Specifies a snapshot rollback restore using a script or RMAN command. Specifies the NetBackup for the Oracle schedule that NetBackup uses for a proxy copy file-based backup. (This schedule can be Automatic Full, Automatic Differential Incremental, or Automatic Cumulative Incremental backup type). For scheduled backups, this variable is passed from the scheduler. When you create an RMAN template with the NetBackup for OracleRMANtemplate generation wizard, this variable is automatically created in the template.
NB_ORA_PARENT_JOBID
NB_ORA_PC_RESTORE
NB_ORA_PC_SCHED
63
NB_ORA_PC_STREAMS
NB_ORA_POLICY
Specifies the name of the policy to use for the Oracle backup.
NB_ORA_RESTORE_PRIORITY Specifies the restore priority in NetBackup. NB_ORA_SCHED Specifies the name of the Application Backup schedule to use for the Oracle backup. Specifies the name of the NetBackup master server. Backup Policy<%s> to be used for backup copy number 1. Application Backup <%s> to be used for backup copy number 1. Policy<%s> to be used for backup copy number 1. Application Backup Schedule <%s> for backup copy number 1. Backup Policy <%s> to be used for backup copy number 2. Application Backup <%s> to be used for backup copy number 2. Policy<%s> to be used for backup copy number 2. Application Backup Schedule <%s> for backup copy number 2. Backup Policy <%s> to be used for backup copy number 3.
NB_ORA_SERV CPF1_BK_CLASS
CPF1_BK_POLICY
CPF1_POLICY CPF1_SCHED
CPF2_BK_CLASS
CPF2_BK_POLICY
CPF2_POLICY CPF2_SCHED
CPF3_BK_CLASS
64
CPF3_POLICY CPF3_SCHED
CPF4_BK_CLASS
CPF4_BK_POLICY
CPF4_POLICY CPF4_SCHED
For more information, see the NetBackup System Administrators Guide, Volume I. The following shows example bp.conf entries for an Oracle user:
SERVER=jupiter CLIENT_READ_TIMEOUT=900 VERBOSE=1
65
BPBACKUP_POLICY
BPBACKUP_SCHED
CLIENT_NAME
CLIENT_READ_TIMEOUT
SERVER
VERBOSE
For more information, see the NetBackup System Administrators Guide, Volume I. The following shows example bp.conf entries for an Oracle user:
66
1 2 3
Use operating system methods to log into the client upon which NetBackup for Oracle is installed. Make sure that the Oracle database is in the mount or open state. Run the following command:
/usr/openv/java/jbpSA &
Provide the information that the logon dialog box requests. On UNIX systems, how you log onto NetBackup depends on how your Oracle authentication is configured:
OS authentication for Oracle: Logon to NetBackup as an Oracle DBA UNIX account that includes sysdbaprivileges. Oracle authentication by password file: Log on to NetBackup using any UNIX account, including root. You need to provide additional Oracle logon information later in the backup process.
For the host name, type the name of the client upon which the Oracle database and NetBackup for Oracle reside. Type your user name and password in the other fields. You can log on as a regular user.
67
NetBackup for Oracle also provides a utility, bpdbsbora, that can generate a shell script from a backup wizard template. A user can then create a template with the wizard and generate a shell script from the template. The user can then run the shell script or modify the shell script further. See Creating an RMAN script from a template on page 68.
Creating RMAN templates using the NetBackup for Oracle RMAN template generation wizard
The NetBackup for Oracle backup wizard stores information about desired RMAN backup operations. The wizard uses the information to create a template that you can run immediately or you can save in a NetBackup location on the master server for later use. For more information on backup strategies and RMAN functionality, see your Oracle documentation. To create RMAN templates using the NetBackup for Oracle RMAN template generation wizard
Log on to NetBackup for Oracle client and start the NetBackup Backup, Archive, and Restore interface. See Starting the NetBackup Backup, Archive, and Restore interface on page 66.
In the Backup, Archive, and Restore interface, expand an Oracle instance and select the database object(s) (data files, tablespaces, archived redo logs) to back up. When you select the Oracle instance, you back up the whole database using RMAN
Choose Actions > Backup. The NetBackup for Oracle RMAN template generation wizard displays the following screens for you to enter information about the backup operation you want to perform:
Welcome Target Database Logon Credentials Recovery Catalog Logon Credentials Archived redo logs Configuration Options Backup Options
68
If you need an explanation of any of the fields on the wizard screens or more details, click Help on the wizard screen.
After you complete the wizard, the Template Summary screen displays the summary of the backup template: You can run the template immediately after the wizard finishes, save the template to the master server, or both. For explanations of your choices, click Help. To save, to run, or to save and run the template, click Finish.
where:
-backup -g script_file Specifies the template type. Specifies the name of the file to which you want bpdbsbora to write the script. Enclose script_file in quotation marks if it contains blanks. This option cannot be used with the -r (run) option. Specifies the name of the template that you want to use as the basis for the script. Make sure that the template exists . bpdbsbora retrieves backup templates from a known location on the master server, so specify only the template file name. Specifies the master server upon which the template resides. When you specify the bpdbsbora command, it retrieves backup templates from the specified master server.
-t templ_name
-S server_name
69
Copy the example scripts to a different directory on your client. Oracle scripts can be located anywhere on the client. See Sample scripts on page 71.
2 3
Modify each script for your environment. Make sure the su command logs into the correct user. If you do not include an su - user (user is Oracle administrator account) in your Oracle scripts, they do not run with the proper permissions and environment variables. Problems with your database backups and restores can arise.
Backup type
When you create a script, you need to specify the type of backup. RMAN supports the following different types of backups:
Full backup Level 0 Backup (Level 0 Incremental) Level n Backup (Differential incremental backup ) Level n Backup (Cumulative incremental backup )
When generating a data file backup set, you can make either an incremental backup or a full backup. An incremental backup is a backup of one or more data files that contain only those blocks that have been modified since a previous backup. A full backup is a non-incremental backup of one or more data files that contain all blocks of the data files.
File names
Observe the following with regard to file names:
70
Each output file must have a unique name. Use the %U format specifier to satisfy this restriction. %U is equivalent to %u_%p_%c, and it guarantees the uniqueness of the backup set name in all circumstances. Put %t at the end of the backup file name format. NetBackup uses the timestamp as part of its search criteria for catalog images. Without this timestamp, performance might degrade as the NetBackup catalog grows.
By default, duplex is OFF (a single backup set is produced). If you specify ON, it produces two identical backup sets.
BACKUP_TAPE_IO_SLAVES command
Note that you must enable the BACKUP_TAPE_IO_SLAVES initialization parameter to perform duplexed backups. RMAN configures as much media as needed for the number of backup copies you request. For more information on BACKUP_TAPE_IO_SLAVES, see your Oracle documentation.
send command
Use the send command to specify the policy and schedule to use with each backup. Because NetBackup uses the policy or schedule to determine what media to use, this information is required for each copy, or an error occurs. The command syntax is as follows:
send 'keyword=value [, keyword=value,...]';
71
The keywords that are used to specify a policy are CPF1_POLICY, CPF2_POLICY, CPF3_POLICY, and CPF4_POLICY, which specify the backup policy for duplexed file 1 through duplexed file 4. The keywords that are used to specify a schedule are CPF1_SCHED, CPF2_SCHED, CPF3_SCHED, and CPF4_SCHED, which specify the Application Backup schedule for duplexed file 1 through duplexed file 4.
Sample scripts
When NetBackup for Oracle was installed, the installation software wrote example scripts to the following directory:
install_path/netbackup/ext/db_ext/oracle/samples/rman
Table 3-10 explains some of the sample scripts that are provided with NetBackup for Oracle. Table 3-10 Script
cold_database_backup.sh
72
hot_database_backup.sh
cold_duplex_database_backup_full.sh This script sets up the environment and calls RMAN to run commands that make two copies of a cold (consistent) database backup.
73
Creating XML export templates using the NetBackup for Oracle wizard
NetBackup for Oracle provides a wizard that solicits information about desired XML export 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. To create XML export templates using the NetBackup for Oracle wizard
Open the Backup, Archive, and Restore interface. See Starting the NetBackup Backup, Archive, and Restore interface on page 66.
2 3 4
Click the Backup Files tab. In the left pane of the Backup, Archive, and Restore interface, expand the Oracle node. In the left pane, select the Oracle instance. Database objects that can be exported are listed under the Users node. Only the schema owners and objects accessible by the current user logon displays.
5 6 7
Expand the Users list to the schema owners of the objects to be exported. In the right pane, select the Oracle objects to export. Choose Actions > Backup to start the wizard. The NetBackup for Oracle XML export wizard displays the following screens for you to enter information about the export operation you want to perform:
Welcome Target Database Logon Credentials Configuration Options Archive Export Options NetBackup Archive Destination Options
If you need an explanation of any of the fields on the wizard screens or more details, click Help on the wizard screen.
When you have completed the wizard, the Template Summary screen displays the summary of the XML export template. You can choose to run the template immediately after the wizard finishes, save the template to the master server, or both. For explanations of your choices, click Help. To save, to run, or to save and run the template, click Finish.
74
At the command prompt, type this command using the following options:
bpdbsbora -export -g script_file -t templ_name -S server_name
where:
-export -g script_file Specifies the template type. Specifies the name of the file to which you want bpdbsbora to write the script. Enclose script_file in quotation marks if it contains blanks. This option cannot be used with the -r (run) option. Specifies the name of the template that you want to use as the basis for the script. Make sure that the template exists . bpdbsbora retrieves XML export templates from a known location on the master server, so specify only the template file name. Specifies the master server upon which the template resides. When you specify the bpdbsbora command, it retrieves XML export templates from the specified master server.
-t templ_name
-S server_name
For export:
/usr/openv/netbackup/ext/db_ext/oracle/samples/bporaexp
For import:
/usr/openv/netbackup/ext/db_ext/oracle/samples/bporaimp
The example export scripts that are installed in bporaexp are as follows:
75
The example import scripts that are installed in bporaimp are as follows:
data_archiver_import.sh data_archiver_import64.sh bporaimp_archive.param bporaimp_archive_schema_to_files.param bporaimp_archive_to_users.param bporaimp_bfile_table.param bporaimp_help.param bporaimp_ignore_rows_table.param bporaimp_large_table.param bporaimp_list.param bporaimp_old_archive.param bporaimp_partitions.pram bporaimp_table_from_files.param bporaimp_table_to_files.param bporaimp_table_to_user.param bporaimp_tables.param
1 2 3
Copy the example scripts to a different directory on your client. Oracle scripts can be located anywhere on the client. Modify each script for your environment. Make sure the su command logs into the correct user. If you do not include an su - user (user is Oracle administrator account) in your Oracle scripts, they do not run with the proper permissions and environment variables. The result is problems with your database backups and restores.
76
77
1 2 3 4 5
Log onto the master server as administrator (Windows) or root (UNIX). Start the NetBackup Administration Console. In the left pane, click Policies. Click the policy you want to test. Select Actions > Manual Backup. The Schedules pane contains the name of an automatic schedule (or schedules) configured for the policy that you want to test. The Clients pane contains the name of the client(s) listed in the policy that you want to test.
6 7
Follow the directions in the Manual Backup dialog box. To check the status of the backup, click Activity Monitor in the NetBackup Administration Console. When the Activity Monitor indicates job completion, check the output of the script(s) indicated in the policy you tested. The script shows the location to which the output is written. It is usually in the same directory as the original script, and it is similarly named. The Activity Monitor and the script output indicate the status of the backup operation. For more information, see the Troubleshooting chapter.
78
Chapter
Overview of using NetBackup for Oracle Maintaining the RMAN repository Querying the RMAN repository Performing a backup Browsing backups Performing a restore Performing other RMAN actions Performing an XML export archive Browsing XML export archives Restoring an XML export archive
80
Registering a database Before using RMAN with a recovery catalog, register the target with the recovery database in the recovery catalog. To register, start and mount the catalog target database but do not open it. At the RMAN prompt, issue a register database command. Resetting the incarnation in the recovery catalog The reset database command directs RMAN to create a new database incarnation record in the recovery catalog.
81
82
Determine whether a backup set is available or expired. Delete any expired backup sets. Call Media Manager about the status of a backup piece and then mark it as available or expired.
Use either the change...crosscheck or crosscheck backupset command to check the specified files. Note that these commands do not delete images or repository records. You must use separate commands for these operations. The change...crosscheck command queries Media Manager to determine if a backup piece is available. If a backup piece is unavailable, RMAN marks the backup piece as expired. If it was expired but is now available, RMAN marks the backup piece as available. The command syntax is as follows: change backuppiece {primary_key_list|filename_list|tag} crosscheck; change backupset {primary_key_list} crosscheck; The crosscheck backupset command operates on available and expired backup pieces. RMAN updates their status with the result (available or expired). To cross-check a database, start RMAN and connect to the target database. Also connect to the recovery catalog if one is being used. At the rman command prompt, type the following commands: allocate channel for maintenance type 'SBT_TAPE'; crosscheck backupset of database; The length of time that RMAN cross-checks or performs "delete expired" when the maintenance channel is connected to NetBackup depends on several factors:
The number of RMAN backup pieces that are past their NetBackup retention period. That is, NetBackup expires them, not RMAN. The format of the RMAN backup piece name and if the
83
The number of NetBackup policies of any kind. The length of time that NetBackup retains backups and the number of backup images for the client in the NetBackup catalog. The length of time between RMAN catalog maintenance operations. The scheduling time of the RMAN catalog maintenance operations. The speed and accuracy of hostname resolution available to the NetBackup master server. The number and complexity of operations performed by the NetBackup master server during a catalog request. Normal performance.
The DELETE OBSOLETE command deletes backups that no longer need to satisfy specified recoverability requirements. You can delete obsolete files according to the configured default retention policy, or another retention policy specified by a DELETE OBSOLETE option. As with other forms of the DELETE command, the deleted files are removed from the backup media, deleted from the recovery catalog, and marked as DELETED in the control file. If you specify the DELETE OBSOLETE command with no arguments, then RMAN deletes all obsolete backups defined by the currently configured retention policy. For example, Allocate channel for maintenance type 'SBT_TYPE'; DELETE OBSOLETE; You can also use the REDUNDANCY or RECOVERY WINDOW clauses with DELETE to delete backups obsolete under a specific retention policy instead of the configured default: DELETE OBSOLETE REDUNDANCY = 3; DELETE OBSOLETE RECOVERY WINDOW OR 7 DAYS;
84
RMAN compares the recovery catalog to either the current control file of the target database or a backup control file. It subsequently updates the catalog with the information that is missing or changed. If you are running in ARCHIVELOG mode, resynchronize the recovery catalog regularly since the recovery catalog is not updated automatically when a log switch occurs or when a redo log is archived. You must also resynchronize the recovery catalog after making any change to the physical structure of the target database. As with log archive operations, the recovery catalog is not automatically updated when a physical schema change is made. The RMAN backup, copy, restore, and switch commands update the recovery catalog automatically when the target database control file is available, and the recovery catalog database is available when any of these commands are executed. If the recovery catalog is unavailable when you issue backup or copy commands, you should resynchronize it manually. To resynchronize the recovery catalog, start RMAN and issue the resync catalog command.
85
Changing the Periodically, you might need to notify RMAN that the status of a availability of a backup backup set, backup piece, data file copy, or archived redo log has set or file copy changed. The RMAN change command enables you to make a variety of useful record changes. The change ... uncatalog command removes references to a backup piece, data file copy, or archive log from the recovery catalog. This command works only with a recovery catalog. The change ... delete command removes references to a backup piece, data file copy, or archive log from the control file and recovery catalog. It physically deletes the file. This command works with or without a recovery catalog. The change ... crosscheck command removes references to a backup piece, data file copy, or archive log from the control file and recovery catalog when that file no longer exists. This command works with or without a recovery catalog. The change ... unavailable command marks a backup piece, data file copy, or archive log as unavailable. This command works only with a recovery catalog. Validating the restore A restore validation executes a restore test run without restoring of backups the files. Test the restore of the entire database or individual tablespaces, data files, or control files. Use restore ... validate when you want RMAN to choose the backups to test. Use validate backupset when you want to specify the backup sets to test.
86
Which files need a backup? Which files have not had been backed up in awhile? Which files are not recoverable due to unrecoverable operations? Which backup files can be deleted? What was the physical schema of the database at some previous point in time?
The list command queries the recovery catalog and control file and produces a listing of its contents. The primary purpose of the list command is to determine the backups that are available. You can list the following information:
Backup sets containing a backup of a specified list of data files. Backup sets containing a backup of any data file that is a member of a specified list of tablespaces. All backup sets or copies of all data files in the database. Backup sets containing a backup of any archive logs with a specified name or within a specified range. Incarnations of a specified database or of all databases that are known to the recovery catalog.
For more information on querying the RMAN repository, see your Oracle documentation.
Performing a backup
This section describes how to perform several different types of backups.
In the same order as they appear in the file list On all clients in the client list
The NetBackup for Oracle backup templates or shell scripts start the database backup by running the rman command.
87
When the backup is started through NetBackup, RMAN performs error checking. The rman command generates an error if it considers a command invalid, but it allows any of the commands it typically considers valid to proceed. When you specify the wrong script file name, you can start an unintended operation.
88
In the Backup, Archive, and Restore interface, choose Actions > Administer Database Templates > Oracle. The Select Template list shows the names and descriptions of the RMAN backup templates that are stored on the current master server.
2 3
Select the name of the backup template you want to run. Click Run. You can use the View Status tool to see the status of the backup. Click Actions > View Status. The Oracle template administration window provides the following functions:
Run Edit Runs the selected template. Changes the contents of an existing template. The selected backup template is loaded into the NetBackup for Oracle RMAN template generation wizard. Removes the selected template. You must be the root user or the template creator to delete a template. Rename Changes the name of the selected template. You must be the root user or the template creator to rename a template. View Displays a summary of the selected template.
Delete
where:
-backup -r Specifies the template type. Runs the template.
89
-t templ_name
Specifies the name of the template that you want to use. bpdbsbora retrieves backup templates from a known location on the master server, so specify only the template file name. Optional. Specifies the master server upon which the templates reside. When it is specified, the bpdbsbora command retrieves backup templates from the specified master server. Optional. Specifies a runtime progress log. Enclose prog_file in quotation marks (" ") if it contains space characters.
-S server_name
-L prog_file
For example:
bpdbsbora -backup -r -t ORCLMonfull.tpl -S my_mast -L my_prog_log
The shell starts the database backup by running the Oracle shell script. The Oracle shell script contains commands to run rman. The NetBackup installation script installs sample scripts in the following location:
/usr/openv/netbackup/ext/db_ext/oracle/samples/rman
Running RMAN
As an Oracle user, you can run the rman command from the operating systems command prompt with the RMAN command file as a parameter. This section describes how to set the master server to hag and the Oracle policy to obk before you start the backup. If you intend to connect to a database using a TNS alias, use the RMAN send command to specify the environment variables. At the command prompt, type the following:
90
Browsing backups
You can use RMAN or the bplist command to browse backups. See Using the RMAN repository to browse backups on page 90. See Using bplist to browse backups on page 90.
Log on as root to the master server Log on as root to the client with the appropriate altnames entry.
The following example uses the command to search all Oracle backups for a client named jupiter:
/usr/openv/netbackup/bin/bplist -C jupiter -t 4 -R / /exb_n2bm5bco_1_1392342936 /exb_mabm02ko_1_1392170136 /exb_lqbltds6_1_1392083334
The -t 4 on this command specifies the Oracle backups. The -R specifies the default number (999) of directory levels to search. For more information on this command, see the bplist(1M) man page.
91
Performing a restore
Make sure that a backup has completed successfully before you attempt a restore. An error occurs if a backup history does not exist. The following sections describe how to perform user-directed restores.
Limitations
The recovery wizard has several limitations:
The database is displayed only in its current state. If objects have been deleted from the database since the last backup, these objects do not appear among the objects you can select for restore. To restore the objects that have been deleted, you need to restore the entire database point in time before the objects were deleted. Data is restored to the original location. The wizard does not provide a way for the user to specify alternate file names. The wizard does not restore control files.
92
The objects (tablespaces and data files) that make up an Oracle database are displayed by expanding an individual database node. This information is gathered from various database tables and views. Since you must be connected to the database before you can access its tables or views, logon criteria must be provided. When a user selects or expands a database node the wizard first tries to logon to the database using OS authentication. If the authentication fails the user is solicited for a user name and password. Optionally, the user is prompted for the Net Service Name if the connection is through SQL-Net, which is then used to logon to the database. This user must have a sysdba privilege since the logon credentials that are also used to perform the RMAN restore. The logon fails if the database is not in a mount state or an open state. The GUI uses the bpubsora utility to access and query the database. If there is a problem when NetBackup attempts to connect or browse a database this utility can be run from the command line to debug the issue.
Start the Backup, Archive, and Restore interface. From the command line, run the following command:
/usr/openv/netbackup/bin/jbpSA &
(Conditional) Change the policy type. Perform this step if the Oracle node is not visible. From the Actions menu, choose Specify NetBackup Machines and Policy Type.
3 4 5
Click the Restore Files tab. Expand the Oracle node in the left pane to view an Oracle instance hierarchy. Select a node in the left pane to view details in the right pane.
1 2
Open the Backup, Archive, and Restore interface. Click on the Restore Files tab.
93
3 4 5
In the Restore Type list, select Normal Backups. In the left pane, select the Oracle instance. In the right pane, select the database object(s) (data files, tablespaces) you want to recover. If you select the Oracle instance, the wizard recovers the entire database using RMAN.
Click Actions > Restore. Enter information about the recovery operation you want to perform in the screens that the NetBackup for Oracle recovery wizard displays. The screens are as follows:
Welcome Target Database Logon Credentials Recovery Catalog Logon Credentials Recovery Options Restore Options Recover Limits Database State
If you need an explanation of any of the fields on the wizard screens, click Help on the wizard screen.
Review the summary. When you have completed the wizard, the Selection Summary screen displays the summary of the recovery template. You can choose to run the template immediately after the wizard finishes or save the template locally, or both. If you need an explanation of any of the fields on the wizard panels, click Help on the wizard panel.
Click Finish to run, to save, or to run and save the recovery template.
Using bpdbsbora
The bpdbsbora command lets you run a recovery template that is created by the NetBackup Recovery wizard. At the command prompt, type this command and the following options:
bpdbsbora -restore -r -t templ_name [-L progress_file]
94
where:
-restore -r -t templ_name Specifies the template type. Runs the template. Specifies the full-path name of the template you want to use. Unlike backup templates, restore templates do not reside in a predetermined location on the master server. They are considered to be temporary in nature and should reside on the client. If the full path is not specified as part of the restore template name, the file might not be found. -L progress_file Optional. Specifies a run-time process log. Enclose progress_file in quotation marks (" ") if it contains space characters.
For example:
bpdbsbora -restore -r -t /oracle/restore_templs/ORCL_MON_Full.tpl
The operating system shell starts the database restore by running the Oracle shell script file. The Oracle shell script file contains commands to run RMAN. The NetBackup installation script writes sample scripts to the following location:
/usr/openv/netbackup/ext/db_ext/oracle/samples/rman
95
3. The server restores client A backup image to client B. Server 2. Client B requests restore of client A image to client B.
The user on client A cannot initiate a redirected restore to client B. Only the user on client B, which is the client receiving the backup image, can initiate the redirected restore. Any user who belongs to the database group that performed the backup can restore it, unless the BKUP_IMAGE_PERM variable is set to USER. The following sections describe how to perform a redirected restore using Oracle RMAN.
96
Where client_name is the name of the client that is allowed to perform the redirected restore (the destination client).
To the file, add the name of the NetBackup for Oracle source client.
1 2 3
Enable a network connection to the RMAN catalog database that the source client used. Set the NB_ORA_CLIENT environment variable to the source client. Check the bp.conf files on the source client. Make sure that the CLIENT_NAME variable either is not set or is set to the hostname of the source client.
Make the init.ora file of the source client available to the destination client. Copy the file to the destination client or modify the file on the destination client. Change all location-specific parameters.
5 6 7 8 9
Grant write permission to the directory to which you want to restore the data files. Set up a password file for the destination client database. Start up the database in the nomount state. Start RMAN, connecting to the catalog. Set dbid to be the DBID of the source client database.
97
10 Connect to the target database without using a user ID and password. 11 Run an RMAN restore script or type the RMAN commands for the restore.
The user is connected to the Oracle database using a local connection, not SQL*Net UNIX user is ora on both camel and giraffe
Create the following file on server lion and edit it to contain the name camel:
/usr/openv/netbackup/db/altnames/giraffe
2 3
Log on to giraffe as ora. Set SERVER=lion in $ORACLE_HOME/bp.conf. This server must be the first server that is listed in the bp.conf file.
4 5 6
Modify the network tnsnames.ora file to enable RMAN catalog connection. Set the environment variables ORACLE_SID to test and NB_ORA_CLIENT to camel. Make sure that the destination database directory exists and has appropriate access permissions. The data files are restored to the directory path with the same name they had when they were backed up.
98
7 8
SQL> alter database mount; %orapwd file=$ORACLE_HOME/dbs/orapwtest password=<oracle> %rman catalog rman/rman@RCVCAT RMAN>set dbid=<Saved dbID of Source Target> RMAN>connect target/ RMAN>run { RMAN> ALLOCATE CHANNEL CH00 TYPE 'SBT_TAPE'; RMAN> ALLOCATE CHANNEL CH01 TYPE 'SBT_TAPE'; RMAN> SEND 'NB_ORA_SERV=lion, NB_ORA_CLIENT=camel'; RMAN> restore database; RMAN> restore archivelog all; RMAN> } SQL>recover database until cancel using backup controlfile;
Now apply the archived logs. Type cancel when you decide to stop recovery.
99
In the same order as they appear in the file list On all clients in the client list
The NetBackup for Oracle XML export template or shell scripts start the XML export by running NetBackups bporaexp or bporaexp64 utility.
100
In the Backup, Archive, and Restore interface, click Actions > Administer Database Templates > Oracle. The Oracle template administration window appears. The Select Template list shows the names, descriptions, and types of the Oracle templates that are stored on the current master server.
2 3
Select the name of the XML export template you want to run. Click Run. The Oracle template administration window provides the following functions:
Run Edit Runs the selected template. Changes the contents of an existing template. The selected XML export template is loaded into the NetBackup for Oracle XML export template generation wizard. Removes the selected template. You must be the root user or the template creator to delete a template. Rename Changes the name of the selected template. You must be the root user or the template creator to rename a template. View Displays a summary of the selected template.
Delete
where:
-export -r Specifies the template type. Runs the template.
101
-t templ_name
Specifies the name of the template that you want to use. bpdbsbora retrieves XML export templates from a known location on the master server, so specify only the file name. Optional. Identifies the master server. bpdbsbora retrieves XML export templates from a specific master server when you specify this option. Optional. Specifies a runtime process log. Enclose prog_log in quotation marks (" ") if it contains space characters.
-S server_name
-L prog_log
For example:
bpdbsbora -export -r -t sales_arch.tpl -S my_server -L my_progress_log
Running the NetBackup for Oracle XML export script on the client
You can initiate a database XML export from the operating system command prompt: Type the full path to the shell script that performs the export. For example:
/oracle/scripts/data_archiver_export.sh
The operating system shell starts the database XML export archive by running the XML export script. The XML export script contains commands to run bporaexp. The NetBackup for Oracle installation script installs sample scripts in the following location:
/usr/openv/netbackup/ext/db_ext/oracle/samples/bporaexp/
to archive Oracle table data. For each archive, one master XML schema (.xsd) document is generated. In addition, bporaexp generates a table-specific schema (.xsd) document and a table specific instance (.xml) document for each table. Additional files are created if the table contains LONG or LOB columns.
102
Table 4-2 shows the files NetBackup creates when you run the command. Table 4-2 File
/db/netbackup/xml/test1/test1.xsd
/db/netbackup/xml/test1/USER1/TEST1.xsd
/db/netbackup/xml/test1/USER1/TEST1.xml
If the DIRECTORY parameter is not specified, NetBackup writes the backup images to a storage unit. A NetBackup backup set is created and cataloged under the name:
/Oracle/XMLArchive
All NetBackup for Oracle bporaexp backups are cataloged using this convention. Alternatively, if the parameter file does not contain the DIRECTORY parameter, NetBackup creates and catalogs the following files:
103
In production, do not use the DIRECTORY parameter in the bporaexp parameter file. When you write to a storage unit, NetBackup offers the features that include searching and cataloging with the NetBackup catalog and automatic handling of output that exceeds file system limits. With the DIRECTORY parameter, file system limits, such as a 2 GB maximum, can cause an error. To run bporaexp on the client
bporaexp parameters
This topic describes the available bporaexp (bporaexp64 on some platforms) parameters. Note the following:
Use the NetBackup parameters NB_ORA_SERV, NB_ORA_CLIENT, NB_ORA_POLICY, and NB_ORA_SCHED to specify the NetBackup runtime configuration. Otherwise, the order of precedence for the runtime configuration variable settings is used. Some parameters are valid only when you write to a storage unit. Other parameters are valid only when you write to a directory. In the following table, the right-most column contains either "Storage Unit" or "Directory" to indicate whether the parameter in that row is applicable for either writing to a storage unit or to a directory. Parameters that are recognized when you write to a directory are ignored when you write to a storage unit.
Table 4-3 shows the available bporaexp parameters with their default values.
104
Required?
N
Description
Target location
Specifies whether or not Directory bporaexp uses the SET TRANSACTION READ ONLY statement to ensure that the data from all tables is consistent to a single point in time and does not change during the execution of the bporaexp command. If the default of CONSISTENT = N is used, each table is exported as an independent transaction. Optionally specifies a directory for the output of the bporaexp utility. Directory
DIRECTORY
no default
HELP
Displays a help message with Directory descriptions of bporaexp parameters. Does not export data if HELP=Y. Optionally specifies a Storage Unit keyword phrase that NetBackup associates with the image being created by the archive operation. Values for KEYWORD must be in double quotes. Optionally specifies a file Directory name to receive informational and error messages. If this parameter is specified, messages are logged on the log file and not displayed to the terminal display. The name of the master XML Directory schema file.
KEYWORD
no default
LOG
no default
NAME
no default
105
Required?
N
Description
Target location
Optionally specifies the name Storage Unit of the NetBackup master server. Optionally specifies the name Storage Unit of the NetBackup for Oracle client. Optionally specifies the name Storage Unit of the NetBackup for Oracle policy. Optionally specifies the name Storage Unit of the backup policy schedule to use. Lists the Oracle schema Directory owners to export. For each owner, the tables, partitions, and views that are owned by that Oracle account are exported by default. The PARTITIONS and VIEWS parameters can be used to exclude partitions and views. Optionally specifies whether Directory or not table partitions are included. Only valid when used with the OWNER parameter.
NB_ORA_CLIENT
default client
NB_ORA_POLICY
NB_ORA_SCHED
OWNER
no default
PARTITIONS
106
Required?
N
Description
Target location
This parameter lets you Directory select a subset of rows from a set of tables. The value of the query parameter is a string that contains a WHERE clause for a SQL select statement that is applied to all tables and table partitions listed in the TABLES parameter. For example, if TABLES = emp, bonus and QUERY =
"where job = SALESMAN and sal < 1600", two SQL
SELECT*FROM emp where job=SALESMAN and sal<1600; SELECT*FROM bonus where job=SALESMAN and sal<1600;
Each query that runs refers to a single table at a time in the FROM clause, so it is illegal to have a join in the WHERE clause. ROW_BUFFER N 1000 Specifies the size, in rows, of Directory the buffer used to fetch rows. Tables with LONG columns are fetched one row at a time. The maximum value allowed is 32767.
107
Required?
Y
Description
Target location
Lists the table names, view Directory names, and partition names to export. The USERID must have SELECT privilege on the tables and views. The syntax used is:schema.table: partition name or schema.view name Specifies the Directory username/password (and optional connect string) of the user initiating the export. If a connect string is not provided, the ORACLE_SID environment variable is used. Optionally specifies whether Directory or not views are included. Only valid when used with the OWNER parameter.
USERID
no default
VIEWS
108
The Oracle password is not required. The operating system account that is running bporaimp has access only to archives that were created using the same account. Use the NB_ORA_SERV and NB_ORA_CLIENT parameters to specify the NetBackup server and client. Otherwise, the order of precedence for the runtime configuration variable settings is used. You can also include the LOG parameter. Information is available on the LIST, LOG, NB_ORA_CLIENT, NB_ORA_SERV, and USERID parameters. See To run bporaexp on the client on page 103. Table 4-4 shows other parameters you can include in the parameter file. Table 4-4 Parameter
ARCHIVE_DATE_FROM
Description
Optionally specifies a start date for the archive search. Used with ARCHIVE_DATE_TO to specify a range. The date format is mm/dd/yyyy [hh:mm:ss]. Optionally specifies an end date for the archive search. Used with ARCHIVE_DATE_FROM to specify a range. The date format is mm/dd/yyyy [hh:mm:ss]. Optionally specifies a keyword phrase for NetBackup to use when searching for archives. The name of the master XML schema file. Optionally specifies a comma-separated list of table owners. Optionally specifies a list of table and partition names that were included in an archive.
ARCHIVE_DATE_TO
no default
KEYWORD
no default
NAME
no default
FROMUSER
no default
TABLES
no default
For example, assume you named the list parameter file bporaimp_list.param. At the command prompt, type the following:
109
The -t 4 on this command specifies the Oracle backups or archives. The -R specifies the default number of directory levels to search, 999. For more information on this command, see the bplist(1M) man page.
110
The NetBackup for Oracle XML import wizard saves an XML import template locally in a user-specified location on the NetBackup client. XML import templates are not stored on the server because a restore is always user directed, not scheduled. Typically, you run an XML import template immediately and then delete it. The restore process requires a password for Oracle database access. Templates store encrypted passwords that are decrypted at runtime. To start the XML import wizard
Start the NetBackup Backup, Archive, and Restore interface. From the command line, run the following command:
/usr/openv/netbackup/bin/jbpSA &
2 3 4 5
(Conditional) To change the policy type, choose Actions > Specify NetBackup Machines and Policy Type. Perform this step if the Oracle node is not visible. Click the Restore Files tab. Expand the Oracle node in the left pane to view an Oracle instance hierarchy in the right pane.
In the left pane of the Backup, Archive, and Restore interface, select the Oracle instance. Database objects that can be imported are listed under the Users node. The tool displays only the schema owners and objects accessible by the current user login.
2 3 4 5
Expand the Users list to the schema owners of the objects to be imported. In the right pane, select database objects that exist in the archive to be restored. Choose Actions > Restore. Enter information about the restore operation you want to perform in the screens that the NetBackup for Oracle XML import wizard displays. The screens are as follows:
111
If you need an explanation of any of the fields on the wizard screens, or more details, click Help on the wizard screen.
Review the summary. When you have completed the wizard, the Selection Summary screen displays the summary of the XML import template. You can choose to run the template immediately after the wizard finishes, save the template locally, or both. For explanations of your choices, click Help.
Using bpdbsbora
The bpdbsbora command allows you to run an XML import template created by the NetBackup XML import wizard. At the command prompt, type this command with the following options:
bpdbsbora -import -r -t template_name [-L progress_file]
where:
-import -r -t template_name Specifies the template type. Runs the template. Specifies the full path name of the template you want to use. Unlike backup templates, XML import templates do not reside in a predetermined location on the master server. They are considered to be temporary in nature and should reside on the client. If the full path is not specified as part of the XML import template name, it must reside in the current directory. -L progress_file Optional. Specifies a run-time progress log. Enclose progress_file in quotation marks (" ") if it contains space characters.
For example:
bpdbsbora -import -r -t /oracle/imp_tpls/sales_imp.tpl -L prog_file
112
/oracle/scripts/data_archiver_import.sh
The operating system shell starts the database restore by running the XML import script file. The XML import script file contains commands to run bporaimp (bporaimp64 on some platforms). The NetBackup for Oracle installation script writes sample scripts to the following location:
/usr/openv/netbackup/ext/db_ext/oracle/samples/bporaimp/
At the command prompt, type the bporaimp command in the following format:
bporaimp [username/password] parfile = filename | help=y
On some platforms, the bporaimp64 command is used. See bporaimp parameters on page 112.
bporaimp parameters
Use the NetBackup parameters NB_ORA_SERV and NB_ORA_CLIENT to specify the NetBackup runtime configuration. Otherwise, the order of precedence for the runtime configuration variable settings is used. Some parameters are valid only when writing to a storage unit. Other parameters are valid only when writing to a directory. In the following table, the right-most column contains either Storage Unit or Directory to indicate whether the parameter in that row is applicable for either writing to a storage unit or to a directory. Parameters that are recognized when writing to a directory are ignored when writing to a storage unit. Table 4-5 describes the bporaimp (bporaimp64 on some platforms) parameters and default values.
113
Required?
N
Description
Target location
Optionally specifies a start Storage Unit date for the archive to be imported. Used with ARCHIVE_DATE_TO to specify a range. If not used, the most recent archive is imported. If the range used results in more than one archive, the most recent from the range is used. The date format is mm/dd/yyyy [hh:mm:ss]. Optionally specifies an end Storage Unit date for the archive to be imported. Used with ARCHIVE_DATE_FROM to specify a range. If not used, the most recent archive is imported. If the range used results in more than one archive, the most recent from the range is used. The date format is mm/dd/yyyy [hh:mm:ss]. Specifies a directory for the Directory output of any BFILE columns being imported. Oracles CREATE DIRECTORY command can be used to create the DIRECTORY in Oracle, and the name should match the name used in the export file.
ARCHIVE_DATE_TO
no default
BFILE_DIRECTORY
no default
114
Required?
N
Description
Target location
Specifies whether bporaimp Directory should commit after each array insert. The size of the array is determined by ROW_BUFFER. By default, bporaimp commits only after loading each table, and performs a rollback when an error occurs, before continuing with the next object. Optionally specifies a Directory directory for the input of the bporaimp utility. Optionally specifies a Directory comma-separated list of users to import from an archive containing multiple users tables. If not specified, all of the tables are imported. Displays a help message with Directory descriptions of bporaimp parameters.
DIRECTORY
no default
FROMUSER
no default
HELP
115
Required?
N
Description
Target location
Specifies whether or not Directory rows should be inserted into a table that is not empty. The default is that the table already exists and that it is empty. If it is not empty, IGNORE_ROWS = N causes an error to be reported, and the table is skipped with no rows inserted. IGNORE_ROWS = Y causes rows to be inserted with errors reported in the log file. If IGNORE_ROWS = Y and an error such as a primary key constraint violation occurs, no data is inserted if COMMIT = N. However, if COMMIT = Y, the array of rows (size determined by ROW_BUFFER) is not inserted, but bporaimp continues to process additional row arrays in the order in which they were exported. To cause all rows that do not violate a primary key constraint to be inserted, set COMMIT = Y, ROW_BUFFER = 1, and IGNORE_ROWS = Y.
KEYWORD
no default
Optionally specifies a Storage Unit keyword phrase for NetBackup to use when searching for archives from which to restore files. LIST = Y queries the NetBackup catalog and lists the archives available. Does not import the data if LIST = Y. Storage Unit
LIST
116
Required?
N
Description
Target location
Optionally specifies a file Directory name to receive informational and error messages. If this parameter is specified, messages are logged in the log file and not displayed to the terminal display. The name of the master XML Directory schema file. This parameter is required if LIST = N. Optionally specifies the name Storage Unit of the NetBackup master server. Optionally specifies the name Storage Unit of the NetBackup for Oracle client. Used with Storage Unit RESTORE_TO_DIRECTORY to restore the XML schema files only to a directory. Optionally specifies a Storage Unit directory for the output of the bporaimp utility. If used, the XML data is not parsed and inserted into Oracle. Specifies the size, in rows, of Directory the buffer used to insert rows. Tables with LONG or LOB columns are inserted one row at a time. The maximum value allowed is 32767.
NAME
no default
NB_ORA_SERV
NB_ORA_CLIENT
default client
RESTORE_SCHEMA_ONLY
RESTORE_TO_DIRECTORY
no default
ROW_BUFFER
1000
117
Required?
N
Description
Target location
Optionally specifies a list of Directory table, view, and partition names to import. If not used, all objects in the archive are imported. The objects must already exist, and the USERID must have INSERT privilege on the objects. The object names cannot be qualified with owner names, and the FROMUSER parameter is used to specify a particular owner. If a partition name is specified, it indicates the exported partition only and the rows are inserted according to the partitioning scheme of the target table. If the export contains partitions, and the import does not specify them, all are inserted. Optionally specifies a Directory comma-separated list of users to import to that can be used with the FROMUSER parameter to change the table owners. The TOUSER Oracle accounts must already exist, and the USERID must have INSERT privilege on the tables that must also exist. Specifies the Directory username/password (and optional connect string) of the user initiating the import. If a connect string is not provided, the ORACLE_SID environment variable is used.
TOUSER
no default
USERID
no default
118
3. The server restores client A backup image to client B. Server 2. Client B requests restore of client A image to client B.
The user on client A cannot initiate a redirected restore to client B. Only the user on client B, which is the client receiving the backup image, can initiate the redirected restore. Any user who belongs to the database group that performed the backup can restore it, unless the BKUP_IMAGE_PERM variable is set to USER.
119
1 2
Set the environment variables for bporaimp (bporaimp64 on some platforms) on the new client, including ORACLE_HOME and ORACLE_SID. In the bporaimp parameter file, include the following lines:
nb_ora_serv = NetBackup_server nb_ora_client = original_client_where_XML_export_occurred.
Specify any other bporaimp parameters. See Running bporaimp on the client on page 112.
Run bporaimp.
UNIX user is ora on both jupiter and saturn Archive name is sales
2 3
Edit the preceding file to contain the name jupiter. Log on to saturn as ora.
120
Run bporaimp parfile=bporaimp.param to restore sales archive to saturn and to import the data into the test database on saturn.
Chapter
Guided Recovery
This chapter includes the following topics:
About Guided Recovery Setting up for cloning Pre-operation checks Performing a cloning operation Select Master Server screen Select Source Database screen Select Control File Backup screen Destination host and login screen Destination Parameters screen Selection summary screen Pre-clone check screen Job Details screen Post-clone operations Troubleshooting Guided Recovery
122
OpsCenter retrieves information for you such as databases and control files, shortening the Oracle clone setup time. A validation process increases the rate of successfully completing the cloning operation. You do not need access to the original database to perform the cloning operation.
Oracle uses metadata cataloging, which enables database information to appear in the OpsCenter interface. Ensure that the Oracle metadata parameter in the client's bp.conf is set at backup time as follows:
ORACLE_METADATA=YES
Set up all destination file paths before you run the cloning operation, because the operation does not create new file paths during the process. Ensure that the user has write access to these paths.
Pre-operation checks
Check the following items before you begin the cloning process:
Ensure that the source and destination systems and the source and destination databases are compatible. Examples are Solaris 9 to Solaris 10 and Oracle 11 to Oracle 11. The cloning operation does not support offline tablespaces or raw tablespaces. The cloning operation does not support Oracle Automatic Storage Management (ASM). To use a different user or a different group for the clone, you must change what the permissions of the backup image are to be at backup time. Add the 'BKUP_IMAGE_PERM=ANY' to the send commands during the backup of the source database. More information is available for the 'BKUP_IMAGE_PERM' variable. See About the environment variables set by NetBackup for Oracle on page 61.
123
If the destination client is different than the source client, perform an alternate restore procedure. See Redirecting a restore to a different client on page 95. If the cloning user shares an existing Oracle home, the user must have write access to some directories such as DBS.
1 2
When you log onto OpsCenter, the first screen that appears is the Monitor Overview screen. Along the top of the screen, click Manage > Oracle Cloning. On the Select Master Server screen, use the drop-down menu to select the master server that you want to work with, then click Go. See Select Master Server screen on page 124.
The Select Source Database screen lets you filter the list of databases by database name, host name, database version, platform, and date. The default condition is to display all databases that are backed up in the default date range. Click Show Databases. More information is available on this screen. See Select Source Database screen on page 125.
The databases appear under the filtering part of the same screen. Select the database on which you want to perform a cloning operation by clicking option at the left side of the desired database entry. Then click Next>. The Select Control File Backup screen shows a timeline view of the control file backups. Select the icon for the desired control file backup from the timeline view. You can hover over the icon to display the control file details. If the icon represents multiple backups, you can hover over the icon to display all versions of the backup for that time periods. Additional information is available to verify that you have selected the correct control file. The lower left corner of the screen lists three links. More information is available about these links. See Select Control File Backup screen on page 125. Click on the icon of the control file backup you want to restore for the clone of the selected database. The default is the latest backup selected. Then click Next>.
124
The Destination Host and Login screen contains parameters for the destination of the clone to be created. Enter the destination host name in the text box that is provided or click Browse and select from a list of available hosts. Note the following prerequisites concerning the destination host:
The platform type of the source and destination must be the same. A NetBackup client must be installed. A compatible version of Oracle must be installed.
See Destination host and login screen on page 126. For operating system authentication, enter a user name, password (Windows), and domain (Windows). Then click Next>.
The Define Destination Parameters screen appears. The five tabs on this screen are used to change database attributes, the destination paths of control files, data files, and redo logs, and restore options. After you have changed the destination parameters, click Next>. See Destination Parameters screen on page 126.
The SelectionSummary screen lets you scan the information you have entered on the previous screens. Links to the recovery sets and destination database attributes let you view and verify any changes you have made. When you are satisfied with the summary information, click Next>. See Selection summary screen on page 127.
The Pre-clone Check screen lets you validate the database attributes and the file paths. To validate, click the underlined word here. If a directory path does not already exist, the validation check flags the error. If a file already exists, the validation check also flags the error, so that the cloning operation does not overwrite the file. See Pre-clone check screen on page 127. When you are ready to launch the cloning operation, click Launch Cloning Process. A display appears that is similar to the NetBackup Activity Monitor.
125
View Database Schema shows the schema of the selected control file. It shows how the database is laid out by listing each data file name, tablespace name, and its size. View Datafiles Recovery Set shows the data file backups to be used for the restore process. It also shows the backup and image information that is displayed for each data file. The data file recovery set is generated only for the files that are backed up as part of an incremental strategy. Even though
126
files that are backed up as part of a full backup do not appear in this list, the clone still completes successfully. If the image spans media, only the first media is shown in the list.
View Archived Log Recovery Set shows the archive log backups that may be used to recover the database to the latest point in time of that control file. This set is generated only for the files that are backed up as part of an incremental strategy. Even though files that are backed up as part of a full backup do not appear in this list, the clone still completes successfully.
The destination must be of the same platform type as the source of the clone. A NetBackup client must be installed. A compatible version of Oracle must be installed.
Database Attributes. This pane appears when you first enter the Database Attributes screen. Each attribute name has identical source and destination attributes. You can change the destination attribute of the instance name, database name, and database home. Note that the instance name is case sensitive while the database name is not case sensitive. Control File Paths. This pane displays the source path and the destination path for each control file. You can change a control file destination path by clicking in the associated text window and entering the new path. You can also click Browse to navigate to the desired path. When you change a path, a highlight bar appears around the text window as a visual indicator that this path has changed.
127
Data File Paths. This pane lets you change the destination path for one or more data files. Enter the path in the text window provided, then select the data files on which to apply it, and press the Apply option. Redo Log Paths. This pane displays the source path and the destination path for all redo logs. You can type in a new destination path or click Browse to navigate to the desired path. When you change a path, a highlight bar appears around the text window as a visual indicator that this path has changed. Restore Options. This pane displays restore options. The option that is displayed on this pane is Number of parallel streams for restore and recover.
When you are done making changes on this screen, click Next>. All the information from the previous screen is saved in preparation for the cloning operation. All the changes that are made in this screen are temporary and are active only for the cloning session.
The selected master server and the source database attributes. The date and time of the selected control file backup, and the backup media type. The database recovery set and the archived log recovery set. The destination database attributes selected in the previous screen and the database initialization parameters to be used for the cloning operation.
128
Post-clone operations
Perform the following after the cloning operation has completed:
On UNIX systems, update the oratab file with the appropriate instance information. If the cloning operation fails, do the following cleanup:
If the database is active, shut down the database. Remove init<SID>.ora, spfile<SID>.ora, and any other files associated with the SID being used, from the <$ORACLE_HOME>/DBS directory. Remove all data files.
Troubleshooting files for metadata collection operations at the time of the backup
From the Oracle client host:
netbackup/logs/bphdb legacy logs netbackup/logs/dbclient legacy logs (The directory must be writable by the Oracle users.) ncf unified logs, OID 309, New Client Framework ncforautil unified logs, OID 360, New Client Framework Oracle Utility
129
From the NetBackup media server: netbackup/logs/bpbrm legacy logs From the NetBackup master server:
netbackup/logs/bprd legacy logs nbars unified logs, OID 362, NetBackup Agent Request Service dars unified logs, OID 363, Database Agent Request Service
netbackup/logs/vnetd legacy logs ncf unified logs, OID 309, New Client Framework ncfnbcs unified logs, OID 366, New Client Framework NetBackup Client Services
netbackup/logs/vnetd legacy logs nbars unified logs, OID 362, NetBackup Agent Request Service dars unified logs, OID 363, Database Agent Request Service
netbackup/logs/bprd legacy logs nbars unified logs, OID 362, NetBackup Agent Request Service dars unified logs, OID 363, Database Agent Request Service
<SYMCOpsCenterServer>/config/log.conf file opscenterserver unified logs, OID 148 (The default location is <SYMCOpsCenterServer >/logs) opscentergui unified log, OID 147 (The default location is <SYMCOpsCenterGUI>/logs)
netbackup/logs/bphdb legacy logs (Includes the obk_stdout and obk_stderr logs.) netbackup/logs/bpdbsbora legacy logs
130
netbackup/logs/dbclient legacy logs (The directory must be writable by the Oracle users.) A tar of netbackup/logs/user_ops (UNIX/Linux) A compress of NetBackup\Logs\user_ops (Windows)
netbackup/logs/vnetd legacy logs netbackup/logs/bprd legacy logs nbars unified logs, OID 362, NetBackup Agent Request Service dars unified logs, OID 363, Database Agent Request Service
<SYMCOpsCenterServer>/config/log.conf file opscenterserver unified logs, OID 148 (The default location is <SYMCOpsCenterServer >/logs) opscentergui unified log, OID 147 (The default location is <SYMCOpsCenterGUI>/logs)
Chapter
About NetBackup for Oracle with Snapshot Client About supported platforms for NetBackup for Oracle with Snapshot Client How does NetBackup for Oracle with Snapshot Client work? About configuring snapshot backups with NetBackup for Oracle Restoring from a snapshot backup About configuring block-level incremental backups About Snapshot Client effects
132
NetBackup for Oracle with Snapshot Client About NetBackup for Oracle with Snapshot Client
Snapshot backup captures the data at a particular instant without causing significant client downtime. Client operations and user access continue without interruption during the backup. The resulting capture or snapshot can be backed up without affecting the performance or availability of the database.
Proxy copy
A proxy copy is a special type of backup in which NetBackup for Oracle agent manages the control of the data transfer. During the backup and restore operations, proxy copy enables the agent to manage the entire data movement between the disks that contain the data files and the storage devices that NetBackup manages. With proxy copy, RMAN provides a list of files that require backup or restore to the NetBackup for Oracle agent. The agent determines how the data is moved and when to move the data. Proxy copy is an extension to Oracles Media Management API.
NetBackup for Oracle with Snapshot Client About NetBackup for Oracle with Snapshot Client
133
Backups and restores remain tightly integrated with RMAN and its catalog, greatly simplifying administration tasks.
Stream-based operations
Stream-based operations are the standard NetBackup implementation of conventional RMAN backup and restores. In a stream-based backup, NetBackup moves the data that is provided by the server process. NetBackup captures the data stream content that RMAN provides. If the user has specified multiple streams, then RMAN opens multiple streams and NetBackup catalogs them as separate images. Figure 6-1 represents a stream-based backup or restore. Figure 6-1 NetBackup for Oracle RMAN stream-based backup or restore
Oracle Server
NetBackup
Storage
134
NetBackup for Oracle with Snapshot Client About supported platforms for NetBackup for Oracle with Snapshot Client
File-based operations
File-based operations are the NetBackup for Oracle with Snapshot Client implementation of Oracle proxy copy backups and restores. In a file-based operation, RMAN provides the list of files that require backup or restore to NetBackup for Oracle with Snapshot Client. NetBackup for Oracle with Snapshot Client performs the data movement. Figure 6-2 represents a file-based backup or restore. Figure 6-2 NetBackup for Oracle with Snapshot Client file-based backup or restore
Oracle Server
Control commands List of files Oracle database disk Data Data Oracle database disk
NetBackup
Storage
About supported platforms for NetBackup for Oracle with Snapshot Client
Before you use NetBackup for Oracle with Snapshot Client, confirm that your platform is supported.
NetBackup for Oracle with Snapshot Client How does NetBackup for Oracle with Snapshot Client work?
135
See Verifying the operating system and platform compatibility for NetBackup for Oracle on page 31.
Receives a list of files to back up from RMAN. A unique backup file name identifies each file in the NetBackup catalog. To ensure that this occurs, use the format operand to give each data file a unique name. Queries the policy to check whether the Snapshot Client policy attributes are specified.
136
NetBackup for Oracle with Snapshot Client How does NetBackup for Oracle with Snapshot Client work?
Initiates a configured number of Snapshot Client backups and waits until the jobs are completed. See Multistreaming on page 137.
Receives a list of files to restore from RMAN. Sends a restore request to the NetBackup server for all files in the list. Waits for all files in the file list to be restored by NetBackup.
NetBackup for Oracle with Snapshot Client How does NetBackup for Oracle with Snapshot Client work?
137
Multistreaming
On the initial call, NetBackup for Oracle with Snapshot Client returns a special entry to RMAN indicating that it supports proxy copy. It also indicates to RMAN that it supports an unlimited number of files to be proxy-copied in a single proxy copy session. The number of channels that are allocated for the RMAN backup proxy command does not control the degree of parallelism for proxy backups. RMAN uses only one channel for proxy copy backups except when a specific configuration is used. The NB_ORA_PC_STREAMS variable controls the number of proxy copy backup streams to be started. By default, the agent initiates one backup job for all files. If the RMAN send command passes NB_ORA_PC_STREAMS, NetBackup for Oracle splits the files into the number of groups that are specified by the variable based on the file size. The agent attempts to create streams of equal size.
138
NetBackup for Oracle with Snapshot Client How does NetBackup for Oracle with Snapshot Client work?
The RMAN procedure for data files that are backed up by proxy is the same as for conventionally backed up data files. RMAN knows that the data files were backed up by proxy, and it issues a proxy restore request to NetBackup for Oracle, which restores the data files to the new location. For more information on the required procedure, see your Oracle documentation.
NetBackup for Oracle with Snapshot Client How does NetBackup for Oracle with Snapshot Client work?
139
incremental level 0 backup. This backup can be the base for subsequent RMAN traditional incremental backups (level 1-n). To accomplish this, perform a snapshot proxy copy (file-based) level 0 incremental backup and follow with an RMAN traditional (stream-based) level 1-n incremental backup. In the following example, the first run command initiates a proxy copy backup of tablespace tbs1. NetBackup for Oracle uses a snapshot file-based backup to perform a full tablespace backup. RMAN designates this backup as eligible for incremental level 1-n backups. The second run command initiates a traditional non-proxy level 1 incremental backup of the same tablespace tbs1. In this case, NetBackup for Oracle performs a stream-based backup.
run { allocate channel t1 type 'SBT_TAPE'; backup incremental level 0 proxy format bk_%U_%t tablespace tbs1; release channel t1; } run { allocate channel t1 type 'SBT_TAPE'; backup incremental level 1 format bk_%U_%t tablespace tbs1; release channel t1; }
Example 1
This RMAN sample script initiates a whole database backup, which includes the control file. RMAN starts one proxy copy backup session by sending a list of all data files to the NetBackup for Oracle agent on channel t1. The agent splits the files into 3 streams and initiates a file-based backup for each stream. After the proxy backup is done, RMAN starts a non-proxy conventional backup of the control file on channel t1.
140
NetBackup for Oracle with Snapshot Client How does NetBackup for Oracle with Snapshot Client work?
run { allocate channel t1 type 'SBT_TAPE'; send 'NB_ORA_PC_STREAMS=3'; backup proxy format 'bk_%U_%t' (database); release channel t1; }
Example 2
This RMAN sample script initiates a whole database backup, which includes the control file. RMAN starts one proxy copy backup session by sending a list of all data files to the NetBackup for Oracle agent on channel t1. The agent splits the files into 3 streams and initiates a file-based backup for each stream. At the same time, RMAN starts a non-proxy conventional backup of the control file on channel t2.
run { allocate channel t1 type 'SBT_TAPE'; allocate channel t2 type 'SBT_TAPE'; send 'NB_ORA_PC_STREAMS=3'; backup proxy format 'bk_%U_%t' (database); release channel t1; release channel t2; }
If the RMAN recovery catalog is not used, then the version of the control file being backed up does not contain the information about the current backup. To include the information about the current backup, back up the control file as the last step in the backup operation. This step is not necessary if the recovery catalog is used.
Run { allocate channel t1 type 'SBT_TAPE'; backup format 'cntrl_%s_%p_%t' current controlfile; release channel t2; }
NetBackup for Oracle with Snapshot Client How does NetBackup for Oracle with Snapshot Client work?
141
Example 3
In this sample script, RMAN initiates two proxy copy backups sequentially on channel t1. It starts a proxy backup of tablespace tbs1 data files. After the backup is done, it starts another proxy backup of tablespace tbs2 data files.
run { allocate channel t1 type 'SBT_TAPE'; backup proxy format 'bk_%U_%t' (tablespace tbs1); backup proxy format 'bk_%U_%t' (tablespace tbs2); release channel t1; }
This configuration can cause problems if the sequential backups create snapshots on the same volumes. In such a situation, issue a single backup command such as the following which specifies both tablespaces rather than two separate backup commands:
run { allocate channel t1 type 'SBT_TAPE'; backup proxy format 'bk_%U_%t' (tablespace tbs1, tbs2); release channel t1; }
Example 4
In this example, RMAN distributes proxy copy backups over two channels. It creates two proxy copy backup sessions sending tbs1 data files on channel t1 and tbs2 data files on channel t2. Such a method is useful if you want to specify different NetBackup configurations for each channel. In this example, each send command specifies a different policy to be sent and used by each proxy backup.
run { allocate channel t1 type 'SBT_TAPE'; send NB_ORA_POLICY=policy1; allocate channel t2 type 'SBT_TAPE'; send NB_ORA_POLICY=policy2; backup proxy format 'bk_%U_%t'
142
NetBackup for Oracle with Snapshot Client About configuring snapshot backups with NetBackup for Oracle
A snapshot backup occurs when NetBackup creates a point-in-time disk image of the database and copies that image to disk. This process is nearly instantaneous; so user access to the database is not interrupted during the backup. An instant recovery occurs when NetBackup restores the on-disk snapshot copy of the database.
Another feature, off-host backup, can reduce the I/O processing load on the client that hosts the database. To use off-host backup, specify an alternate client (UNIX and Windows clients) or a data mover (UNIX clients only) to assume the I/O processing load.
The user identification and group identification numbers (UIDs and GIDs) associated with the files to be backed up must be available to both the primary client and the alternate backup client. The UID on the primary client and the alternate backup client must be the same. Similarly, the GID on the primary client and the alternate backup client must be the same.
NetBackup for Oracle with Snapshot Client About configuring snapshot backups with NetBackup for Oracle
143
Note: The UID number can be different than the GID number. Allocate at least two different volumes or file systems for database activities, as follows:
Allocate one or more volumes or file systems to the database data files.
Allocate a different set of volumes or file systems to the Oracle executables, configuration files, and the archive redo logs. One reason to have two different volumes is to separate the data files from the other files. If the logs are configured on the same volumes (or file systems) as the data files, the logs are temporarily frozen while NetBackup takes the snapshot. The process cannot access the logs when the database is active, so the database activity may freeze until the logs become accessible again. Another reason for writing the data files to their own repository is because it is required for an instant recovery point-in-time rollback. Only data files can exist on the volume or file system that is being restored.
The hardware and software that is required for the appropriate snapshot method must be installed and configured correctly. NetBackup Snapshot Client must be installed and configured correctly, and the license key for this option must be registered. To perform off-host backups, perform any special configuration that is required.
Snapshot methods for the file systems (logical volumes) on which the data files reside. Snapshot methods for the file systems (raw partitions or logical volumes) on which the data files reside. A backup method on the policy attributes dialog box.
144
NetBackup for Oracle with Snapshot Client About configuring snapshot backups with NetBackup for Oracle
An Automatic Full Backup schedule to perform file-based snapshot and off-host backups of the data files. An Application Backup schedule to perform the stream-based backup of control files and archived redo logs. Oracle does not support proxy backups of database control files and archived redo logs. These files are backed up with standard RMAN operations.
1 2 3
Open the policy you want to configure. Click on the Attributes tab. Select the Oracle policy type.
Select the policy type Select appropriate storage unit or storage unit group
(Optional) Click Retain snapshots for instant recovery (Optional) Click Perform off-host backup and specify a method
NetBackup for Oracle with Snapshot Client About configuring snapshot backups with NetBackup for Oracle
145
Select a policy storage unit from the Policy storage list. Select a policy storage unit in this step even if you plan to select Instant Recovery Snapshots Only later in this procedure. NetBackup uses this storage unit for the stream-based backups of the control files and the archived redo logs that are included in this policy. NetBackup also uses this storage unit if you select Third Party Copy Device when you configure the schedule. Any_available is not supported for the following data movers: NetBackup Media Server or Third-party Copy Device.
5 6
Click Perform snapshot backups. (Optional) Click Options to choose a snapshot method. By default NetBackup chooses a snapshot method for you. To choose a snapshot method, click auto (the default) or click one of the methods that are presented in the list. The snapshot method that you can use depends on your hardware environment and software environment. Only certain snapshot methods are supported in certain environments. See the NetBackup Snapshot Client Administrators Guide or the supported platforms matrix on the Symantec Support Web site for more information. You can configure only one snapshot method per policy. For example, assume you want one snapshot method for clients a, b, and c, and a different method for clients d, e, and f. Then you need to create two policies for each group of clients and select one method for each policy.
(Optional) Select Retain snapshots for instant recovery. When this option is selected, NetBackup retains the snapshot backup image on disk for later use in recovery.
(Optional) Select Perform off-host backup. By default, the client that hosts the database performs the backup. If you want to reduce the I/O processing load on the client that hosts the database, specify an alternate client to perform the backup.
146
NetBackup for Oracle with Snapshot Client About configuring snapshot backups with NetBackup for Oracle
(Conditional) Select an off-host backup method. The following off-host backup methods are available:
Use Alternate client (UNIX and Windows clients) If you select Alternate client, also specify the name of the client to perform the backup. This option may require additional configuration. The alternate client must be a client that shares the disk array. If you click Data mover, also select one of the following possible data movers: NetBackup Media Server Third-Party Copy Device Network Attached Storage
10 Click the Schedules tab. 11 Click New. 12 Configure an Automatic schedule for the database files. 13 (Conditional) To create only disk images, in the Destination panel, under
Instant Recovery, select Snapshots only. This setting suppresses NetBackups default behavior, which is to copy the snapshot to a storage unit. When you select Snapshots only, NetBackup creates the on-disk snapshot copy of the database, but it does not copy the snapshot to a storage unit. The on-disk snapshot becomes the only backup copy. Note that the on-disk snapshot is not considered to be a replacement for a traditional backup.
NetBackup for Oracle with Snapshot Client Restoring from a snapshot backup
147
17 Configure other attributes and add any additional schedules and backup
selections.
See About restoring individual files from a snapshot backup on page 147. See About restoring volumes and file systems using snapshot rollback on page 148.
148
NetBackup for Oracle with Snapshot Client Restoring from a snapshot backup
If instant recovery is enabled, NetBackup attempts to restore the file by using the unique restore methods available with the instant recovery feature. The type of restore method that NetBackup uses depends on your environment and the type of backup performed. If NetBackup is unable to use any of the instant recovery methods, it restores the file in the typical manner. Data is copied from the snapshot to the primary file system. Information on the instant recovery methods that NetBackup uses is available. See the NetBackup Snapshot Client Administrators Guide.
See the NetBackup Snapshot Client Administrators Guide. The following considerations are relevant for NetBackup for Oracle restores:
Snapshot rollback overwrites the entire volume. With NetBackup for Oracle, snapshot rollback always performs file verification. The agent checks for the following:
The requested files (number and names) are identical to those in the snapshot The primary volume does not contain any files that were created after the snapshot was made
RMAN only requests those files that changed since the point in time indicated. This behavior can cause file verification to fail because the number of files requested does not match the number of files in the snapshot. To prevent this error, run the restore command with a shell script and use the FORCE option. If verification fails, the rollback aborts with 249.
NetBackup for Oracle with Snapshot Client Restoring from a snapshot backup
149
Use snapshot rollback with database files only. Database files and archived redo logs should exist on different file systems or volumes.
1 2
Open the Backup, Archive, and Restore interface. Select one of the following:
In the Java interface, click the Restore Files tab. In the Windows interface, select File > Select Files and Folders to Restore. If the data file you want to restore has not changes since it was backed up, the rollback may fail. Initiate the restore from a script and use the FORCE option.
3 4
Select Actions > Select Restore Type > Point in Time Rollback. Use the NetBackup for Oracle recovery wizard for the restore. See Performing a restore on page 91.
150
NetBackup for Oracle with Snapshot Client Restoring from a snapshot backup
If you want to use a shell script or RMAN command, set a new variable, NB_PC_ORA_RESTORE=rollback. For example:
RUN { allocate channel t1 'SBT_TAPE'; send 'NB_ORA_PC_RESTORE=rollback'; sql 'alter tablespace TEST offline immediate' restore tablespace TEST; recover tablespace TEST; release channel t1; }
For example: subvol1_restore.2005.05.19.10h49m04s After you perform a point-in-time rollback, perform the following procedure before you bring the database online. To perform a point-in-time rollback restore from a SnapVault backup
1 2 3 4
Unmount the original subvolume, which is the subvolume that the restore process did not overwrite. Rename the original subvolume. Rename the new subvolume with the name of the original. Mount the new subvolume on the client. Use the ALTER DATABASE RENAME DATAFILE command to point to the restored data file on the newly created subvolume. Bring the database online.
NetBackup for Oracle with Snapshot Client About configuring block-level incremental backups
151
152
NetBackup for Oracle with Snapshot Client About configuring block-level incremental backups
Full Backup. A backup in which NetBackup backs up the entire database file, not just data blocks changed since the last full or incremental backup. Cumulative BLI Backup. This is a backup of all the data blocks of database files that changed since the last full backup. A cumulative BLI backup image contains only the data blocks of database files that changed since the last full backup, but a cumulative BLI backup can reduce the number of incremental backup images that must be applied to a restore operation. This speeds up the restore process. Differential BLI backup. This is a backup in which NetBackup performs a backup of only those data blocks of database files that changed since the last backup of any type (full, cumulative incremental, or differential incremental backup) was performed.
NetBackup for Oracle with Snapshot Client About configuring block-level incremental backups
153
When NetBackup initiates full database backups, followed by BLI backups, it creates, manages, and uses the appropriate Storage Checkpoints of the Oracle data file file systems.
154
NetBackup for Oracle with Snapshot Client About configuring block-level incremental backups
To support BLI backup, the VxFS file systems need extra disk space to keep track of the block change information. The space required depends on the database workload while the backup is running. For Nodata Storage Checkpoints, the additional space required by each file system is about 1% of the file system size. The default option that NetBackup uses for backups is to use Fulldata Storage Checkpoint. With this option, the NetBackup for Oracle agent keeps the Oracle data files in backup mode only for the time needed to create a Storage Checkpoint.
If the agent finds this file during run time, it uses Nodata Storage Checkpoint, and it keeps the data files in backup mode for the duration of the backup.
NetBackup for Oracle with Snapshot Client About configuring block-level incremental backups
155
NetBackup Snapshot Client is installed and configured, and the license key for this option is registered. Veritas Storage Foundation for Oracle must be installed and configured. Veritas File System must have Storage Checkpoint licensed.
For more information on requirements, see the NetBackup Snapshot Client Administrators Guide.
The BLI backup method on the policy attributes dialog box. An Automatic Backup schedule to perform full and incremental file-based backups of the data files. An Application Backup schedule to perform a stream-based backup of control files and archived redo logs. These files are backed up with standard RMAN operations.
1 2 3 4 5 6
Open the policy you want to configure. Click the Attributes tab. From the Policy Type list, choose Oracle. Select a Policy storage. Select Perform block level incremental backups. To configure schedules, click the Schedules tab. Oracle does not support proxy backups of database control files and archived redo logs. To perform a whole database proxy backup, which automatically includes a backup of the control file, configure the following:
One or more automatic backup schedules to perform proxy BLI backups of the data files. An Application Backup schedule type to back up the control files and archived redo logs.
156
NetBackup for Oracle with Snapshot Client About Snapshot Client effects
7 8
On the Clients tab, specify clients to be backed up with this policy. On the Backup Selections tab, specify the template or script.
If the number of backup streams that is specified changed from the previous backup. This change can be made in the NB_ORA_PC_STREAMS environment variable. If NetBackup does not have a valid full backup image for the same policy in its database. For example, this situation can occur if images were expired. If a new file was added to or deleted from the list of files for an incremental backup.
NetBackup for Oracle always initiates a full backup under these conditions, even if you want to perform an incremental backup.
NetBackup for Oracle with Snapshot Client About Snapshot Client effects
157
Application Backup
Automatic Full Backup For file-based proxy copy backups, the automatic backup schedule types serve the following purposes: Automatic Differential Incremental Backup, Automatically start the backups by running the NetBackup for Oracle RMAN scripts or templates. Automatic Cumulative Control file-based snapshot backups of the database objects. Incremental Backup Snapshot backups do not support BLI functionality. Database headers are always updated when a checkpoint of the database is performed. An incremental backup that copies each changed file in its entirety is likely to include all of a databases files. In effect, the backup is then a full backup. If you specify an automatic backup type for a snapshot backup, a full backup is performed.
158
NetBackup for Oracle with Snapshot Client About Snapshot Client effects
Multiple copies
If you use Multiple copies and want to specify multiple copies of non-proxy stream-based backups for your Oracle policy, configure Multiple copies on the Application Backup schedule. For proxy file-based backups, configure Multiple copies on the automatic backup schedule.
NetBackup for Oracle with Snapshot Client About Snapshot Client effects
159
If you use a script, the script must reside on each client that is included in the policy. Include the Oracle backup proxy command in the script to perform the advanced backup method. Sample scripts are included with the installation.
Environment variables
You can use environment variables to change the number of streams the proxy copy session uses or to specify an alternate backup schedule. See About configuring the runtime environment on page 58. The following list shows the variables that you can to set that are specific to NetBackup for Oracle with Snapshot Client:
NB_ORA_PC_SCHED The NetBackup for Oracle schedule NetBackup uses for a proxy copy file-based backup. (This schedule can be Automatic Full, Automatic Differential Incremental, or Automatic Cumulative Incremental backup type). For scheduled backups, this variable is passed from the scheduler. When you create an RMAN template with the NetBackup for Oracle RMAN template generation wizard, this variable is automatically created in the template. NB_ORA_PC_STREAMS Specifies the number of backup streams that NetBackup starts simultaneously in each proxy copy session. When a backup starts, NetBackup groups all data files into a specified number of backup streams that are based on the file sizes. NetBackup tries to create streams of equal size. The default value for NB_ORA_PC_STREAMS is 1. Only a user can set this variable. When you create an RMAN template using the NetBackup for Oracle RMAN template generation wizard, this variable is automatically created in the template when you provide a value for the Number of parallel streams.
For NetBackup for Oracle with Snapshot Client, the order of precedence for environment variables is the same as for standard NetBackup for Oracle. Refer to the instructions for how to configure the NetBackup and the user variables. See About configuring the runtime environment on page 58. NetBackup for Oracle installs sample scripts in the following location:
/usr/openv/netbackup/ext/db_ext/oracle/samples/rman
160
NetBackup for Oracle with Snapshot Client About Snapshot Client effects
The following are the scripts for NetBackup for Oracle with Snapshot Client that show how to configure the required variables:
hot_database_backup_proxy.sh This script sets the environment and calls RMAN with the appropriate command to perform a whole database proxy backup. When NetBackup runs a schedule, it sets the environment variables that NetBackup for Oracle with Snapshot Client uses. The script shows how to use the RMAN send command to pass the NetBackup for Oracle with Snapshot Client variables with a vendor-specific quoted string. This script sets the environment and calls RMAN with the appropriate command to perform a tablespace proxy backup.
hot_tablespace_backup_proxy.sh
If you use scripts, use the send command to pass the environment variables to the agent. The following example uses the send command to specify the values for NB_ORA_PC_SCHED and NB_ORA_PC_STREAMS:
run { allocate channel t1 type 'SBT_TAPE'; send 'NB_ORA_PC_SCHED= sched, NB_ORA_PC_STREAMS= number; backup proxy (database format 'bk_%U_%t'); }
For more information, see the sample scripts that are provided with the agent.
Chapter
Troubleshooting
This chapter includes the following topics:
About troubleshooting About the general troubleshooting steps NetBackup debug logs and reports Enabling the debug logs for a NetBackup UNIX/Linux client About the NetBackup for Oracle log files Setting the debug level on a UNIX or Linux client About NetBackup server reports RMAN utility logs Additional XML export and import logs Troubleshooting backup or restore errors Troubleshooting XML export or XML import errors Troubleshooting the browser interface and wizards Troubleshooting NetBackup for Oracle with Snapshot Client Minimizing timeout failures on large database restores
About troubleshooting
NetBackup, NetBackup for Oracle, and the Oracle Recovery Manager (RMAN) all provide reports on database backup, archive, and restore operations. These reports are useful for finding errors that are associated with those applications.
162
NetBackup 7.0. Oracle RDBMS 8.0.4 or later. XML export and XML import require Oracle RDBMS 8.1.5 or later.
When verifying your installation, ensure that the NetBackup for Oracle binaries exist. These are located in /usr/openv/netbackup/bin. The binaries are as follows:
This binary resides on the client and is used by both the NetBackup scheduler and the graphical interface to start backups. The main purpose of bphdb is to run an Oracle template or shell script that in turn calls rman, bporaexp, or bporaimp. libobk A shared library module that contains functions callable by RMAN. This library is loaded when RMAN is started. The name of this binary depends on the operating system. See About linking the Oracle Recovery Manager (RMAN) with NetBackup on page 34.
For XML export and XML import, verify that the binaries exist. The binaries are as follows:
/usr/openv/netbackup/bin/bporaexp64 /usr/openv/netbackup/bin/bporaimp64 /usr/openv/lib/libbpora64.so.8.0 (libbpora64.sl.8.0 on HP-UX) /usr/openv/lib/libbpora64.so.9.0 (libbpora64.sl.9.0 on HP-UX)
163
For the Backup, Archive, and Restore interface, verify that the following binaries exist.
/usr/openv/netbackup/bin/bpdbsbora /usr/openv/netbackup/bin/bpubsora /usr/openv/lib/libdbsbrman.so (libdbsbrman.sl on HP-UX) /usr/openv/lib/libnbberman.so (libnbberman.sl on HP-UX)
Check that both the NetBackup server and client software work properly. That is, check that normal operating system files can be backed up and restored from the client. The NetBackup client must be running the same version of software as the NetBackup server. The logs can become very large, especially bpdbm. Ensure that enough free disk space exists in the log directory disk partition. Check that the following NetBackup log directories exist:
5 6
On the client: bpdbsbora, bporaexp (or boraexp64), bporaimp (or boraimp64), dbclient, bphdb, and bpcd. These directories must have 777 permissions. On the master server: bprd and bpdbm. On the host with the storage unit: bpbrm and bptm.
Check that the /usr/openv/netbackup/logs/user_ops directory and subdirectories have 777 permissions. They must exist and be accessible for the applications to operate correctly. See Configuring permissions for log files on page 43.
These logs do not reveal the errors that occur when RMAN is running unless those errors also affect NetBackup. Oracle may (or may not) write errors in the application to the NetBackup logs. Your best sources for Oracle error information are the logs provided by Oracle. Generally, each debug log corresponds to a NetBackup process and executable.
164
However, for an RMAN backup, the debug log is created in the dbclient directory, which has no corresponding executable. Information about the debugging log files is available. See the NetBackup Troubleshooting Guide. Also refer to the following file:
/usr/openv/netbackup/logs/README.debug file
For example:
cd /usr/openv/netbackup/logs mkdir bphdb
165
The user_ops, each of the log directories, and any subdirectories should have 777 permissions. They must exist and be accessible for the applications to operate correctly. For example:
chmod 777 bphdb
Enable logging for the nbpem, nbjm, and nbrb scheduling processes that use unified logging. NetBackup writes unified logs to /usr/openv/logs. You do not need to create log directories for processes that use unified logging. Information on how to use logs and reports is available. See the NetBackup Troubleshooting Guide.
obk_stdout.mmddyy
Unless it is redirected elsewhere, NetBackup writes template or shell script output to this file.
obk_stderr.mmddyy
Unless it is redirected elsewhere, NetBackup writes template or shell script errors to this file.
log.mmddyy
This log contains debugging information for the bphdb process. bphdb is the NetBackup database backup binary. It is invoked when an automatic backup
166
schedule is run. NetBackup for Oracle uses this client process for template or shell script execution.
About the dbclient directory on the NetBackup for Oracle database client
The /usr/openv/netbackup/logs/dbclient directory contains execution logs. The following execution log exists:
log.mmddyy
This log contains debugging information and execution status for the NetBackup for Oracle client process. (This library program is libobk.)
167
168
When bporaexp and bporaimp are used and the backup images are written to a storage unit, these errors are also logged in the NetBackup debug logs. These logs appear in the following directories:
/user/openv/netbackup/logs/bporaexp /user/openv/netbackup/logs/bporaimp
When you use bporaexp and bporaimp and the backup images are written to an operating system directory, the file that is specified by the LOG= parameter is the only source of error logging and tracing.
On the NetBackup side, an error can be from the API, from the NetBackup server or client, or from Media Manager. On the Oracle side, an error can be from RMAN or from the target database instance.
Symantec suggests that you use the following steps when troubleshooting a failed operation:
Check the logs to determine the source of the error. Troubleshoot each stage of the backup or restore.
169
The first place to start is to run rman from the command line rather than having the NetBackup scheduler run a script. These troubleshooting steps assume that you are running rman from the command line. If NetBackup and RMAN are in communication, look for a log in /usr/openv/netbackup/logs/dbclient. If a log file exists and you have problems, a configuration problem is usually present within the NetBackup policy or media availability . For example:
cd /usr/openv/netbackup/logs/dbclient ls log.123098
The preceding example shows how to check for a log files presence. The presence of a log file indicates that NetBackup and Oracle RMAN are linked correctly.
If NetBackup and Oracle rman are not communicating, you do not see a log in /usr/openv/netbackup/logs/dbclient. Logs are not created in this directory if the permissions are not set correctly for the Oracle user to write to the directory. A full permission setting is best. Type chmod 777 to open up all permissions. If you receive an error such as one of the following, it often means that the link step (oracle_link) failed:
RMAN-00571:============================================================ RMAN-00569:=============== ERROR MESSAGE STACK FOLLOWS: =============== RMAN-00571:============================================================ RMAN-03009: failure of allocate commands on t1 channel at 05/11/2005 09:29:37 ORA-19554: error allocating device, device type: SBT_TAPE, device name: ORA-27211: Failed to load Media Management Library Additional information: 25
Verify that the RMAN script works correctly. See Verifying the RMAN script on page 169.
170
1 2 3 4
Use RMAN to make a backup directly to disk. Do not use NetBackup. Use RMAN with NetBackup to create a backup. Check the /usr/openv/netbackup/logs/dbclient directory permissions. They should be set to 777. Look for a log file in /usr/openv/netbackup/logs/dbclient If no log file exists, libobk is not linked into Oracle properly. See Testing configuration settings on page 76.
rman starts.
From an RMAN backup or restore initiated from the operating system prompt such as:
rman target user/pwd[@TNS_alias] \ rcvcat user/pwd[@TNS_alias]\ cmdfile RMAN_script_file_name
Using a template that runs from the NetBackup client interface or from bpdbsbora. Manually from the administrator interface on the master server. Automatically by an automatic backup schedule. If an error occurs now, check the RMAN log.
RMAN verifies its environment and then issues requests to the API. Some information, such as the NetBackup version, API versions, trace file name, and NetBackup signal handlers, is registered with RMAN. An error now is usually due to a problem with client and server communication. Check the messages in the bprd and bpcd logs for clues. Also verify the bp.conf entries on the client. RMAN issues a backup or restore request.
171
The API gathers necessary parameters and sends the backup or restore request to the NetBackup server. The API waits until both the server and client are ready to transfer data before returning. The API then sends this information to the master servers bprd process. To troubleshoot a problem in this part of the first sequence, examine the following file:
/usr/openv/netbackup/logs/dbclient/log.mmddyy
If the bprd process failed, check the logs for bprd and bpbrm. A failure now is frequently due to bad NetBackup server or Oracle policy configuration parameters. NetBackup can usually select the correct Oracle policy and schedules, but NetBackup can select a policy or schedule in error if there are several Oracle policies in its database. Try setting the SERVER and POLICY values in the bp.conf file on the client or by setting environment variables. For example, the following C Shell setenv commands specify the Oracle policy, schedule, and server for NetBackup to use:
setenv NB_ORA_POLICY policyname setenv NB_ORA_SCHED application_backup_schedule_name setenv NB_ORA_SERV NetBackup_server
RMAN issues read or write requests to the API, which then transfers data to or from the NetBackup server. A failure here is probably due to NetBackup media, network, or timeout errors. RMAN tells the API to close the session. The API waits for the server to complete its necessary actions (for example, it verifies the backup image) and then exits. An error can originate from either NetBackup or RMAN, as follows:
RMAN aborts if it encounters an error while it reads a data file during the backup (for example, if Oracle blocks are out of sequence). It also aborts if NetBackup sends a bad backup image during the restore. NetBackup might return an error code to the API if for some reason it could not complete the backup successfully.
172
On the NetBackup side, an error can be from the bporaexp or bporaimp programs, the NetBackup server or client, or Media Manager. On the Oracle side, an error can be from the target database.
Symantec suggests that you use the following steps when troubleshooting a failed operation:
Check the logs to determine the source of the error. Troubleshoot each stage of the XML export or XML import. The following sections describe these steps in detail. These sections describe the log files from the bporaexp and bporaimp commands. For 32-bit Oracle, the logs are created in /usr/openv/netbackup/logs/bporaexp or /usr/openv/netbackup/logs/bporaimp. For 64-bit Oracle, the logs are created in /usr/openv/netbackup/logs/bporaexp64 and /usr/openv/netbackup/logs/bporaimp64. The following sections reference the bporaexp and bporaimp directories. If you use 64-bit Oracle, look in the bporaexp64 and bporaimp64 directories.
Check the bporaexp or bporaimp log. If the LOG parameter is specified in the bporaexp or bporaimp commands parfile, the commands write logs to the file that is specified as the argument to the LOG parameter. The commands write log information to the screen if LOG is not specified. For example,incorrect installation or configuration causes the following common problems:
The ORACLE_HOME environment variable was not set. The bporaexp or bporaimp program was unable to connect to the target database.
When bporaexp and bporaimp are being used and the backup images are being written to an operating system directory, these logs are the only source of error logging and tracking.
173
Examine these logs for messages that show how to determine the source of an error. These logs are written by the NetBackup client and contain the following:
Requests from bporaexp and bporaimp Activities between bporaexp and bporaimp and NetBackup processes
If the logs do not contain any messages, the following conditions could be present:
NetBackup.
bphdb (if started by the scheduler or graphical user interface) did not start
the template or shell script successfully. Check the bphdb logs for stderr and stdout files. Try to run the XML export or XML import template or script file from the command line to determine the problem. Usually, the error is due to a file permission problem for bphdb itself or for the export or import script file. Ensure that the full XML export or import script file name is entered correctly in the Backup Selections list of the Oracle policy configuration, or for templates, that the name is correct. Logs are not created in this directory if the permissions are not set for the Oracle user to write to the directory. The full permissions setting, chmod 777, is best.
174
Using a template run from the NetBackup client GUI or bpdbsbora. Manually from the NetBackup Administration Console on the master server. Automatically by an automatic export schedule.
and NetBackup. Oracle connect errors can be caused by an Oracle environment problem, a database problem, an incorrect userid, or an incorrect password. A NetBackup error now is usually due to a problem with client and server communication. Check the messages in the bprd and bpcd logs for clues. Also verify the bp.conf entries on the client.
bporaexp or bporaimp issues a backup or restore request. bporaexp or bporaimp gathers necessary parameters, sends the backup or
restore request to the NetBackup server, and waits until both the server and client are ready to transfer data before proceeding. The NetBackup client interfaces gather information from the following places:
The environment, including bporaexp and bporaimp parameter files.If you are using templates, the parameter files are generated from the template. If you are using scripts, you have to generate the parameter file manually. The users bp.conf and /usr/openv/netbackup/bp.conf files on the client.
This information is sent to the master servers bprd process. To troubleshoot a backup problem in this part of the sequence, examine the following file:
/usr/openv/netbackup/logs/bporaexp/log.mmddyy
If the bprd process failed, check the bprd and bpbrm logs.
175
Frequently, incorrect NetBackup server or Oracle policy configuration parameters cause failures at this point. NetBackup can usually select the correct Oracle policy and schedules, but NetBackup can select a policy or schedule in error if there are several Oracle policies in its database. Try setting the SERVER and POLICY values in the bp.conf file on the client or by setting the following bporaexp parameters:
NB_ORA_POLICY=policyname NB_ORA_SCHED=schedule NB_ORA_SERV=NetBackup_server NB_ORA_CLIENT=NetBackup_client
Make sure that the correct NetBackup server and NetBackup client values are being used by setting the following bporaimp parameters:
NB_ORA_SERV=NetBackup_server NB_ORA_CLIENT=NetBackup_client
Set these parameters to the same values that were used for the XML export operation.
Oracle Call Interface (OCI) to run the query. The query results are translated into XML. The XML output is passed to the NetBackup client interfaces. The reverse process is used by bporaimp. That is, XML data is restored, parsed, and inserted into the database. A failure here is probably due to an Oracle error, or to a NetBackup media, network, or timeout error.
bporaexp or bporaimp tells the NetBackup client to close the session and
disconnects from the Oracle database. The NetBackup client waits for the server to complete its necessary actions (backup image verification and so on) and then exits.
176
A NetBackup for Oracle license is installed on the master server. For browsing in the restore window, the policy type must be set to Oracle. Perform the following actions to change the client policy type:
On the Actions menu, select Specify NetBackup Machines and Policy type. In the Policy type drop-down list, select Oracle. Click OK.
The oratab file is in the correct location (/etc/oratab or /var/opt/oracle/oratab) and contains all of the available Oracle SIDs. Although Oracle allows the use of wild cards in the oratab file, the NetBackup BAR GUI requires that each SID be specified.
If you have trouble connecting to the Oracle database, verify the following:
Make sure that the database is in a mount state or an open state. Make sure that your login ID and password have Oracle SYSDBA privileges. Initially, NetBackup for Oracle attempts OS Authentication to log on. If that fails, you are prompted for a user name, password, and an optional Transparent Network Substrate (TNS) alias. The user name and password you enter must have SYSDBA privileges. In a clustered environment, failure to connect to the database can mean a problem with the network configuration. The browser must connect locally. However, in some environments, all connections are considered to be remote connections, even a connection to a local database. This behavior is true for example in an Oracle Real Application Clusters (RAC) environment. In such cases, you must make the connection using a TNS alias.
In a Linux environment, Oracle backups and restores fail if the Linux logon is not the Oracle user. In such cases, Oracle generates the following message:
INF - ORA-19554: error allocating device, device type: SBT_TAPE, device name: INF - ORA-27211: Failed to load Media Management Library
If you want to start an Oracle job as someone other than an Oracle user, augment the default shared library search path. Use the Linux ldconfig(8) command to add $ORACLE_HOME/lib to the search path.
177
/usr/openv/netbackup/logs/
bpbrm on the NetBackup media server bptm/bpdm on the NetBackup media server bpbkar on the NetBackup client and alternate client bpfis on the NetBackup client and alternate client bppfi on the NetBackup client or alternate client
Snapshot Client restore and debug messages are written to the following subdirectories on the NetBackup master server:
bprestore. This is almost always a client log on the NetBackup host that
bprd. on the NetBackup master server. bpbrm on the NetBackup master server. bptm/bpdm on the NetBackup media server. (Both tape and disk backup log to
Additional troubleshooting information, including troubleshooting installation problems, is available in the NetBackup Snapshot Client Administrator's Guide.
178
media or device access. If the delay is too long, the restore session times out. Use the following procedure to minimize session timeouts and to allow the restores to complete successfully. To minimize timeout failures on large database restores
1 2
In the NetBackup Administration Console, expand NetBackup Management > Host Properties > Clients Set the Client read timeout property to a large value. The default for the Client read timeout setting is 300 seconds (5 minutes). For database agent clients, increase the value significantly from the recommended value. See the NetBackup Administrators Guide, Volume 1. For example, change this setting to 30-60 minutes to minimize timeout errors.
Appendix
About Real Application Clusters About virtual names About archiving schemes About how to back up a database About restoring a database About restoring archive logs
180
Warning: Do not use a single virtual client name if the backup is load balanced across more than one node. In a load-balanced configuration, the node that hosts the IP address to which the virtual name resolves, generates successful backups, but the jobs originating from the other nodes fail with status code 54. If a virtual client name is not used, a regular restore can be performed only from the node that is associated to the client name that is specified on the backup. Another possible solution in this environment is to use an alternate client restore.
If the CFS solution is not available, Oracle recommends a scheme like that in Figure A-2. In Figure A-2, each node archives to a local directory and writes a copy to each of the other nodes archive directories. The locations are shared between the nodes (with read and write permissions) by NFS mounting the directory (UNIX) or sharing the locations (Windows). Figure A-2 describes non-CFS local archiving scheme with archive sharing.
181
Figure A-2
Archive destination 1
Archive destination 2
Archive destination 1
Archive destination 2
Node 1
Node 2 NFS mount or Shared location read and write access Physically attached Logically attached
A scheme similar to the previous one exists if each node archives to a local directory, and the locations are shared (read-only) with the other nodes in the cluster. These locations are shared among the nodes by NFS-mounting the directory (UNIX) or sharing the locations (Windows). Therefore, each node can read each archive destination. Figure A-3 describes non-CFS local archiving scheme with archive read-only sharing.
182
Figure A-3
Archive destination 1
Archive destination 2
Archive destination 1
Archive destination 2
Node 1
Node 2 NFS mount or Shared location read and write access Physically attached Logically attached
The simplest archiving scheme is local archiving with no sharing. Each node writes only to the local destination, and no access is given to the other nodes in the cluster. Figure A-4 describes non-CFS local archiving scheme with no archive sharing. Figure A-4 Non-CFS local archiving scheme with no archive sharing
Archive destination 1
Archive destination 2
Node 1
Node 2
183
For more information about configuration and additional archiving scheme examples see your Oracle documentation.
184
Example
In this example, all of the backup images to be restored must all be accessible via the client name saturn in the image database on the master server jupiter. The following example restores the entire database from any node:
RUN { ALLOCATE CHANNEL ch00 TYPE 'SBT_TAPE'; SEND 'NB_ORA_CLIENT=saturn, NB_ORA_SERV=jupiter'; RESTORE DATABASE; RECOVER DATABASE; RELEASE CHANNEL ch00; }
Note: This example works only if the backup is not load balanced across multiple nodes, because NB_ORA_CLIENT=$NB_ORA_CLIENT evaluates only to the node on which the RMAN script is executed.
The NB_ORA_CLIENT environment variable is set to the virtual host name of the cluster. The CLIENT_NAME variable in the user or master bp.conf file on the client is set to the virtual host name of the cluster.
To remedy this problem, set the CLIENT_NAME variable to the node name. More information is available on restores and redirected restores. See Performing a restore on page 91.
If the remote archived log destinations allow write access. See Figure A-2. If the archive logs reside on a CFS.
185
See Figure A-1. In the examples that follow, the client is saturn and the server is jupiter. The names jupiter and saturn can be either the physical names or the virtual names of the nodes in the cluster. The following example restores all of the archive logs:
RUN { ALLOCATE CHANNEL ch00 TYPE 'SBT_TAPE'; SEND 'NB_ORA_CLIENT=saturn, NB_ORA_SERV=jupiter'; RESTORE ARCHIVELOG ALL; RELEASE CHANNEL ch00; }
If the remote archive logs destinations do not allow write access, use a script such as the following to restore the archive logs:
RUN { ALLOCATE CHANNEL ch00 TYPE 'SBT_TAPE'; SEND 'NB_ORA_CLIENT=saturn, NB_ORA_SERV=jupiter'; SET ARCHIVELOG DESTINATION TO <directory>; RESTORE ARCHIVELOG ALL; RELEASE CHANNEL ch00; }
where <directory> is the directory into which you copied the archive logs. Use a script like the preceding one if your configuration is like that shown in Figure A-3 and Figure A-4.
186
Appendix
Introduction
The Real Application Clusters (RAC) option allows multiple concurrent instances to share a single physical database. This section describes the methods that can be used to balance the backup load across multiple nodes of an Oracle RAC database. Oracle database backup and recovery are more difficult as databases grow in size and greater demands on database availability limit the time to perform backups. Often the backup time window is too short to accommodate a complete backup process by using only one backup node in the cluster. Database administrators need more efficient methods to complete these large backups in the allotted time. For the Oracle RAC database, Oracle can split the backups into pieces and send them in parallel from multiple nodes, which shortens the processing time.
188
Best practices for protecting Oracle RAC with NetBackup Operational characteristics
Operational characteristics
This section lists background information for NetBackup for ORACLE general operation. The following lists what occurs when you initiate RMAN:
The NetBackup Oracle policy can contain one or more client names and one or more backup scripts to execute. The NetBackup master server uses the automatic schedules in the Oracle policy to determine when the scripts are run on the clients. The NetBackup scheduler starts one Automatic Backup job for each client in the policy. The jobs can run concurrently. The scheduler executes each script on each client in the specified sequence. All the scripts for one client run in the same automatic job. The backup scripts start RMAN. If an automatic schedule and script do not exist in the policy, a process on the client can still initiate RMAN when necessary.
The following lists what occurs when RMAN requests the backup:
RMAN connects to the appropriate Oracle instance(s) for the backup. Hence, the script may execute on one host, but the backup may take place on a different host. RMAN allocates one or more channels according to the backup script. RMAN sends one or more backup set pieces on each channel, in sequence. Each channel interacts with NetBackup for Oracle and sends a user-directed backup request to the NetBackup master server for each backup set piece. Each request becomes a separate NetBackup Application Backup job. Hence there can be one Application Backup job queued or active, concurrently, per allocated channel. For the Application Backup jobs, by default the NetBackup master server selects the first policy it finds of type Oracle for this client. It also uses the first schedule of type Application Backup within the policy. The NetBackup master server must be able to match the requesting client name to an Oracle policy and Application Backup schedule, or the job fails. RMAN can send one or more of the variables NB_ORA_CLIENT, NB_ORA_POLICY, and NB_ORA_SCHED to the NetBackup master to override the selected defaults for the job.
The following lists how NetBackup receives the data from RMAN:
Best practices for protecting Oracle RAC with NetBackup RAC backup configurations
189
The Application Backup jobs activate and the NetBackup media server processes connect to the provided client name to receive the data. Hence, the client name that is sent in the user-directed request must bring the data connection back to the requesting host. RMAN sends the appropriate data on the appropriate channel, and the data is transferred to storage.
Note: Symantec recommends that you do not use the NetBackup for Oracle Template Wizard to implement RAC backups. Templates do not provide the functionality that is needed to ensure that RMAN is started on only one host or that it handle load balancing across several hosts. Start RMAN by using a backup script or an Oracle launch mechanism.
Configure the policy to specify the failover vipname as the client name. The automatic schedule then runs the backup script on a host that is currently operational. The backup script or an identical copy must be accessible to all hosts in the cluster. The clustered file system is a good location. Configure the backup script so that RMAN provides to NetBackup the same client name, regardless of the active host. The failover vipname from the policy is ideal since that name is already in the policy. It floats to the active instance-host and ensures successful data transfer, and all the backups are stored under that single client name.
ALLOCATE CHANNEL ... ; SEND 'NB_ORA_CLIENT=$NB_ORA_CLIENT'; BACKUP ... ;
190
Best practices for protecting Oracle RAC with NetBackup RAC backup configurations
You can also use the failover vipname from the policy instead of $NB_ORA_CLIENT.
The NetBackup master server configuration must allow the physical host names access to all of the backup images.
cd /usr/openv/netbackup/db/altnames echo "hostname1" >> hostname1 echo "vipname1" >> hostname1 echo "hostname2" >> hostname1 echo "vipname2" >> hostname1 echo "failover_vipname" >> hostname1 cp hostname1 hostname2
If the client hosts use REQUIRED_INTERFACE or another means to force NetBackup to use the IP addresses associated with the vipnames for the outbound user-directed backup requests, then also allow the vipnames to access all of the backup images.
cd /usr/openv/netbackup/db/altnames cp hostname1 vipname1 cp hostname1 vipname2
The backup script then runs on the active host that currently hosts the failover vipname. RMAN allocates the channels on that host to perform the backup. The Application Backup jobs queue to the failover vipname, and the NetBackup media server connects back to the failover vipname for the data transfer. The backup images are stored under the failover vipname regardless of which host performed the backup. Restores can take place from either host as long as the restore request is configured to SEND 'NB_ORA_CLIENT=failover vipname';
Set up the policy to specify the failover vipname as the client name. Thus, the Automatic schedule executes the backup script on a host that is currently operational.
Best practices for protecting Oracle RAC with NetBackup RAC backup configurations
191
The backup script or an identical copy must be accessible to all hosts in the cluster. The clustered file system is a good location. Do not configure the backup script to send a single value for NB_ORA_CLIENT. The NetBackup media server must connect back to the correct host, which depends on which host originated the user-directed backup request. Select one of the following three methods to accomplish this task: Configure the backup to provide a host specific client name with each backup request using one of the following three options:
Configure RMAN to bind specific channels to specific instances and send specific client names on each channel for backup image storage and for connect-back to the requesting host for the data transfer. Do not use the failover VIP name, because it is active on only one of the hosts.
PARMS='ENV=(NB_ORA_CLIENT=vipname1)' PARMS='ENV=(NB_ORA_CLIENT=vipname2)' PARMS='ENV=(NB_ORA_CLIENT=vipname1)' PARMS='ENV=(NB_ORA_CLIENT=vipname2)' CONNECT='sys/passwd@vipname1'; CONNECT='sys/passwd@vipname2'; CONNECT='sys/passwd@vipname1'; CONNECT='sys/passwd@vipname2';
1 2 3 4
CONFIGURE CHANNEL 1 DEVICE TYPE 'SBT_TAPE' "ENV=(NB_ORA_CLIENT=vipname1)"; CONFIGURE CHANNEL 2 DEVICE TYPE 'SBT_TAPE' "ENV=(NB_ORA_CLIENT=vipname2)"; CONFIGURE CHANNEL 3 DEVICE TYPE 'SBT_TAPE' "ENV=(NB_ORA_CLIENT=vipname1)"; CONFIGURE CHANNEL 4 DEVICE TYPE 'SBT_TAPE' "ENV=(NB_ORA_CLIENT=vipname2)";
By default, the backup uses CLIENT_NAME from the bp.conf file which should be distinct for each host and is typically the physical hostname.
Because CLIENT_NAME or NB_ORA_CLIENT values must differ from the failover vipname in the policy, the NetBackup master server cannot accept the user-directed backup request unless it implements one of the following options. Option A: Modify the existing policy and the backup script to handle multiple client names.
Add both vipnames to the policy, in addition to the failover vipname. Modify the script so that it exits with status 0 if the client name is not the failover vipname.
192
Best practices for protecting Oracle RAC with NetBackup RAC backup configurations
Create a second policy to receive the backup requests from RMAN. Set the policy type to be Oracle. Set the policy to contain the VIP, client, or host names as configured for NB_ORA_CLIENT or CLIENT_NAME in the previous step. The Application Backup schedule must have an open window to accept the backups. The policy does not need a backup script or an automatic schedule. Instead of the policy with the automatic schedule, configure the backup script to provide the name of this policy with each user-directed backup request:
ALLOCATE CHANNEL...PARMS='ENV=(NB_ORA_POLICY=<second_policy_name>)'; or SEND 'NB_ORA_POLICY=<second_policy_name>';
The NetBackup master server configuration must allow the physical host names access to the backup images that are stored under the failover vipnames as follows:
cd /usr/openv/netbackup/db/altnames echo "failover_vipname" >> hostname1 echo "hostname1" >> hostname1 echo "vipname1" >> hostname1 echo "hostname2" >> hostname1 echo "vipname2" >> hostname1 cp hostname1 hostname2
If the client hosts use REQUIRED_INTERFACE or another means to force NetBackup to use the IP addresses associated with the vipnames for the outbound user-directed backup requests, then also allow the vipnames to access all of the backup images.
cd /usr/openv/netbackup/db/altnames cp hostname1 vipname1 cp hostname1 vipname2
For Option A, the NetBackup scheduler starts three automatic jobs, and each runs the backup script (two of them on the same host). The two executions of the backup script that receive the vipnames exit immediately with status 0 to avoid a redundant backup and any retries. The third execution of the backup script that receives the failover_vipname, starts RMAN. RMAN then sends the data for backup
Best practices for protecting Oracle RAC with NetBackup RAC backup configurations
193
by using the appropriate client name for the instance-host. NetBackup stores the backup images under the initiating policy by using both client names. For Option B, the first policy runs the backup script by using the failover vipname. RMAN sends the name of the second policy and the configured client names for each channel with the user-directed request from each host. The second policy stores the backup images by using both client names. Either client can initiate a restore. RMAN must be configured with 'SET AUTOLOCATE ON;' to request the backupset pieces from the appropriate instance-host that performed the backup. Alternatively, you can restore from either host-instance if you configure each restore request to include the correct client name used at the time the backupset piece was transferred to storage.
SEND 'NB_ORA_CLIENT=client_name_used_by_backup'
The policy specifies client names for both hosts, either hostname1 and hostname2, or vipname1 and vipname2 to ensure that the backup is attempted on a host which is currently operational. The backup script must be accessible to both hosts in the cluster, the clustered file system makes a good location. The backup script should be customized so that it starts RMAN on exactly one of the clients. If executed on the primary, then start RMAN and perform the backup. If executed on the secondary and the primary is up, then exit with status 0 so that the NetBackup scheduler does not retry this client. If executed on the secondary and the primary is down, then start RMAN and perform the backup. You can build the script customization around a tnsping to the primary or even a query of the database to see if the other instance is open and able to perform the backup.
194
Best practices for protecting Oracle RAC with NetBackup RAC backup configurations
$ select INST_ID,STATUS,STARTUP_TIME, HOST_NAME from gv$instance; INST_ID STATUS STARTUP_T HOST_NAM ---------- ------------ --------- --------1 OPEN 13-JAN-09 vipname1 2 OPEN 13-JAN-09 vipname2
Each user-directed backup request must use a client name which allows the NetBackup media server to connect back to the correct host for the data transfer. By default, the backup uses the CLIENT_NAME from the bp.conf file which will be distinct for each host. A better solution is to configure RMAN to provide the appropriate client name from the policy as follows:
SEND 'NB_ORA_CLIENT=$NB_ORA_CLIENT';
Configure the NetBackup master server to give the physical host names access to all of the backup images.
cd /usr/openv/netbackup/db/altnames echo "hostname1" >> hostname1 echo "vipname1" >> hostname1 echo "hostname2" >> hostname1 echo "vipname2" >> hostname1 cp hostname1 hostname2
If REQUIRED_INTERFACE or another means is used on the client hosts to force NetBackup to use the IP addresses associated with the vip names for the outbound user-directed backup requests, then the NetBackup master configuration must be extended in the reverse direction.
cd /usr/openv/netbackup/db/altnames cp hostname1 vipname1 cp hostname1 vipname2
Either client can initiate a restore. RMAN must be configured with 'SET AUTOLOCATE ON;' to request the backupset pieces from the appropriate instance-host that performed the backup. Alternatively, you can restore from either host-instance if you configure each restore request to include the correct client name that is used at the time the backupset piece was transferred to storage.
SEND 'NB_ORA_CLIENT=client_name_used_by_backup'
Best practices for protecting Oracle RAC with NetBackup RAC backup configurations
195
Failover VIP is not available, and backup is load balanced, one policy with custom script
A load-balanced backup without a failover vipname must overcome the combined challenges of the preceding configurations. Because a failover vipname does not exist, the NetBackup scheduler must attempt to execute the backup script on both hosts and the script must start RMAN on only one of the hosts. Because RMAN may allocate channels on both instances, the user-directed requests must present host specific names so that the connect-back from the NetBackup media server is able to retrieve the data from the correct host.
The policy should specify both client names, either hostname1 and hostname2 or vipname1 and vipname2, to ensure that the backup script is executed on a host which is currently operational. The backup script must be accessible to both hosts in the cluster. The clustered file system makes a good location. The backup script should be customized so that it starts RMAN on exactly one of the clients. If executed on the primary, then start RMAN and perform the backup. If executed on the secondary and the primary is up, then exit with status 0 so that the NetBackup scheduler does not retry this client. If executed on the secondary and the primary is down, then start RMAN and perform the backup. The script customization could be built around a tnsping to the primary or even a query of the database to see if the other instance is open and able to perform the backup, e.g.
$ select INST_ID,STATUS,STARTUP_TIME, HOST_NAME from gv$instance; INST_ID STATUS STARTUP_T HOST_NAM ---------- ------------ --------- --------1 OPEN 13-JAN-09 vipname1 2 OPEN 13-JAN-09 vipname2
The backup script must not be configured to send a single value for NB_ORA_CLIENT because the NetBackup media server needs to connect back to the correct host depending on which host originated the user-directed backup request. Configure the backup to provide a host specific client name with each backup request using one of the following three options:
Configure RMAN to bind specific channels to specific instances and send specific client names on each channel for backup image storage and for connect-back to the requesting host for the data transfer. Do not use the failover VIP name, because it is active on only one of the hosts.
196
Best practices for protecting Oracle RAC with NetBackup RAC backup configurations
1 2 3 4
CONFIGURE CHANNEL 1 DEVICE TYPE 'SBT_TAPE' "ENV=(NB_ORA_CLIENT=vipname1)"; CONFIGURE CHANNEL 2 DEVICE TYPE 'SBT_TAPE' "ENV=(NB_ORA_CLIENT=vipname2)"; CONFIGURE CHANNEL 3 DEVICE TYPE 'SBT_TAPE' "ENV=(NB_ORA_CLIENT=vipname1)"; CONFIGURE CHANNEL 4 DEVICE TYPE 'SBT_TAPE' "ENV=(NB_ORA_CLIENT=vipname2)";
By default, the backup uses CLIENT_NAME from the bp.conf file which should be distinct for each host and is typically the physical hostname.
Configure the NetBackup master server to allow the physical host names access to all of the backup images.
cd /usr/opnv/netbackup/db/altnames echo "hostname1" >> hostname1 echo "vipname1" >> hostname1 echo "hostname2" >> hostname1 echo "vipname2" >> hostname1 cp hostname1 hostname2
If REQUIRED_INTERFACE or another means is used on the client hosts to force NetBackup to use the IP addresses associated with the vip names for the outbound user-directed backup requests, then the NetBackup master configuration must be extended in the reverse direction.
cd /usr/openv/netbackup/db/altnames cp hostname1 vipname1 cp hostname1 vipname2
The net result is that the backup script runs on all of the currently active hosts but only starts RMAN on one host. RMAN allocates channels across the hosts for load balancing. The user-directed backup requests include a NB_ORA_CLIENT or CLIENT_NAME specific to the requesting host and which matches the policy. The connect-back for data transfer and the backup image are stored under that name.
Best practices for protecting Oracle RAC with NetBackup RAC backup configurations
197
Either client can initiate a restore and RMAN can be configured with 'SET AUTOLOCATE ON;' to request the backupset pieces from the appropriate instance/host that performed the backup. Alternatively, restores can take place from either host or instance as long as the restore request is configured to specify the same client name as used at the time of the backup.
SEND 'NB_ORA_CLIENT=client_name_used_by_backup';
Failover VIP is not available and backup is load balanced, simple script with manual policy failover
Some implementations of RAC (Linux/Windows) do not include a failover VIP. On sites which do not need a robust backup script that determines the active instance in realtime, use the following configuration to manually initiate a backup from the secondary host when the primary host is down.
Create a first Oracle policy with an Application Backup schedule to receive the backup images from both hosts. Configure both vipnames or host names as clients in the policy. Do not configure an Automatic Backup schedule or a Backup Selection (script). Create a second Oracle policy to execute the backup script on the primary host. Configure the vipname or host name of the primary host in the policy. Configure the pathname to the backup script in the policy. Create an Automatic Backup schedule with an open window in the policy. Create a third Oracle policy that can be used to manually execute the backup script on the secondary host when the primary host is unavailable. Configure the vipname or host name of the secondary host in the policy. Configure the pathname to the backup script in the policy. Create an Automatic Backup schedule without an open window in the policy. The backup script must be accessible to both hosts in the cluster, the clustered file system makes a good location. Configure the backup to provide a host specific client name with each backup request using one of the following three options:
Configure RMAN to bind specific channels to specific instances and send specific client names on each channel for backup image storage and for connect-back to the requesting host for the data transfer. Do not use the failover VIP name, because it is active on only one of the hosts.
PARMS='ENV=(NB_ORA_CLIENT=vipname1)' PARMS='ENV=(NB_ORA_CLIENT=vipname2)' PARMS='ENV=(NB_ORA_CLIENT=vipname1)' PARMS='ENV=(NB_ORA_CLIENT=vipname2)' CONNECT='sys/passwd@vipname1'; CONNECT='sys/passwd@vipname2'; CONNECT='sys/passwd@vipname1'; CONNECT='sys/passwd@vipname2';
1 2 3 4
198
Best practices for protecting Oracle RAC with NetBackup RAC backup configurations
CONFIGURE CHANNEL 1 DEVICE TYPE 'SBT_TAPE' "ENV=(NB_ORA_CLIENT=vipname1)"; CONFIGURE CHANNEL 2 DEVICE TYPE 'SBT_TAPE' "ENV=(NB_ORA_CLIENT=vipname2)"; CONFIGURE CHANNEL 3 DEVICE TYPE 'SBT_TAPE' "ENV=(NB_ORA_CLIENT=vipname1)"; CONFIGURE CHANNEL 4 DEVICE TYPE 'SBT_TAPE' "ENV=(NB_ORA_CLIENT=vipname2)";
By default, the backup uses CLIENT_NAME from the bp.conf file which should be distinct for each host and is typically the physical hostname.
Configure the NetBackup master server to allow the physical host names access to all of the backup images.
cd /usr/opnv/netbackup/db/altnames echo "hostname1" >> hostname1 echo "vipname1" >> hostname1 echo "hostname2" >> hostname1 echo "vipname2" >> hostname1 cp hostname1 hostname2
If REQUIRED_INTERFACE or another means is being utilized on the client hosts to force NetBackup to use the IP addresses associated with the vipnames for the outbound user-directed backup requests, then also let the vipnames access all of the backup images.
cd /usr/openv/netbackup/db/altnames cp hostname1 vipname1 cp hostname1 vipname2
The second policy executes the backup script on the primary host when it is scheduled. RMAN starts the backup process on all of the hosts, and they send back the appropriate NB_ORA_CLIENT or CLIENT_NAME for that host. If the primary is down, initiate the secondary policy manually from the NetBackup master server and perform a similar backup. You can restore from either host or instance if either of these conditions is true: The 'SET AUTOLOCATE ON'; is enabled for the instance or the restore request is configured to specify the same client name as used when the backupset piece was transferred to storage.
SEND 'NB_ORA_CLIENT=client_name_used_by_backup';
Best practices for protecting Oracle RAC with NetBackup Catalog considerations
199
Catalog considerations
If virtual names are available to be used with NB_ORA_CLIENT, then the following technique can be used to simplify catalog maintenance and restores. Before performing the initial backup of the RAC cluster, create a single directory in the NetBackup image database to hold the backup images for all the client hosts and then create symbolic links to that directory for each of the virtual names. If a failover_vipname exists, it is the preferred name for this directory.
cd /usr/openv/netbackup/db/images mkdir racname ln -s racname vipname1 ln -s racname vipname2
In this configuration, the backup from each host via a virtual name will be placed into the common directory. Subsequent restore and maintenance functions can than use either virtual name to access all the images. In addition, if altnames is configured appropriately, the common directory name can be used as a client name for alternate client restores with or without AUTOLOCATE enabled.
cd /usr/openv/netbackup/db/altnames echo "racname" >> hostname1 echo "racname" >> hostname2 echo "racname" >> redirected_client SEND 'NB_ORA_CLIENT=racname';
Note: Use this technique only when virtual names for the instances are available. If you use physical names, the backup images from standard backups are mixed with the Oracle backup images within a single image directory, resulting in two potential problems. First, either host may restore the files that normally reside only on the other host. Second, if the same file exists on both hosts but with different content, select the correct backup image from which to restore. A similar configuration is possible with NTFS on a Windows master server (Windows 2000 and later) using junctions in place of symbolic links.
200
Best practices for protecting Oracle RAC with NetBackup Catalog considerations
Appendix
About script-based block-level incremental (BLI) backups without RMAN Script-based BLI backup overview Installation requirements Configuring script-based BLI backups Performing backups and restores Troubleshooting
202
Script-based block-level incremental (BLI) backups without RMAN Script-based BLI backup overview
Terms
Table C-1 contains terms that might be new to you. Table C-1 Term
cold database backup
Script-based block-level incremental (BLI) backups without RMAN Script-based BLI backup overview
203
204
the media recovery part of the database recovery takes very little time. Moreover, because you have a recent backup, the entire recovery is accomplished quickly.
Installation requirements
Verify the following requirements before you begin the installation. To verify the installation requirements
Make sure that the following products are properly installed and configured:
NetBackup 6.5 A supported level of Oracle NetBackup for Oracle 6.5 Veritas Storage Foundation for Oracle
Verify licensing. The products must have valid licenses. To check for licenses, enter the following commands based on your version: For VxFS versions earlier than 3.5:
# vxlicense -p
The command displays all the valid licenses that are installed on the system. If you have valid licenses, the Storage Checkpoint feature and the Veritas Storage Foundation for Oracle appear in the list.
Verify that both the NetBackup server (master and media) and client software work properly. Particularly, verify that you can back up and restore typical operating system files from the client.
Script-based block-level incremental (BLI) backups without RMAN Configuring script-based BLI backups
205
If the database is online while the backup is running (a hot database backup or quick freeze database backup using Fulldata Storage Checkpoints), the additional space required by each file system depends on the duration of the backup and the database workload. If the workload is light during the backup or the backup window is relatively short (such as for incremental backups), an additional 10% of the file system size is usually sufficient. If the database has a heavy workload while a full backup is running, the file systems may require more space.
Policy attributes Clients and the files or directories to be backed up on the client Storage unit to use Backup schedules
Most database NetBackup BLI backup policy requirements are the same as for file system backups. Where they exist, the differences or special requirements, are defined in the following sections.
One full backup schedule One incremental backup schedule One user-directed backup schedule for control files and archive logs
Only one backup stream is initiated for each backup policy during automatic backups. To enable multiple backup streams, define multiple policies for the same database. If you have more than one database SID, configure policies for each SID.
206
Script-based block-level incremental (BLI) backups without RMAN Configuring script-based BLI backups
If you intend to do simultaneous backups of more than one SID on the same file system, use Nodata Storage Checkpoints. Set the METHOD to NODATA_CKPT_HOT. For example, to back up file systems F1, F2, F3, and F4 with two streams, you need to define two policies (P1 and P2) with F1 and F2 backed up in P1, and F3 and F4 backed up in P2. If you have one large file system that needs to be backed up with multiple streams, divide the files in the file system between different policies. After a file is added to a policy, it should stay in that policy. If you must rearrange the file list, do so only prior to a full backup. If you have more than one policy defined for an Oracle instance, the instance is grouped by the NetBackup keyword phrase. Identify one of the policies as the POLICY_IN_CONTROL in the NetBackup notify scripts. This policy performs database shutdowns and restarts. All policies with the same keyword phrase need to be configured to start simultaneously. Caution: Care must be taken when specifying the keyword phrase. A multistream backup is attempted if the backup process finds more than one policy with the following characteristics: each policy has the BLI attribute set, each policy is active, each policy contains the same client, and each policy has an identical keyword phrase.
Caution: Typical failure status is "74 - timeout waiting for bpstart_notify to complete.
Caution: "See Troubleshooting on page 220. You can check the file systems on the backup client to see if they are included in one of the NetBackup policies on the server. To see if you need to add any new file systems to the NetBackup policies, run the following commands from the server on a regular basis, perhaps as a cron(1) job:
# cd /usr/openv/netbackup/bin/goodies/ # ./check_coverage -coverage -client mars -mailid \nbadmin
The preceding command generates the following output and mails it to the specified mailid:
File System Backup Coverage Report (UNIX only) ----------------------------------------------Key: * - Policy is not active UNCOVERED - Mount Point not covered by an active policy
Script-based block-level incremental (BLI) backups without RMAN Configuring script-based BLI backups
207
MULTIPLE
CLIENT: mars Mount Point ----------/ /home /oradata1 /oradata2 /oradata3 /opt /oracle /stand /usr /var
Device -----/dev/vg00/lvol3 /dev/vg00/lvol5 /dev/dsk/c1t0d0 /dev/dsk/c1t0d0 /dev/nbuvg/nbuvol /dev/vg00/lvol6 /dev/vg00/oracle /dev/vg00/lvol1 /dev/vg00/lvol7 /dev/vg00/lvol8
Backed Up By Policy ------------------production_servers production_servers block_incr1 block_incr1 UNCOVERED production_servers production_servers production_servers production_servers production_servers
Notes -----
If there is an UNCOVERED file system that is used by Oracle, add it to one of the NetBackup policies so that all the necessary file systems are backed up at the same time. Note: After a file system is added to a policy, it is a good idea to keep the file system in that policy. If you change the policy, NetBackup performs a full backup the next time backups are run even if an incremental backup is requested.
Policy attributes
NetBackup applies policy attribute values when it backs up files. The following attributes must be set for BLI backup:
Policy Type Perform block level incremental backups Set to Standard. Select to enable BLI backups. If the BLI attribute is not enabled, NetBackup uses the standard method to back up the files in the file list. Set so that the BLI backup policies run before other policies.
Job Priority
208
Script-based block-level incremental (BLI) backups without RMAN Configuring script-based BLI backups
Keyword phrase
Define as the Oracle instance name ($ORACLE_SID) in each of the policies for the same instance. Multistream backups start when all the policies with a particular keyword phrase complete their respective startup scripts. If you have multiple Oracle instances (SIDs) use a separate set of policies for each SID. If the SIDs are backed up simultaneously and any share a common file system for data files, use Nodata Storage Checkpoints. Set the METHOD to NODATA_CKPT_HOT.
Note: Do not change a keyword phrase after it is set in a policy. The keyword phrase is used in naming Storage Checkpoints. Changing the keyword phrase necessitates a full backup even if an incremental backup is requested. The NetBackup Administrators Guide, Volume I describes other policy attributes and how to configure them.
Client list
The client list specifies the clients upon which you configured a BLI backup. For a database backup, specify the name of the machine upon which the database resides. Specify the virtual hostname if clustered.
Script-based block-level incremental (BLI) backups without RMAN Configuring script-based BLI backups
209
log files, or database control files. Do not include the online redo log files in the file list.
Schedules
The NetBackup server starts these schedule types:
Each BLI backup policy must include one full backup schedule and at least one incremental backup schedule. In addition, you must designate one of the BLI backup policies as the POLICY_IN_CONTROL. The policies for each stream must have the same types of schedules. The NetBackup Administrators Guide, Volume I describes other schedule attributes and how to configure them.
Schedule types
You can configure the following types of schedules:
User-directed backup schedule. The user-directed backup schedule encompasses all the days and times when user-directed backups are allowed to occur. Set the backup window as described. See Schedule times on page 209. The policies for each stream must have the same types of schedules. Automatically initiated backup schedules. Include server-initiated backup schedules to specify the days and times for NetBackup to automatically start backups of the files specified in the policy file list. Set the backup window as described. See Schedule times on page 209.
Schedule times
For server-initiated full and incremental backup schedules, set the start times and durations to define the appropriate windows for the backups. Follow the same procedure used to define backup schedules for other policies. For more information on these procedures, see the NetBackup Administrators Guide, Volume I. The backups are started by the scheduler only within the backup window specified. For the POLICY_IN_CONTROL, include in the user-directed backup schedule the time periods when the BLI backup policies complete.
210
Script-based block-level incremental (BLI) backups without RMAN Configuring script-based BLI backups
Retention
Set the retention level and periods to meet user requirements.
Script-based block-level incremental (BLI) backups without RMAN Configuring script-based BLI backups
211
Saturday Schedule: Type: Retention Level: Daily Windows: Sunday Monday Tuesday Wednesday Thursday Friday Saturday
18:00:00 --> userbkup User Backup 3 (one month) 00:00:00 00:00:00 00:00:00 00:00:00 00:00:00 00:00:00 00:00:00 --> --> --> --> --> --> -->
Sunday
06:00:00
In this example, the oracle_backup1 policy backs up all the files in /oradata/oradata1. The policy specifies a weekly full backup, a daily differential incremental backup, and a user-directed backup schedule. The archive logs and the control file are backed up using the user-directed schedule at the completion of the full or incremental backup.
Cold database backup. Set METHOD to SHUTDOWN_BKUP_RESTART. An offline backup where all database files are consistent to the same point in time. For example, when the database was last shutdown using typical methods. The database must stay shut down while the backup is running.
Hot database backup. Set METHOD to ALTER_TABLESPACE. An online backup of an open database. Hot backups are required if the database must be up and running 24 hours a day, 7 days a week.
212
Script-based block-level incremental (BLI) backups without RMAN Configuring script-based BLI backups
Nodata Storage Checkpoint Hot. Set METHOD to NODATA_CKPT_HOT. A backup where the tablespaces are in backup mode for the duration of the backup and a Nodata Storage Checkpoint is used to reduce the amount of file system space consumed. Use this method if all of the following conditions are present:
You are backing up multiple Oracle instances. More than one instance shares the file system. The backup of the instances can overlap in time.
Quick freeze backup. Set METHOD to SHUTDOWN_CKPT_RESTART. A backup where all database files are consistent to the same point in time when the database was last shut down to take a Fulldata Storage Checkpoint. Unlike a cold backup, a quick freeze database backup requires only a brief offline period during the creation of the Fulldata Storage Checkpoint. After the Fulldata Storage Checkpoint is created, the database is online while the backup is running.
If the database is in ARCHIVELOG mode, you can use all four methods to back up the database. If the database is in NOARCHIVELOG mode, you can only select the cold backup or quick freeze backup. When you use the cold and quick freeze database backups, the default shutdown command that you use in the bpstart_notify.oracle_bli script is shutdown or shutdown normal. These commands wait for all users to log off before it initiates the shutdown . In some circumstances, even after all interactive users are logged off, processes such as the Oracle Intelligent Agent (Oracle dbsnmp account) can still be connected to the database, preventing the database shutdown. Attempt to use the default shutdown commands to shut down the database cleanly. Alternatively, you can use shutdown immediate to initiate the database shutdown immediately.
bpstart_notify.POLICY post_checkpoint_notify.POLICY
Script-based block-level incremental (BLI) backups without RMAN Configuring script-based BLI backups
213
bpend_notify.POLICY
This script copies the sample notify script templates to /usr/openv/netbackup/bin and makes the necessary changes based on the information you provide. The notify script templates are located on the local machine in the following location:
/usr/openv/netbackup/ext/db_ext/oracle/samples
The following sections describe the information you need to supply when you run setup_bli_scripts. See the information about how to use the notify scripts to back up your Oracle database. See Manual backups on page 217.
ORACLE_LOGS
214
Script-based block-level incremental (BLI) backups without RMAN Configuring script-based BLI backups
ORACLE_CNTRL
Location to which a copy of the Oracle control file is written so that it can be backed up. sqldba, svrmgrl, or sqlplus command to start up or shut down the database. Path name for the Oracle startup parameter file (INIT.ORA). If you are using an Oracle SPFILE as your parameter file, do not set the ORACLE_INIT environment variable. Path name for the Oracle configuration file (CONFIG.ORA). Some database configurations use the CONFIG.ORA file to specify values for the database parameters that usually do not change. The CONFIG.ORA file can be called by the INIT.ORA file using an include statement.
SQLCMD
ORACLE_INIT
ORACLE_CONFIG
Cold backup. Set METHOD to SHUTDOWN_BKUP_RESTART. NetBackup shuts down the database, backs up the database, and then restarts the database. Hot backup. Set METHOD to ALTER_TABLESPACE. NetBackup uses the alter tablespace begin backup command to change the tablespaces to online backup mode, take a Fulldata Storage Checkpoint of the database file, and then use the alter tablespace end backup command to change the tablespaces back to normal mode. Nodata Storage Checkpoint Hot backup. Set METHOD to NODATA_CKPT_HOT. NetBackup uses the alter tablespace end backup command to change the tablespaces to online backup mode, take a Nodata Storage Checkpoint, and back up the tablespaces while in the backup mode. The tablespaces are taken out of backup mode by using the alter tablespace end backup command when the backup is complete. Quick freeze backup. Set METHOD to SHUTDOWN_CKPT_RESTART. NetBackup shuts down the database, creates the Fulldata Storage Checkpoint, and then restarts the database before the database backup starts.
Script-based block-level incremental (BLI) backups without RMAN Configuring script-based BLI backups
215
You also need to create notify scripts for policy oracle_backup2. The setup_bli_scripts script performs this step automatically.
Please enter the Oracle instance (ORACLE_SID) you want to back up? orac901 If you are using a CONFIG.ORA file, you need to specify where it is, so that it can be backed up. If this does not apply apply to your configuration, hit ENTER to go on. If this does apply to your configuration, specify the file path. Typically this would be:
216
Script-based block-level incremental (BLI) backups without RMAN Configuring script-based BLI backups
/dbhome/oracle/orac901/admin/orac901/pfile/configorac901.ora but this file could not be found. Enter your Oracle config file path or hit ENTER: To back up a copy of the Oracle control file, you need to specify a file path where Oracle can write a copy of the control file. Please enter the file path where Oracle is to write a copy of your control file? /dbhome/oracle/orac901/admin/orac901/pfile/cntrlorac901.ora To back up the Oracle archive logs, you need to specify their location.
Enter the directory path to your Oracle archive logs? /dbhome/oracle/orac901/admin/orac901/arch Do you have more archive log locations? (y/n): n Do you want the output of successful executions of the NetBackup scripts mailed to you? y Please enter the mail address to send it to? [email protected] Do you want the output of unsuccessful executions of the NetBackup scripts mailed to you? y Please enter the mail address to send it to? [email protected] There are 4 backup methods to choose from: ALTER_TABLESPACE - Use alter tablespace begin backup method NODATA_CKPT_HOT - Use alter tablespace begin backup with nodata ckpts SHUTDOWN_CKPT_RESTART - Shutdown, create the ckpt clones, and restart SHUTDOWN_BKUP_RESTART - Shutdown the DB, backup, and then restart If one of the methods requiring DB shutdown are selected, you may experience problems with timeouts if the database can't be shut down in a timely manner. You may want to change the shutdown command in the notify scripts to shutdown immediate, or you may have to increase the BPSTART_TIMEOUT value in the bp.conf file on the master server, or you may want to change the backup method to ALTER_TABLESPACE or NODATA_CKPT_HOT. Note: the default BPSTART_TIMEOUT value is 300 seconds. Do you want to use the ALTER_TABLESPACE method? y You now need to decide on how many NetBackup policies you will have
Script-based block-level incremental (BLI) backups without RMAN Performing backups and restores
217
backing up simultaneously. The first one you enter will be known as the POLICY_IN_CONTROL in the scripts and will perform any needed DB operations. When you create the policies on the NetBackup server, you will have to divide the filesystems between these policies. Please Please Please Please Please Please Please enter enter enter enter enter enter enter the the the the the the the name name name name name name name of of of of of of of the policy that will be the POLICY_IN_CONTROL? BLI_1 another policy or DONE to stop? BLI_2 another policy or DONE to stop? BLI_3 another policy or DONE to stop? BLI_4 another policy or DONE to stop? BLI_5 another policy or DONE to stop? BLI_6 another policy or DONE to stop? DONE
Performing backups
This topic describes how to perform different types of backups with the NetBackup for Oracle agent. Note: You must be the root user to perform all operations using the BLI backup software.
Automatic backups
The best way to back up databases is to set up schedules for automatic backups. See Creating NetBackup policies for script-based BLI backup on page 205.
Manual backups
You can also run an Automatic Backup schedule manually using the NetBackup Administration Console. For information about performing manual backups of schedules, see the NetBackup Administrators Guide, Volume I. To perform a cold (offline) backup, set the environment variable METHOD in the bpstart_notify script on the client to SHUTDOWN_BKUP_RESTART. The bpstart_notify script shuts down the database before the backup begins and the bpend_notify script restarts the database after the backup completes.
218
Script-based block-level incremental (BLI) backups without RMAN Performing backups and restores
To perform a hot (online) backup using Fulldata Storage Checkpoints, make sure the database is running in ARCHIVELOG mode and set the variable METHOD to ALTER_TABLESPACE. The bpstart_notify script changes the tablespaces to online backup mode before the backup begins, and the post_checkpoint_notify script changes the tablespaces back to normal mode after the Fulldata Storage Checkpoints are created. To perform a Nodata Storage Checkpoint Hot (online) backup, make sure the database is running in ARCHIVELOG mode and set the environment variable METHOD in the bpstart_notify script to NODATA_CKPT_HOT. The bpstart_notify script changes the tablespaces to online backup mode before the backup begins. The bpend_notify script changes the tablespaces back to normal mode after the backup completes. To perform a quick freeze backup, set the environment variable METHOD in the bpstart_notify script to SHUTDOWN_CKPT_RESTART. The bpstart_notify script shuts down the database and the post_checkpoint_notify script restarts it immediately after the Fulldata Storage Checkpoints are created. Taking VxFS Fulldata Storage Checkpoints is very fast (within a minute), and with the NetBackup queuing delay for scheduling the backup jobs, the database down time is typically only a few minutes.
20 20 20 20
The preceding example shows that you must include both the symbolic link cust.dbf and the hidden file .cust.dbf in the backup file list. If you want to back up all Quick I/O files in a directory, you can simplify the process by only specifying the directory to be backed up. In this case, both components of each Quick I/O file is properly backed up. In general, you should specify
Script-based block-level incremental (BLI) backups without RMAN Performing backups and restores
219
directories to be backed up unless you only want to back up some, files in those directories.
Restoring backups
Restoring the backup images that a BLI backup creates is no different than restoring the backup images that are created using the default NetBackup configuration. Restoring to any of the incremental backup images requires NetBackup to restore the last full backup image and all the subsequent incremental backups until the specified incremental backup image is restored. NetBackup does this automatically. The media that stored the last full and the subsequent incrementals must be available, or the restore cannot proceed. You can start the restore operations from the NetBackup client by using the Backup, Archive, and Restore interface. To restore the latest copy of each file, select either the files or parent directories with the latest backup date, and click Restore. For more information on restoring, see the NetBackup Backup, Archive, and Restore Getting Started Guide. If the operation is to restore files from an incremental backup image, NetBackup issues multiple restore operations beginning from the last full backup image and the subsequent incremental backup images until the selected date. The activity of multiple restores is logged in the Progress Log. If you plan to restore files backed up by another client or to direct a restore to another client, start the restore from the NetBackup server using the Backup, Archive, and Restore interface. Before you initiate a restore, a backup must have successfully completed or an error occurs during the execution. For Solaris, the restore destination can be a VxFS or UFS file system. The destination file system does not need to support the Storage Checkpoint feature, but to be able to perform BLI backups of the restored data, a VxFS file system with the Storage Checkpoint feature is required. For HP-UX, the restore destination can be a VxFS or HFS file system. The destination file system does not need to support the Storage Checkpoint feature to restore files. However, a VxFS file system with the Storage Checkpoint feature is required to perform BLI backups of the restored data. For AIX, the restore destination can be a VxFS or JFS file system. The destination file system does not need to support the Storage Checkpoint feature to restore files. However, a VxFS file system with the Storage Checkpoint feature is required to perform BLI backups of the restored data. Note that restoring a file causes all blocks in that file to be rewritten. Thus, all the blocks in the file are considered to have been modified. Thus, the first subsequent differential incremental backup and all subsequent cumulative
220
incremental backups back up all of the blocks in the restored file. If you are restoring an entire database or a file system, the first subsequent backup backs up all blocks that are restored. To restore a Quick I/O file, if both the symbolic link and the hidden file already exist, NetBackup restores both components from the backup image. If either one of the two components is missing, or both components are missing, NetBackup creates or overwrites as needed. Oracle database recovery might be necessary after restoring the files. See the Oracle documentation for more information on doing database recovery.
Troubleshooting
This section provides tips on troubleshooting common issues with script-based BLI backups.
Checking logs
NetBackup provides logs on the database backup and restore operations. These logs are useful for finding problems that are associated with those operations.
For more information on debug logs, see the NetBackup Troubleshooting Guide for UNIX and Windows or see the /usr/openv/netbackup/logs/README.debug file.
221
NetBackup reports
In addition to logs, NetBackup provides a set of reports that help isolate problems. One report is All Log Entries on the server. For a description of all reports, see the NetBackup Administrators Guide, Volume I.
Automatically by a NetBackup server using a full schedule or incremental schedule If an error occurs during the start operation, examine the Java reports window for the possible cause of the error.
If the backup or restore starts successfully but eventually fails, one of the following can be the cause:
For more information, see the NetBackup Troubleshooting Guide for UNIX and Windows.
There can be insufficient disk space for the VxFS Fulldata Storage Checkpoints to keep track of changed block information. Check the All Log Entries report for errors. If there is a file system out-of-space condition, increase the size of the file system so it is large enough for Fulldata Storage Checkpoints or use the Nodata Storage Checkpoint Hot backup method. This error does not affect the integrity of the backup images because a full backup of the affected file system occurs after the condition is fixed.
222
If an incremental backup is intended, but the whole file system is backed up instead, one of the following conditions might be present:
Storage Checkpoints that keep track of changes have been removed The Block level incremental attribute is not selected Other errors with a nonzero status code
The most common cause of this problem is the file system removed the Storage Checkpoint that keeps track of the block changes. This action might occur if the file system runs out of space, and there are no volumes available to allocate to the file system. The integrity of the backup images is not affected, because a full backup of the file system occurs at the next backup opportunity after NetBackup detects that a Storage Checkpoint is missing.
Status codes
The status codes and their meanings are as follows:
Status Code 9. An extension package is needed but was not installed. The client does not have the NetBackup binaries required to do BLI backups. Use update_clients on the server to push out new binaries. Also, use vxlicense -p to verify that the Storage Checkpoint feature [83] and the Veritas Storage Foundation for Oracle [100] are installed. Status Code 69. Invalid file list specification. Look for a message such as the following in the error log on the server:
FTL - /oradata is not in a VxFS file system. A block incremental backup of it is not possible.
This indicates that there was an attempt to back up a file system that is not a VxFS file system with the Block level incremental attribute. This error can also occur if the file system is not mounted.
Status Code 73. bpstart_notify failed. When running the notify scripts, the bpstart_notify script exited with a nonzero status code, or the permission bits are set wrong on the bpstart_notify script. The script must have execute permission. If the permission bits are set, check the bpstart_notify_output.ORACLE_SID file in the /usr/openv/netbackup/bin/BLOCK_INCR directory.
Status Code 74. Client timed out waiting for bpstart_notify to complete. Check the BPSTART_TIMEOUT setting on the NetBackup server. The BPSTART_TIMEOUT specified did not allow enough time for the script to complete. The shutdown database operation might be taking too long, or the script might be waiting for other streams to start. Check the
223
bpstart_notify_output.ORACLE_SID file and the post_checkpoint_notify_output.ORACLE_SID file in the /usr/openv/netbackup/bin/BLOCK_INCR directory. Make sure that the policies
and schedules are configured with appropriate multiplexing factors and that the required storage units that allow all streams to start at the same time are configured. Check to see if all needed tape drives are working and available. Make sure that the database is not processing transactions so that the instance cannot be shut down immediately (if you are using one of the backup methods where the database is shut down). Finally, make sure that the priority on the BLI policies is higher than other policies, so they get access to the tape drives before the other policies.
Status Code 75. Client timed out waiting for bpend_notify to complete. Check the BPEND_TIMEOUT setting on the NetBackup server. The BPEND_TIMEOUT specified did not allow enough time for the script to complete. The restart database operation might be taking too long, or the script might be waiting for other streams to call the bpend_notify script. Check the bpend_notify_output.ORACLE_SID file and the post_checkpoint_notify_output.ORACLE_SID file in the /usr/openv/netbackup/bin/BLOCK_INCR directory. Make sure that the policies and schedules are configured with appropriate multiplexing factors and that the required storage units that can allow all streams to be started at the same time are configured. Verify that all needed tape drives are working and available during backup.
Status Code 77. Execution of the specified system command returned a nonzero status code. Check the post_checkpoint_notify_output.KEYWORD file in the /usr/openv/netbackup/bin/BLOCK_INCR directory for the possible cause. The post_checkpoint_notify script exited with a nonzero status code. Status Code 143. Invalid command protocol. Check to see if the Block level incremental policy attribute is selected without a keyword specified. Set the Keyword phrase in the policies to the Oracle instance name ($ORACLE_SID).
224
If the database is not running with a high transaction volume, troubleshoot NetBackup. If the incremental backup takes a long time to finish, it could mean that there are more changed blocks since the last incremental backup. Verify whether the size of the incremental backup image has increased, and consider increasing the frequency of incremental backups. Finally, you can improve the speed at which backup is performed by using multiplexed backups. Assigning multiple policies to the same backup device is helpful when devices are not writing at their maximum capacity.
Database recovery
A BLI backup does not perform automatic database recovery. This process includes restoring the database files from NetBackup images and applying the Oracle redo log files to the database files. Follow the Oracle documentation to perform database recovery after a restore.
Index
Symbols
.xml 101 .xsc 101
B
backup automatic using scripts 86, 99 errors 221 methods 212, 214 methods or types of 211 performing 217 wizard invoking 158 backup media required 33 Backup Selections list adding scripts 56 adding selections 55, 57 adding templates 5657 overview 55 backups manual 76 BFILE_DIRECTORY 113 binaries 162 pushing out 222 BLI Backup restores 219 BLI no RMAN adding policies 205 backup example 210 cold backup 202 goodies directory 206 hot backup 202 improving performance 223 mailid 206 requirements 204 schedule types 209 schedules 203 standard policy type 205 workload 223 Block level incremental 222 block-level incremental backup configuring 155 overview 151
A
ALTER_TABLESPACE 211, 214, 218 API error 168, 171172 libobk module 162 Application Backup schedule configuring 48 for block-level incremental backups 155 overview 48, 50 retention 48 with Snapshot Client 144 archive 19, 27 ARCHIVE_DATE_FROM 108, 113 ARCHIVE_DATE_TO 108, 113 ARCHIVELOG 212, 218 attributes Block level incremental 222 automatic archive 99 automatic backup policy 86, 99 schedule manual backup 87, 99 automatic backup schedule configuring 48 automatic backups 217 Automatic Cumulative Incremental Backup schedule Snapshot Client effects 157 Automatic Differential Incremental Backup schedule overview 50 Snapshot Client effects 157 Automatic Full Backup schedule 4950 Snapshot Client effects 157 with Snapshot Client 144
226
Index
bp.conf 61, 64 troubleshooting 171, 175 BPBACKUP_POLICY 65 BPBACKUP_SCHED 62, 65 bpdbsbora for XML import 111 bpend_notify 213, 223 BPEND_TIMEOUT 223 bphdb log 165 bplist 90 browsing for backups 90 browsing for XML export archives 109 example 90 bporaexp 19, 27, 101, 103 bporaexp64 103 bporaimp 20, 29, 107108 performing a restore 112 bporaimp64 109, 112 bpstart_notify 212, 217 bpstart_notify.oracle_bli 212 BPSTART_TIMEOUT 223 browsing archives 107
commands (continued) reset database 80 restore 84 resync catalog 84 rman execute scripts 98 performing restore 94 script syntax 98 send 70 set duplex 70 switch 84 COMMIT 114 compatibility information 31 CONSISTENT 104 correcting errors 221
D
daemons see processes 165 debug logs 220 accessing 165 enabling 163 in /usr/openv/netbackup/logs 164 troubleshooting with log files 163 DIRECTORY 104, 114 DIRECTORY parameter 103
C
check_coverage 208 client read timeout property 178 CLIENT_NAME 62, 65 CLIENT_READ_TIMEOUT 62, 65 clients list for backup policies 54 command bplist 90 bporaexp 101 commands allocate channel 25 backup 25, 84 bplist 90, 109 bporaexp 19, 27, 103 bporaimp 29, 107, 109 bporexp64 103 change 85 copy 84 crosscheck 82 crosscheck backupset 82 delete expired backupset 84 list 85 register database 80 report 85
E
environment variables 159 environmental variable user-directed backup 89 error checking 87 errors correcting 221 example bplist 90 RMAN script 69 examples parameter files 75 scripts 75 execution log 166
F
failed operation troubleshooting 168, 172 file system growing 222 UNCOVERED 207
Index
227
file-based operations 134 FlashSnap snapshots 148 FROMUSER 108, 114 Fulldata Storage Checkpoint 154
L
libobk shared library module 162 license keys, adding 34 LIST 115 LIST parameters 107 LOG 104, 116 logs NetBackup progress 220
G
Guided Recovery 121 Destination host and login screen 126 Job Details screen 128 metadata 122, 128 Performing a cloning operation 123 Post-clone operations 128 Pre-clone check screen 127 Pre-operation checks 122 Select Control File Backup screen 125 Select Destination Parameters screen 126 Select Master Server screen 124 Select Source Database screen 125 Selection summary screen 127 Troubleshooting 128
M
manual archive 99 manual backups 87, 99, 217 maximum jobs per client 44 multiple copies feature 52, 158 multiplexing overview 16
N
NAME 104, 116 NAS Snapshot 147 NAS_Snapshot 148 NB_ORA_CLIENT 61, 103, 105, 108, 112, 116 NB_ORA_COPY_NUMBER 62 NB_ORA_POLICY 61, 103, 105 NB_ORA_SCHED 61, 103, 105 NB_ORA_SERV 61, 103, 105, 108, 112, 116 NB_PC_ORA_RESTORE variable 150 nbjm scheduling process 165 nbpem scheduling process 165 nbrb scheduling process 165 NetBackup logs and reports 220 NetBackup mode 103 Nodata Storage Checkpoint 153
H
HELP 104, 114 hot backup 211
I
IGNORE_ROWS 115 INIT.ORA 214 installation adding a license key 34 prerequisites in a cluster 33 requirements for NetBackup software 32 instant recovery configuration requirements 142 overview 132 policy configuration 143 restore method 148 see Snapshot Client 132
O
offhost backup. See Snapshot Client configuration 142 configuring 145 overview 132 Oracle environment variables 213 Intelligent Agent 212 Oracle Recovery Manager errors 168 example RMAN script 69 OWNER 105
J
Java interface 43 jbpSA 110
K
KEYWORD 104, 108, 115
228
Index
P
parameter file 2829, 101 parms operand 60 PARTITIONS 105 permission bits 222 point in time rollback 148 policy configuration adding clients 54 attributes 47 backup selections list 55 for databases 46 for Snapshot Client 144, 155 overview 45 schedules 47 testing 76 POLICY_IN_CONTROL 213, 215 post_checkpoint_notify 212, 223 processes log files for NetBackup processes 165 scheduling (nbpem nbjm. See nbrb Progress Log 219 proxy copy 132
retention period for Snapshot Client 158 rman change command 54 RMAN script example 69 robust logging 165 ROW_BUFFER 106, 116
S
schedule automatic backup 86, 99 schedules adding 47 frequency 52 properties 51 properties for Snapshot Client 157 retention for Snapshot Client 158 types of schedules 47 scripts bpend_notify 223 bpstart_notify.oracle_bli 212 cautions for using 51 check_coverage 208 notify 217 RMAN 2324 scheduler 86, 99 XML export 72 SERVER 62, 65 setup_bli_scripts contents of 213 sample of 215 shared library module libobk 162 SHUTDOWN_BKUP_RESTART 211, 214, 217 SHUTDOWN_CKPT_RESTART 212, 214, 218 snapshot backup 131, 142143, 148 configuration 142 configuration requirements 142 database objects included 143 overview 131 policy configuration 143 restore method 148 Snapshot Client configuring policies 143 effect on backup schedules 51 effects on policies and schedules 156 file-based operations 134 overview 131 proxy copy 132
Q
QUERY 106
R
Recovery Wizard use with Snapshot Client 158 redirected restores 95, 118 redo log 209 remote folder button 57 reports 163 See also log files All Log Entries report 167 database operations 161 NetBackup server reports 167 restore 20, 28 to a different client 95, 118 user-directed 111 restore errors 221 RESTORE_SCHEMA_ONLY 116 RESTORE_TO_DIRECTORY 116 restores snapshot rollback 148, 150 with Snapshot Client methods 148, 151
Index
229
Snapshot Client (continued) stream-based operations 133 snapshot rollback 148, 150 SnapVault 150 Storage Checkpoint 153 backup 212 removing 222 stream-based operations 133
X
XML 18 XML export 19 XML Export Wizard 73 XML import 20 XML Import Wizard 110 XML instance 19, 27, 29, 101 XML schema 18, 27, 29, 101
T
TABLES 107108, 117 templates administration 99 advantages over scripts 51 creating for XML export 73 overview 17 XML export 72 testing policy configuration 76 timeout failures minimizing 178 TOUSER 117 transaction logs see archive logs 155
U
UNCOVERED file system 207 Unicode 18 unified logging 165 update_clients 222 user-directed archive 99 user-directed restore 111 USERID 107, 117 UTF-8 18
V
VERBOSE 63, 65 Verifying installation 162 Veritas Storage Foundation 155 VIEWS 107 VxFS_Checkpoint snapshot 148 vxvm snapshot 148
W
Windows interface 43 wizard overview 17 use with Snapshot Client 158