MP29554_Protecting Oracle [1]

Creating A Catalog For RMAN . ..... Recovery Manager (RMAN) catalog installed (Strongly. Recommended). Oracle Databases ...... If ping is unable to connect to the host, add an entry in. /etc/hosts for the ..... Copyright © 2006 CA. All rights ...
2MB taille 200 téléchargements 408 vues
White Paper

Protecting Oracle Databases Using BrightStor ARCserve Backup r11.5 in UNIX and Linux Environments ®

Fredric E. Calev January 2006

®

Table of Contents Introduction ..........................................................................................................................................................................................................3 Requirement Summary ......................................................................................................................................................................................3 Required BrightStor Components ................................................................................................................................................................3 External Software Dependencies ..................................................................................................................................................................3 Oracle Databases Supported ........................................................................................................................................................................3 Hardware ............................................................................................................................................................................................................3 Information Prerequisites ..................................................................................................................................................................................3 Major Differences with r11.1 (and Prior Releases) ........................................................................................................................................3 Implementation Steps ........................................................................................................................................................................................4 Installation (Sample answers are in green, discussion is in blue) ........................................................................................................4 Configuring the BrightStor ARCserve Backup Backup Agent for Oracle ............................................................................................6 Defining a caroot equivalent through the BrightStor ARCserve Backup authentication service ..................................................8 Modifying the Backup Agent configuration file ........................................................................................................................................8 Checking To See If an Oracle Database Is Set For ARCHIVING ..........................................................................................................13 Changing an Oracle Database for ARCHIVING ......................................................................................................................................13 Creating A Catalog For RMAN ....................................................................................................................................................................14 Oracle Database Backup Procedures ............................................................................................................................................................15 Online Procedures ..........................................................................................................................................................................................15 GUI ..................................................................................................................................................................................................................15 Command Line ............................................................................................................................................................................................15 Offline Procedures ..........................................................................................................................................................................................16 GUI..................................................................................................................................................................................................................16 Command Line ............................................................................................................................................................................................16 RMAN in RAC Environments ..........................................................................................................................................................................16 Example RMAN in RAC ................................................................................................................................................................................17 Oracle Database Restore Procedures ............................................................................................................................................................17 Restore Types ..................................................................................................................................................................................................17 Restoring from BrightStor ARCserve Backup r11.5 backups ..................................................................................................................17 GUI Procedure ..............................................................................................................................................................................................17 Command Line Procedures (via RMAN) ..................................................................................................................................................19 Restoring from a backup made using the RMAN command line with r11.5 ..................................................................................19 Troubleshooting Tips ........................................................................................................................................................................................19 Unable to connect to the Oracle Agent host............................................................................................................................................19 The database to be backed up is not listed in the Backup Manager for the proper host..............................................................20 The database to be backed up cannot be browsed from the Backup Manager ..............................................................................20 A backup or restore job fails ......................................................................................................................................................................20 To view the current RMAN configuration files........................................................................................................................................20 Changing the server host name for a Oracle database ........................................................................................................................20 The various components of the Oracle agent log traces/messages in various log files ................................................................21 To have a log of the interaction between the oraclebr/oragentd processes and SQLPlus ............................................................21 When RMAN is called to execute a script, it puts traces into a file called sbtio.log ......................................................................22 Here are some common problems experienced by the users when using the Oracle Agent ......................................................22

2

10. Red Flag Linux Data Center Server 4.0 and 4.1

Introduction

11. Recovery Manager (RMAN) catalog installed (Strongly Recommended)

The intent of this document is to cover the necessary steps to configure and install the BrightStor ARCserve Backup Agent for Oracle along with the configuration of the Oracle databases themselves, so that it can easily be controlled by BrightStor ARCserve for backup and restorations.

Oracle Databases Supported You can use the BrightStor ARCservec Backup Agent for Oracle with the following databases:

The BrightStor ARCserve Backup Agent for Oracle can work in 2 different ways. It can be called through the BrightStor ARCserve Backup graphical interface to access the Oracle files directly, or it can be called through Oracle’s Recovery Manager Software and act as a back end module to send/retrieve data to/from BrightStor ARCserve Backup. The implementation of the BrightStor ARCserve Backup Agent for Oracle is performed in 2 steps:

1. Oracle 8.0.5-6, 8.1.5, 8.1.6, 8.1.7 (These versions of Oracle are not supported on HP-UX Itanium)

The first one consists in installing/ configuring the agent itself, the second one consists in linking the Oracle binaries with a dynamic library included with the Oracle Agent and which allows the Oracle Recovery Manager to interface with the agent. The latter is covered in the document “How to prepare Oracle Databases for Backup by BrightStor ARCserve Backup?”.

Hardware

2. Oracle 9.0.1, 9.0.1.1, 9.2.0 (Only 64 bit versions of Oracle are supported on HP-UX Itanium) 3. Oracle 10.1.0 (10g), 10.2 (10g R2), RAC 9i and 10g (Only 64 bit versions of Oracle are supported on HP-UX Itanium)

1. None Specific

Information Prerequisites 1. Name of the host running the BrightStor ARCserve Backup server, if not local (to be configured for usage with RMAN)

For more information about the usage of the BrightStor ARCserve Backup Agent for Oracle, please consult the “BrightStor ARCserve Backup Agent for Oracle Guide”.

2. Directory where the BrightStor ARCserve Backup server is installed, if installed locally (for usage with RMAN) 3. UNIX username and password to access the host where Oracle is installed (for usage with RMAN)

Requirement Summary

4. value of the $NLS_LANG environment variable as defined in the Oracle environment for localized versions (the default value is “American”)

Required BrightStor Components 1. BrightStor ARCserve Backup r11.5 Manager 2. BrightStor ARCserve Backup r11.5 Common (a.k.a. Universal) Agent

5. The UNIX user who will be running RMAN to submit backup/restore jobs has to be defined as a caroot equivalent through the BrightStor ARCserve Backup authentication service

3. BrightStor ARCserve Backup r11.5 Backup Agent for Oracle

External Software Dependencies

Major Differences with r11.1 (and prior releases)

1. Solaris 8, 9, and 10 SPARC 2. IBM AIX 5L v5.1, v5.2, and v5.3 a. If you are using the Emulex LP9802 FC card or the IBM 6239 FC card with IBM AIX version 5.2, you must install IBM patch 520002 before using BrightStor ARCserve Backup.

1. RMAN is now always used to perform the I/O’s on the Oracle files (except for the parameter files) 2. The backup/restore operations launched through the BrightStor ARCserve Backup GUI use RMAN

3. HP-UX 11.0 and 11.11 PA RISC

3. New Object type for this agent : 46 (instead of 22)

4. HP-UX 11i (version 11.23) 5. Red Hat Enterprise Linux 2.1 and 3.0

4. Many new options proper to RMAN accessible in the Backup and Restore Managers

6. Red Hat Advanced Server 2.1

5. The Oracle agent can now generate and load RMAN scripts

7. SuSE Enterprise Server 7 and 8

6. Backups made with the RMAN command line can now be restored with the BrightStor ARCserve Backup GUI and vice-versa

8. Mircle Linux 2.0 and 2.1 9. Red Flag Linux 3.0 and 3.2

3

7. It is not necessary anymore to define the $CAORA_HOME environment variable before using the RMAN command line 8. The Unix user who will be running RMAN to submit backup/restore jobs has to be defined as a caroot equivalent through the BrightStor ARCserve Backup authentication service

Implementation Steps Installation (Sample answers are in green, discussion is in blue) 1. From the UNIX system, log in as root 2. If the BrightStor ARCserve Backup packages are on CD, mount the CD to an available or newly created directory on your local system. For example: # mount -F cdfs /dev/dsk/c1t2d0 /mnt/cdrom (Note that each UNIX system has a specific procedure for mounting the CD ROM) 3. Go to the directory on the mounted CD. For example: a./cdrom/bab_r11_5_sun564

(For Solaris Sun Systems)

4. Run the following script at the command prompt: a.# ./install 5. After accepting the license agreement and reviewing the installation notes, do the following:

Select either 1 or 2 based on your installation 6. After the message “Processing, Please wait…”, The following will appear:

You should select :8 BrightStor ARCserve Backup for UNIX Agent for Oracle (BABora)

4

7. Please provide the installation directory for BrightStor ARCserve Backupora package(default:/opt/CA):

Please select “y” or (Enter) (default)

8. The following messages will appear:

9. The base Oracle agent installation is now completed.

5

Configuring the BrightStor ARCserve Backup Agent for Oracle After installing the BrightStor ARCserve Backup Agent, you must run the orasetup program to properly configure the Backup Agent. 1. Change to the BrightStor ARCserve Backup Agent home directory (typically /opt/CA/BABoraagt). 2. Enter the following command to run the setup: ./orasetup You should see the following questions and messages: You are prompted for the Backup Agent Home directory. The default setting is the current directory. Otherwise, enter the pathname for the appropriate directory and press Enter.

Next, you are asked if BrightStor ARCserve Backup is installed on this machine. If you are installing the Backup Agent (locally) on a machine with BrightStor ARCserve Backup installed on it, enter y. If you are installing the Backup Agent (remotely) on a different machine from BrightStor ARCserve Backup, enter n, and then press Enter.

You are prompted for the BrightStor ARCserve Backup Home Directory. The default setting is: /opt/CA/BrightStorEB Enter to accept this, or enter the appropriate path

Using a catalog is STRONGLY recommended by Oracle. Not using a catalog limits the possibility of performing point-in-time recovery and makes restoring the control file more difficult If this is not a new installation, you are asked if the existing configuration files should be recreated. If you want to keep your existing instance .cfg and sbt.cfg files, enter n. Note: You can configure the instance .cfg file at anytime, which is used to register new instances of Oracle or to make modifications

6

You are now asked to provide the Oracle instace id to be used by the Backup Agent (i.e. Database 1, Database 2) When finished, press Enter.

Next, you are asked for the Oracle home directory. Press enter to use the default location.

Second database, etc....

When finished, press Enter

Enter the number of days the Oracle agentlog (report) files should be kept. If you do not want them to be deleted automatically, enter 0. Enter the number of days the Recovery Manager Scripts files should be kept. If you do not want them to be deleted automatically, enter 0.

3. Enter the name of a UNIX user who can connect to this system [oracle]. 4. Enter the password of that user.

Note: The orasetup script creates two configuration files: instance.cfg and sbt.cfg. If these files already exist when running orasetup and you do not want to overwrite them, the instance.cfg file remains unchanged and orasetup creates sbt.cfg.tmpl as a template file. You can then use this template file to manually adjust the sbt.cfg file. If you select the option to overwrite the configuration file, both instance.cfg and sbt.cfg will be created.

7

Defining a caroot Equivalent Through the BrightStor ARCserve Backup Authentication Service

The following is a sample of the contents of the agent.cfg file:

The UNIX user who will be running RMAN to submit backup/restore jobs has to be defined as a caroot equivalent through the BrightStor ARCserve Backup authentication service:

[46] # Oracle Agent NAME OracleAgent VERSION 11.5.0 HOME /opt/CA/BABoraagt #ENV_BAB_HOME=/opt/CA/BrightStorARCserve ENV CAS_ENV_ORACLE_AGENT_HOME=/opt/CA/BABoraagt #ENV CA_ENV_NUM_OF_REST_BUFF= ENV DAYS_ORAGENTD_LOGS_RETAINED=30 ENV DAYS_RMAN_SCRIPTS_RETAINED=30 ENV CAS_INITIATED=1 ENV ORACLE_SHUTDOWN_TYPE=immediate ENV NLS_LANG=American ENV NLS_DATE_FORMAT=MM/DD/YYYY/HH24:MI:SS LD_LIBRARY_PATH=/opt/CA/BABcmagt:/usr/lib:/opt/CA/B ABoraagt:/opt/CA/BABoraagt /lib:/opt/CA/CAlib:$LD_LIBRARY_PATH BROWSER oraclebr AGENT oragentd

1. ca_auth –equiv add caroot (run on BrightStor ARCserve Backup server host) This is how to create a oracle user on Brightstor ARCserve Backup server: # ca_auth –equiv add oracle hostserver caroot or 2. ca_auth –cahost -equiv add caroot caroot (run on client host) This is how to create a oracle user on local machine equivalent to caroot on remote machine: 1. Find out who you are by issuing following command:

The CA_ENV_NUM_OF_REST_BUFF parameter lets you modify performance for restore operations. Since optimal values may vary depending on environments and host loads, modify this parameter with care.

# su - oracle $ ca_auth -equiv whoami (You should get "oracle@localmachine") 2. Now this user should be equivalent to caroot on the remotemachine, So issue following command:

If you want to modify the number of days that the Oracle agent logs are kept, update the DAYS_ORAGENTD_LOGS_RETAINED variable accordingly (/opt/CA/BABoraagt/logs directory). Using the value 0 prevents the Oracle agent logs from being removed.

$ ca_auth -cahost remotemachine -equiv add oracle localmachine caroot caroot "remotecarootpassword"

Modifying the Backup Agent Configuration File

If you want to modify the number of days that the Oracle agent RMAN scripts are kept, update the DAYS_RMAN_SCRIPTS_RETAINED variable accordingly (/opt/CA/BABoraagt/rman_scripts directory). Using the value 0 prevents the Oracle agent logs from being removed.

The Backup Agent configuration file “agent.cfg” is located in the Common Agent home directory and supplies the default information used when running orasetup. It also supplies default information for each sub-agent (Backup and Client Agent) installed on your system. Information includes the Oracle home directory, username, and password of the Oracle Recovery Manager. Additionally, it supplies the NLS_LANG and NLS_DATE_FORMAT information.

You should not manually change the settings for any of the different home directories for the Recovery Manager listed in the agent.cfg file. To change these settings, rerun the orasetup program, enter the new information, and reregister it. If Oracle has been configured for a language other than English, make sure that NLS_LANG is set to the proper value. The value specified for this parameter should be the same one defined in the environment of the oracle user.

8

You can also use the configuration file to select the type of shutdown to be performed when an offline operation is required on an Oracle database. The supported values are normal, immediate, and abort. Once the BrightStor ARCserve Backup Agent for Oracle is installed, you need to start the Common Agent (if it is not already running). This is typically done by issuing the command ‘caagent start’. If the Common Agent is already up and running then you need to restart it by issuing the commands ‘caagent stop’ followed by ‘caagent start’ or simply by issuing the command ‘caagent update’. To see if the BrightStor ARCserve Backup Agent for Oracle is properly registered and enabled, issue the command ‘caagent list’. You should see: Obj_type

Name

Version

Status

0

BABagntux

11.5.0

ENABLED

46

OracleAgent 11.5.0

ENABLED

Enter the name and IP of the Oracle Agent host. Make sure that you select UNIX/Linux as the OS Type value. This will register the host within the BrightStor ARCserve Backup database. To verify that the host has been properly registered and the Oracle Agent properly configured, open the Backup Manager and select the Source tab. Expand the UNIX Agents node on the tree. This should list the newly configured Oracle Agent host with a green selection box next to its name as seen below:

Adding an Oracle Agent Client After the BrightStor ARCserve Backup Agent for Oracle has been installed and configured, the host must be registered within the BrightStor ARCserve Backup database if it was not already done. This registration can be done using the BrightStor ARCserve Backup GUI or the command line. Before proceeding, please ensure that all the BrightStor ARCserve Backup Services are up and running. This can be done by issuing the ‘cstart’ command. To register the Oracle Agent host from the command line, run the following command on the BrightStor ARCserve Backup server host: ca_dbmgr –client add [-ip ] –os UNIX To register the Oracle Agent host from the BrightStor ARCserve Backup GUI, please start the Database Manager and select the Clients tab.

Expanding the Oracle Agent host will pop-up a Login Dialog Box:

Click on the Add button to add a new client. This will pop an “Add Client” dialog box.

9

Enter the correct user name and password to connect to the Oracle Agent host and press OK. This should list the files and databases on that host. You should see the database names that have been configured in the instance.cfg file:

• SBT_PASSWORD —Password for the UNIX user who can connect to the host where the BrightStor ARCserve Backup Agent for Oracle runs. • SBT_TIMEOUT —Number of minutes that the Oracle Recovery Manager waits for the BrightStor ARCserve Backup Agent for Oracle to be started before timing out. • SBT_DESTGROUP — Name of the BrightStor ARCserve Backup destination device group to use for a backup operation. When this is not specified, any available device group is used. Note: This is a backup parameter only. • SBT_DESTTAPE —Name of the BrightStor ARCserve Backup destination media name to use for a backup operation. When not specified, any available media is used. Note: This is a backup parameter only.

Modifying the sbt.cfg Configuration File (When Using the Oracle Recovery Manager) The SBT interface is the API defined by Oracle that allows BrightStor ARCserve Backup to provide backup and restore capabilities to RMAN. The BrightStor ARCserve Backup Agent for Oracle uses the SBT 1.1 or the SBT 2.0 interface. These interfaces use the BrightStor ARCserve Backup ca_backup and ca_restore commands to initiate backup and restore operations.

• SBT_MEDIAPOOL —Name of the BrightStor ARCserve Backup destination media pool to use for a backup operation. By default, none is specified and no media pool is used. Note: This is a backup parameter only. • SBT_TAPEFORMAT [tar | cpio | BAB]—Specifies the tape format of the backup job. The BrightStor ARCserve Backup, tar, and cpio, tape formats are all supported.

To interact with the BrightStor ARCserve Backup Agent, RMAN uses the sbt.cfg parameter file. This file contains various user-defined parameters that are passed to BrightStor ARCserve Backup when submitting backup and restore jobs via the ca_backup and ca_restore commands.

Note: This is a backup parameter only. Note: The Oracle agent only supports BrightStor ARCserve Backup format for backing up Oracle Databases. • SBT_LOGFILE —Records activities during the backup job to the specified filename.

The orasetup script creates the initial sbt.cfg configuration file during BrightStor ARCserve Backup Agent for Oracle setup. The script prompts you to enter the name of the host where BrightStor ARCserve Backup is installed, and the name and password of a user who can log in to the host running Oracle.

• SBT_LOGDETAIL —Specifies whether a summary or all activity of the job should be logged in the file specified by the SBT_LOGFILE parameter. • SBT_SNMP —Indicates whether to use the SNMP alert option by the BrightStor ARCserve Backup logger. The default value is 'false'.

Note: The password is automatically encrypted by orasetup and put in the sbt.cfg file (SBT_PASSWORD). If you want to modify this password, you must first execute cas_encr to receive the ASCII encrypted value. Once you receive this value, enter it in the sbt.cfg file. Once the initial sbt.cfg file is created, it is placed in the BrightStor ARCserve Backup Agent home directory. This file includes the following parameters:

• SBT_TNG —Indicates whether to use the CA-Unicenter alert option. The default value is 'false'. • SBT_EMAIL —Sends a copy of the Activity Log to the specified email address. The default is none. • SBT_PRINTER —Sends a copy of the Activity Log to the specified printer. The printer must be set up in the $BAB_HOME/config/caloggerd.cfg configuration file. The default is no printer.

• SBT_HOST —Name of the host where the desired BrightStor ARCserve Backup server runs. • SBT_ORIGINAL_CLIENT_HOST —When restoring data from one host to another, this parameter specifies the name of the original client host.

• SBT_EJECT —Indicates whether the tape should be ejected at the end of the backup operation. The default is 'false'. Note: This is a backup parameter only.

• SBT_USERNAME —Name of a UNIX user who can connect to the host where the BrightStor ARCserve Backup Agent for Oracle runs.

10

• SBT_DESTTAPESUN —Name of the media to use if the job runs on a Sunday and the SBT_DAYOFWEEK parameter is TRUE. If this is not specified, the SBT_DESTTAPE value applies. Note: This is a backup parameter only.

• SBT_TAPEMETHOD —Method that determines how the job should handle the media: – append—Adds the session after the last one on the media. This is the default value.

• SBT_DESTTAPEMON —Name of the media to use if the job runs on a Monday and the SBT_DAYOFWEEK parameter is TRUE. If this is not specified, the SBT_DESTTAPE value applies. Note: This is a backup parameter only.

– owritesameblank—Tries to use the media specified as the SBT_DESTTAPE parameter. If it cannot be used, tries to use a blank media. – owritesameblankany—Tries to use the media specified as the SBT_DESTTAPE parameter. If it cannot be used, tries to use a blank media. If none is available, uses any tape.

• SBT_DESTTAPETUE —Name of the media to use if the job runs on a Tuesday and the SBT_DAYOFWEEK parameter is TRUE. If this is not specified, the SBT_DESTTAPE value applies. Note: This is a backup parameter only.

– owritesameanyblank—Tries to use the media specified as the SBT_DESTTAPE parameter. If it cannot be used, tries to use any other tape. If none is available, tries to use a blank media. Note: This parameter requires the SBT_DESTTAPE or SBT_DESTTAPESUN…SBT_DESTTAPESAT parameters to be set. This is a backup parameter only.

• SBT_DESTTAPEWED —Name of the media to use if the job runs on a Wednesday and the SBT_DAYOFWEEK parameter is TRUE. If this is not specified, the SBT_DESTTAPE value applies. Note: This is a backup parameter only.

• SBT_SPANTAPEMETHOD —Method that determines how the job should handle the media in case of tape spanning:

• SBT_DESTTAPETHU —Name of the media to use if the job runs on a Thursday and the SBT_DAYOFWEEK parameter is TRUE. If this is not specified, the SBT_DESTTAPE value applies. Note: This is a backup parameter only.

– owritesameblank—Tries to use the media specified as the SBT_DESTTAPE parameter. If it cannot be used, tries to use a blank media. This is the default value.

• SBT_DESTTAPEFRI —Name of the media to use if the job runs on a Friday and the SBT_DAYOFWEEK parameter is TRUE. If this is not specified, the SBT_DESTTAPE value applies. Note: This is a backup parameter only.

– owritesameblankany—Tries to use the media specified as the SBT_DESTTAPE parameter. If it cannot be used, tries to use a blank media. If none is available, uses any tape.

• SBT_DESTTAPESAT —Name of the media to use if the job runs on a Saturday and the SBT_DAYOFWEEK parameter is TRUE. If this is not specified, the SBT_DESTTAPE value applies. Note: This is a backup parameter only.

– owritesameanyblank—Tries to use the media specified as the SBT_DESTTAPE parameter. If it cannot be used, tries to use any other tape. If none is available, tries to use a blank media. Note: This is a backup parameter only.

• SBT_MEDIAPOOLSUN —Name of the media pool to use if the job runs on a Sunday and the SBT_DAYOFWEEK parameter is TRUE. If this is not specified, the SBT_MEDIAPOOL value applies. Note: This is a backup parameter only.

• SBT_TAPETIMEOUT —Number of minutes allowed for mounting a media before the job times out. The default value is 5 minutes.

• SBT_MEDIAPOOLMON —Name of the media pool to use if the job runs on a Monday and the SBT_DAYOFWEEK parameter is TRUE. If this is not specified, the SBT_MEDIAPOOL value applies. Note: This is a backup parameter only.

• SBT_SPANTAPETIMEOUT — Number of minutes allowed for mounting a media in case of a tape spanning situation before the job times out. The default value is infinite. • SBT_DAYOFWEEK —Indicates if the destination tape or media pool defined as values for SBT_DESTTAPESUN… SBT_DESTTAPESAT and SBT_MEDIAPOOLSUN … BT_MEDIAPOOLSAT should be used instead of the default values specified for SBT_DESTTAPE and SBT_MEDIAPOOL. Note: This is a backup parameter only.

• SBT_MEDIAPOOLTUE —Name of the media pool to use if the job runs on a Tuesday and the SBT_DAYOFWEEK parameter is TRUE. If this is not specified, the SBT_MEDIAPOOL value applies. Note: This is a backup parameter only.

11

• SBT_MEDIAPOOLWED —Name of the media pool to use if the job runs on a Wednesday and the SBT_DAYOFWEEK parameter is TRUE. If this is not specified, the SBT_MEDIAPOOL value applies. Note: This is a backup parameter only.

• SBT_APPEND_RESTORE_CMDLINE — Arguments and values to append to the ca_restore command line generated by the SBT interface to submit a restore job. This is a generic way of providing parameters that are not supported by the SBT interface.

• SBT_MEDIAPOOLTHU —Name of the media pool to use if the job runs on a Thursday and the SBT_DAYOFWEEK parameter is TRUE. If this is not specified, the SBT_MEDIAPOOL value applies. Note: This is a backup parameter only.

Note: You can also define a parameter as an environment variable, and as a parameter set by the send command in a RMAN script (for Oracle 8i and up using the SBT 2.0 interface). To set a parameter in a RMAN script, do the following:

• SBT_MEDIAPOOLFRI —Name of the media pool to use if the job runs on a Friday and the SBT_DAYOFWEEK parameter is TRUE. If this is not specified, the SBT_MEDIAPOOL value applies. Note: This is a backup parameter only.

run { allocate channel dev1 type ‘sbt_tape’; send “SBT_HOST=myhost”; send “SBT_USERNAME=oracle”; send “SBT_PASSWORD=nobodyknows”; … }

• SBT_MEDIAPOOLSAT —Name of the media pool to use if the job runs on a Saturday and the SBT_DAYOFWEEK parameter is TRUE. If this is not specified, the SBT_MEDIAPOOL value applies. Note: This is a backup parameter only.

If you set a value through a send command in RMAN, this value overrides any value specified in the sbt.cfg file or the equivalent environment variable. If you set a value as an environment variable, it overrides the equivalent value specified in the sbt.cfg file.

• SBT_NB_BLOCKS — Number of blocks of shared memory the SBT interface uses to exchange data with the BrightStor ARCserve Backup Agent for Oracle. This is a tuning parameter and should normally not be modified. The default value provided is 50 blocks. • SBT_APPEND_BACKUP_CMDLINE — Arguments and values to append to the ca_backup command line generated by the SBT interface to submit a backup job. This is a generic way of providing parameters that are not supported by the SBT interface.

12

Checking To See If an Oracle Database Is Set For ARCHIVING The databases must be running in the ‘archivelog’ mode to be supported by the Oracle agent. To check whether a Oracle database is running in ‘archivelog’ mode, do the following: From the UNIX system, log in as root Connect format is: user/password@database as sysdba

Your 1st 2 values should be as follows

Changing an Oracle Database for ARCHIVING The main reason for running in archivelog mode is that one can provide 24-hour availability and guarantee complete data recoverability. It is also necessary to enable ARCHIVELOG mode before one can start to use on-line database backups. NOTE: ARCHIVELOG mode was introduced with Oracle V6, and is essential for database point-in-time recovery. Archiving can be used in combination with on-line and off-line database backups. Oracle uses a server parameter file or “spfile” to store configuration settings that affect the instance. The parameter settings in the starter database are not bad, but you will probably want to make some changes. Unfortunately, you cannot edit the spfile. Instead, you must export the contents of the spfile to a plain text file called a “pfile”. You can then edit the pfile and convert it back to an spfile for use on your starter database. (This might sound confusing, but is actually pretty straightforward.) Another easier method is to use scope=spfile parameter in Sqlplus. The following is an example of using this method to turn on ‘archivelog’ mode: From the UNIX system, log in as root

Connect format is: user/password@database as sysdba

Note – It is recommended that the database should be shutdown and restarted for the parameters (log_archive_*) to take effect.

13

Creating A Catalog For RMAN Set of tables used by RMAN to manage backup and restore operations Using a catalog is STRONGLY recommended by Oracle Not using a catalog limits the possibility of performing point-in-time recovery and makes restoring the control file more difficult. When no catalog is used, RMAN uses the target database control file to contain the information. For obvious security reasons, the RMAN catalog should reside in a separate database. The following steps must be used to create a RMAN catalog: 1. Create a new database named “rman” (One can use “dbca” Database Configuration Assistant to create a new database) Note – ORACLE_SID=rman 2. Create a new tablespace to contain the recovery catalog tables 3. Create a new user who will be the owner of the RMAN catalog 4. Grant the recovery_catalog_owner privilege to this user 5. Start RMAN and create the catalog 6. Register the Oracle database you wish to back up

The following procedure is an example of creating a RMAN catalog: Connect format is: user/password@database as sysdba

format is: user/password

Connect format is: user/password@database

• The Oracle TNS Listener must be configured to allow remote connections between databases: – $ORACLE_HOME/network/admin/listener.ora – $ORACLE_HOME/network/admin/tnsnames.ora • Most of the time the Oracle TNS Configuration has been performed automatically during the database creation. • The target database needs to be able to connect to the database containing the RMAN catalog • The name of the TNS service that points to the database containing the RMAN catalog must appear as the third parameter in an instance.cfg entry . • More information about the RMAN catalog and TNS configuration can be found in the appropriate Oracle manuals.

14

Oracle Advanced Options

Oracle Database Backup Procedures Online Procedures GUI There are now 2 sets of Oracle backup options in the BrightStor ARCserve Backup GUI. They are both accessible when highlighting the database in the Backup Manager: • Oracle Options • Advanced Oracle Options Oracle Options

The user can define their own RMAN script in this location

Command Line RMAN scripts can be handled in 3 different ways: 1. the agent generates the script and calls RMAN to execute it 2. the agent loads a script pre-defined by the user and calls RMAN to execute it 3. the user interactively creates a script during a RMAN session

• Oracle DB User Info – User Name

Generated RMAN scripts

– User Password • The RMAN scripts generated by the Oracle agent are stored in the /opt/CA/BABoraagt/rman_scripts directory

– Database Name • Use an RMAN catalog (Recommended) – Owner Name

• file name : __.rman

– Owner Password

• The RMAN scripts generated by the Oracle agent are retained for the number of days represented by the DAYS_RMAN_SCRIPTS_RETAINED parameter in agent.cfg

• Backup Type – Select Online – Offline • Backup Method

• Each time the Oracle agent runs, it checks for expired RMAN scripts and deletes them

– Full Backup – Incremental Backup

Loading Pre-defined RMAN Scripts

• Incremental Level

• Users can create RMAN scripts and have the Oracle agent load them through the Load RMAN Script option found in the Advanced Oracle Options tab in the Backup and Restore Managers

• Cumulative • Number of Channels (Streams) • Backup Piece Format

• A loaded RMAN script bypasses all other selections made in the BrightStor ARCserve Backup GUI and the agent will simply call RMAN to have this script executed

• Purge Log After Log Backup

• The parameters defined in the /opt/CA/BABoraagt /sbt.cfg file are used

15

Example

Offline Procedures

RMAN script (named mybackup) in location /myscripts/mybackup

Also called a “cold database backup”. RMAN does not support a real offline backup.

Note: 141.202.223.240 is Server IP Address

GUI

run {

Use the same selections as an Online GUI except that you would select “Offline” box in the “Oracle Options”

allocate channel dev1 device type sbt format '%u_%p_%c'

Command Line

parms='SBT_LIBRARY=/opt/CA/BABoraagt/libobk64.s o';

• The database is put in “quiescent” mode: – Not accessible to users

backup full database include current controlfile; – No transactions running sql 'alter system archive log current'; – Allows RMAN to access the database backup archivelog all; – Equivalent to a real offline database release channel dev1; • For the Oracle agent, it works the same way as the online backup, except:

}

– oragentd performs the “shutdown immediate”, and “startup mount” operations before calling RMAN and “alter database open” after having called RMAN

Note - “/myscripts/mybackup” must be placed in Oracle Advanced Options “Load RMAN Script”

• The same Oracle objects handled by an online backup can be managed by this offline backup

Using RMAN Scripts Interactively • The user can run RMAN interactively and type in the RMAN commands directly

RMAN in RAC Environments

• The parameters defined in the /opt/CA/BABoraagt /sbt.cfg file are used

RAC stands for ‘Real Application Cluster’ (Oracle 9i and after). This allows multiple Oracle instances to access the same database.

• This type of backup was also supported with previous releases of the Oracle agent

• If archived logs are to be backed up through channels allocated on remote hosts in the cluster, then the Oracle Agent must be installed on each host part of the cluster

Example rman target system/demo rcvcat rman/rman RMAN> run {

• The RMAN backup will be launched from one of the nodes in the cluster

RMAN> allocate channel dev1 type ‘sbt_tape’;

• The Oracle Listener must be configured on all nodes in the RAC environment to allow RMAN to access any node in the cluster

RMAN> allocate channel dev2 type ‘sbt_tape’; RMAN> backup database format ‘BAB_RMAN_%u_%p_%c’;

• A caroot equivalency must be created within BrightStor ARCserve Backup for the Oracle user of each node part of the cluster

RMAN> release channel dev1; RMAN> release channel dev2; } • In this example, RMAN uses 2 streams to backup the whole database. The ‘sbt_tape’ channel type means that RMAN will use the libobk library to interact with our Oracle agent.

16

Example RMAN in RAC

• It then calls RMAN to execute the script

• BrightStor ARCserve Backup runs on node3 (outside the cluster)

• RMAN determines by itself which backup pieces need to be restored in order to satisfy the restore request

• Database testdb1 runs on node1

• RMAN spawns “child” jobs in order to restore the proper backup pieces

• Database testdb2 runs on node2

• These “child” jobs will spawn new Oracle agent processes, each one restoring one backup piece

Command Line # su - oracle $ rman target system/manager@testdb1 catalog rman/rman@rmandb RMAN> run { RMAN> allocate channel dev1 type ‘sbt_tape’; RMAN> allocate channel dev2 type ‘sbt_tape’ connect ‘system/manager@testdb2’; RMAN> backup database format ‘CA_%u_%p_%c’ channel dev1; RMAN> sql ‘alter system archive log current’; RMAN> backup archivelog all channel dev1; RMAN> backup archivelog all channel dev2; RMAN> release channel dev1; RMAN> release channel dev2; }

IMPORTANT : It is always RMAN that determines which sessions will be restored, not BrightStor ARCserve Backup. BrightStor ARCserve Backup has no knowledge of the way RMAN organizes the data within the backup pieces. • RMAN can be used directly to restore r11.5 backups that were initiated through the BrightStor ARCserve Backup GUI and vice-versa • The control file will be restored only if the “Include Control File” box is checked in the Restore Manager (the control file in the Restore Manager browser is not selectable anymore) • The control file should only be restored when absolutely necessary (if lost or corrupted) • If the control file needs to be restored, the preferred method is to copy one of the existing copies (from the Oracle environment on disk) over the missing one. The copy is always more up-to-date than a backed up control file

Oracle Database Restore Procedures Restore Types The BrightStor ARCserve Backup r11.5 supports these types of restore operations:

GUI Procedure • Restoring from a backup made using the BrightStor ARCserve Backup GUI with r11.5 (either with the GUI or the RMAN command line)

GUI Procedures (Example Screen)

• Restoring from a backup made using the RMAN command line with r11.5 (either with the GUI or the RMAN command line) • Restoring from a Direct Online backup made with the previous version of the agent (through the BrightStor ARCserve Backup GUI only) • Restoring from an offline backup made with the previous version of the agent (through the BrightStor ARCserve Backup GUI only) • Restoring from a backup made with the RMAN command line with a previous version of the Oracle agent (through RMAN only)

Restoring from BrightStor ARCserve Backup r11.5 backups The restore process with the new Oracle agent works similarly to the backup: • The “parent” Oracle agent process is started by BrightStor ARCserve Backup • This Oracle agent process generates an RMAN script that will be used to restore the data chosen by the user along with the selected options

17

resetlogs options which means that a new backup should be made as soon as possible because Oracle has reset the online redo logs

There are 2 sets of Oracle restore options in the BrightStor ARCserve Backup GUI. Both are accessible by highlighting the database name in the Restore Manager:

– For a complete recovery (Recover Until End of Logs) when the control file has not been restored, the database is opened normally and the online redo logs are not reset by Oracle

• Oracle Options • Advanced Oracle Options Restore: Oracle Options

Restore: Advanced Oracle Options

• Oracle DB User Info

• Archived Logs Selection

– User Name

– Do Not Restore (default value)

– User Password

• RMAN restores the data, but does not attempt to perform any recovery at all

• Use an RMAN catalog (Recommended)

• the DBA is responsible for recovering the database before putting it back online

– Owner Name – Owner Password

– Pattern Based

• Number of Channels (Streams)

• Look at the following location for current archive log files:

• Restore From Latest Backup (default value) • Restore From Backup Made On

– I.E. /data/u01/app/oracle/flash_recovery_area/ DEMO/archivelog (SID = DEMO)

• Restore From Backup Tag • Recovery Type

• Pattern

– No Recovery (default value)

– Time Based

– Until the End of the Logs

• Look at the following location for current archive log files:

– Until SCN • SCN Number

– I.E. /data/u01/app/oracle/flash_recovery_area/ DEMO/archivelog (SID = DEMO)

• Until Log Sequence Number – Log Sequence

• From