Go to main content
9/21

# 4 Using Recovery Manager with Oracle Secure Backup

This chapter explains how to use Recovery Manager (RMAN) with Oracle Secure Backup. It assumes that you are familiar with RMAN concepts and operations.

This chapter contains these sections:

- About Recovery Manager and Oracle Secure Backup

- Configuring Oracle Secure Backup for Use with RMAN

- Primary and Subordinate RMAN Backup Jobs

- Performing Backups with RMAN and Oracle Secure Backup

- Performing Recovery with RMAN and Oracle Secure Backup

- RMAN and Oracle Secure Backup Encryption

- RMAN Backup Metadata in Oracle Secure Backup

- Using RMAN and Oracle Secure Backup in an Oracle RAC Environment

See Also:

Oracle Database Backup and Recovery User's Guide for more information on RMAN

## 4.1 About Recovery Manager and Oracle Secure Backup

Oracle Secure Backup serves as a media management layer for RMAN through the SBT interface. Oracle Secure Backup and third-party backup utilities integrate with RMAN through the SBT interface API.

Note:

Information about the Oracle Database and Oracle Enterprise Manager releases with which you can use Oracle Secure Backup is available at `http://www.oracle.com/technology/products/secure-backup/index.html`.

While Oracle Secure Backup supports previous database versions, key functionality has been added beginning with Oracle Database 10g release 2 (10.2). The following integration enhancements are exclusive to Oracle Secure Backup and are not available with other media management products:

- Oracle Database 10g release 2 (10.2)

  - Oracle Enterprise Manager provides a unified interface for RMAN and Oracle Secure Backup. In addition, managing tapes, media servers, and tape devices using Oracle Enterprise Manager is exclusive to Oracle Secure Backup.

  - The Oracle Secure Backup SBT library is the only interface that supports RMAN encrypted backups directly to tape. If you attempt an encrypted RMAN backup using another SBT library, then you encounter the following error message:

        ORA-19916: encrypted backups to tertiary storage require Oracle Secure Backup

  - Unused block compression directly to tape is available only with Oracle Secure Backup.

    If you are backing up to disk or directly to tape using Oracle Secure Backup, then this enables the unused-block optimization. If the backup is directly to tape using a third-party media management product, then this does not have any effect because unused-block optimization directly to tape is available only with Oracle Secure Backup.

- Oracle Database 11g

  - Optimized SBT buffer allocation uses a shared buffer for SBT and tape. This eliminates the copy process from SBT to the tape buffer, which reduces CPU overhead.

  - Enhanced backup of undo tablespace eliminates backup of committed undo, reducing tape consumption and improving performance.

This section contains these topics:

- RMAN Environment

- Database Backups

- Database Restore and Recovery

- Interfaces for Managing Database Backup and Recovery

- RMAN and the Oracle Secure Backup Administrative Domain

- How RMAN Accesses Oracle Secure Backup

### 4.1.1 RMAN Environment

RMAN is a utility that enables you to back up Oracle Database files. The RMAN environment includes the following basic components:

- RMAN client

  The RMAN client program, which is installed automatically with Oracle Database software, initiates database backup and recovery. The RMAN client can back up and recover any Oracle Database files accessible locally or through Oracle Net so long as it meets compatibility requirements.

- RMAN target database

  The RMAN target database is the database that RMAN backs up or restores. The RMAN metadata used for managing backup and recovery is stored in the control file of the target database and optionally in an RMAN recovery catalog.

- RMAN recovery catalog

  The RMAN recovery catalog is an optional database schema that serves as a secondary repository of RMAN metadata. You can create a centralized recovery catalog in a database to store the metadata for multiple target databases.

See Also:

Oracle Database Backup and Recovery User's Guide for more information on RMAN

### 4.1.2 Database Backups

Oracle Secure Backup supplies an SBT interface that RMAN can use to back up database files to tape. Within the Oracle Secure Backup administrative domain, an SBT backup is initiated through the RMAN command line or Oracle Enterprise Manager, while a file-system backup is initiated through the Oracle Secure Backup Web tool or obtool command line.

#### 4.1.2.1 RMAN Backup Sets and Oracle Secure Backup Images

The backup of Oracle Database files performed with RMAN results in a backup set. A backup set is a logical grouping of physical files, each known as a backup piece. For more information on RMAN backup sets and backup pieces, see Oracle Database Backup and Recovery User's Guide.

When you use Oracle Secure Backup to store database backups on tape, each backup piece is treated as one Oracle Secure Backup backup image. Figure 4-1 illustrates the relationship between pieces and images. A single backup image can span multiple tapes. Oracle Secure Backup can write database backup images (RMAN backup pieces) and file-system backup images on the same volume.

Figure 4-1 Backup Sets and Backup Images

Description of "Figure 4-1 Backup Sets and Backup Images"

See Also:

"Volume Sets"

#### 4.1.2.2 Database Backup Storage Selectors

Defining storage parameters for RMAN backups within Oracle Secure Backup can be accomplished by:

- Defining parameters in an RMAN script specific to Oracle Secure Backup

- Defining Oracle Secure Backup database backup storage selectors

Oracle recommends that you define one or more database backup storage selectors to automate the tape storage selection. Use RMAN storage parameter settings only to override the database backup storage selectors in non-recurring backups that require different media selection than included in the backup storage selector.

Oracle Secure Backup uses information encapsulated in a database backup storage selector to interact with RMAN when performing a backup operation. Oracle Secure Backup uses storage selectors to represent backup attributes that identify Oracle Database files.

A database backup storage selector must specify the following

- The database name or DBID that uniquely identifies the database

- The name of the database host

- The name of the media family to use for the RMAN backups

A database backup storage selector can also specify the following:

- The content or type of the backup, for example, whether it is a full backup or an incremental backup

- The copy number of duplexed backups

- Restrictions on which tape device the backup can use

When backing up Oracle Database files, RMAN passes the database name, content type, and copy number to Oracle Secure Backup. Using this information, Oracle Secure Backup determines the corresponding database backup storage selector. This storage selector specifies for Oracle Secure Backup what tape devices, if any, to restrict this backup to and which media family (if any) to use.

You can create multiple database backup storage selectors. For example, you can create one database storage selector for data file backups of all databases in the administrative domain, and another selector for archived log backups of all databases in the administrative domain. You can specify one tape library destination for the data file backups and a different tape library destination for the archived log backups.

Database storage selectors must be unique. With the exception of a wildcard (`*`), a more general setting matches a more specific setting. For example, if you create a storage selector with `--dbname` set to `db_1` and `db_2`, then you cannot create another selector that has `--dbname` set to `db_1` only and has all other attributes identical to those in the first selector. If you create a storage selector that has `--dbname` set to set to all (`*`), however, then you can create another selector that has `--dbname` set to `db_1` and has all other attributes identical to those used for the first selector.

When an RMAN backup job is initiated through its SBT interface, Oracle Secure Backup examines the database backup storage selectors to determine whether a backup storage selector matches the attributes of the backup job. A match occurs when every attribute of a backup storage selector matches the corresponding attribute of the backup job. If multiple storage selectors match the job, then Oracle Secure Backup chooses the selector whose attributes are most specific. For example, a backup storage selector with the database name set to `db_1` matches before a backup storage selector with the database name set to all (`*`).

Oracle Secure Backup maintains storage selectors in the `admin/ssel` subdirectory of the Oracle Secure Backup home on the administrative server.

See Also:

- "Creating a Database Backup Storage Selector in Enterprise Manager"

- "Setting Media Management Parameters in RMAN" explains how media management parameters specified on RMAN channels can override settings in a backup storage selector.

- Oracle Secure Backup Reference to learn about database backup storage selector commands

### 4.1.3 Database Restore and Recovery

A restore operation that you initiate through RMAN is called an Oracle Database restore operation.

See Also:

- "Database Backup Storage Selectors"

- "Performing Recovery with RMAN and Oracle Secure Backup"

### 4.1.4 Interfaces for Managing Database Backup and Recovery

When performing RMAN backup and restore operations with the Oracle Secure Backup SBT interface, you can use the following interfaces:

- RMAN Command-Line Client

- Oracle Enterprise Manager 10g and 11g Database Control

- Oracle Enterprise Manager 10g Grid Control

#### 4.1.4.1 RMAN Command-Line Client

The `rman` executable is located in the `ORACLE_HOME``/bin` directory of a database installation. The RMAN client can run from any Oracle home, regardless of whether the computer containing this home is a member of the Oracle Secure Backup administrative domain. The target database host must be a member of the Oracle Secure Backup administrative domain. The target database uses the Oracle Secure Backup SBT on the target host to communicate with the Oracle Secure Backup administrative domain.

#### 4.1.4.2 Oracle Enterprise Manager 10g and 11g Database Control

You can manage single-instance database operations, including backup and recovery, through the Oracle Enterprise Manager Database Control. The Database Control console, target database, and Oracle Secure Backup administrative server must all be on the same host.

#### 4.1.4.3 Oracle Enterprise Manager 10g Grid Control

You can manage multiple databases with Oracle Enterprise Manager Grid Control. The Grid Control console can run on any database host in the administrative domain. Unlike Oracle Enterprise Manager Database Control, Grid Control is not required to run on the administrative server of the Oracle Secure Backup administrative domain.

You can manage SBT backups of all databases in the Oracle Secure Backup administrative domain through Grid Control. You can create a centralized RMAN recovery catalog in the same database that contains the Grid Control repository.

When you use Grid Control version 10.2.0.2, you can use Oracle Secure Backup on a host that runs an Oracle Database 10g release 1 (10.1) or earlier database if the repository for Enterprise Manager is in an Oracle Database 10g release 2 (10.2) database.

### 4.1.5 RMAN and the Oracle Secure Backup Administrative Domain

This section describes RMAN operations in the following situations:

- Single-Host Administrative Domain

- Multiple-Host Administrative Domain with Database Backups

Single-Host Administrative Domain

In a single-host administrative domain, one host plays the role of administrative server, media server, and client. An Oracle database is installed on this host. Figure 4-2 illustrates a typical single-host scenario.

Figure 4-2 Single-Host Administrative Domain with Database Backups

Description of "Figure 4-2 Single-Host Administrative Domain with Database Backups"

Because the database is installed on the administrative server, you can use Enterprise Manager Database Control console to perform database backup and restore operations involving Oracle Secure Backup.

Note:

This chapter is written from the perspective of the administrator of a single-host administrative domain that is configured like the one in Figure 4-2.

Multiple-Host Administrative Domain with Database Backups

In a multiple-host administrative domain, the administrative server, media server, and client hosts might all be separate, or each database server might also be a media server. The latter arrangement has the advantage of minimizing network-based backup operations. A single administrative domain can include only one administrative server but can include multiple media servers and clients.

Figure 4-3 illustrates a typical multiple-host domain in which each client host runs an Oracle database. In this example, the administrative server and media server do not run databases. The Windows database includes a centralized recovery catalog to store metadata for backups of all databases in the administrative domain.

Figure 4-3 Multiple-Host Administrative Domain

Description of "Figure 4-3 Multiple-Host Administrative Domain"

Because the target databases do not reside on the administrative server, you cannot use Oracle Enterprise Manager Database Control to back them up through the Oracle Secure Backup SBT. You can use Grid Control on a client, however, to initiate SBT operations involving all databases in the administrative domain.

### 4.1.6 How RMAN Accesses Oracle Secure Backup

Regardless of the administrative domain configuration and the front-end interface that you use to manage backup and recovery, the process by which RMAN communicates with the Oracle Secure Backup SBT library is the same. Figure 4-4 displays the basic components of RMAN backup and restore operations that use the Oracle Secure Backup SBT.

Figure 4-4 RMAN and the Oracle Secure Backup SBT Interface

Description of "Figure 4-4 RMAN and the Oracle Secure Backup SBT Interface"

The basic process for RMAN backup and restore operations with Oracle Secure Backup is as follows:

1. An Oracle Secure Backup user starts the RMAN client, either through the command line or the Oracle Enterprise Manager console.

2. The Oracle Secure Backup user allocates an SBT channel and runs an RMAN `BACKUP` or `RESTORE` command.

   When the channel is allocated, a server session starts on the Oracle database.

3. The server session on the database host makes the backup or restore job request through the Oracle Secure Backup SBT library.

4. Oracle Secure Backup creates the backup or restore job and assigns it a unique identifier such as `sbt/15`.

   See Also:

   Oracle Secure Backup Reference for a description of job identifiers

5. For an RMAN backup operation, Oracle Secure Backup immediately tries to reserve and start the appropriate resources. If the resources are unavailable, then Oracle Secure Backup queues the job while it waits for the resources to become available.

   You can control how long a job waits in the queue through:

   - Operations policy `rmanresourcewaittime`

     This policy is set to `forever` by default. Any configuration in a backup storage selector or RMAN parameter overrides this policy.

   - Specifying the `--waittime` option in an `mkssel` or `chssel` command in `obtool`

   - RMAN parameter `OB_RESOURCE_WAIT_TIME`

   See Also:

   - Oracle Secure Backup Reference for more information on the `mkssel` and `chssel` commands

   - "Setting Media Management Parameters in RMAN"

6. For RMAN restore operations, the start time depends on the setting of the `rmanrestorestartdelay` policy in the operations policy class.

7. RMAN creates or restores the backup pieces.

8. For backups, Oracle Secure Backup stores metadata about RMAN backup pieces in the Oracle Secure Backup catalog.

   The Oracle Secure Backup catalog is stored and managed completely separately from the RMAN recovery catalog. Oracle Secure Backup stores each backup piece and corresponding metadata about the piece.

See Also:

Oracle Secure Backup Reference to learn about defaults and policies

## 4.2 Configuring Oracle Secure Backup for Use with RMAN

To configure Oracle Secure Backup for use with RMAN, perform the following steps in Oracle Secure Backup:

1. Configure RMAN access to the Oracle Secure Backup SBT. If you are using Enterprise Manager Database Control, then this step involves registering the administrative server with Enterprise Manager.

   See Also:

   "Configuring RMAN Access to the Oracle Secure Backup SBT Library"

2. Create an Oracle Secure Backup user preauthorized for RMAN operations.

   Note:

   This is a required step. An RMAN backup operation fails without it.

   See Also:

   "Creating a Preauthorized Oracle Secure Backup User"

3. Oracle recommends that you create media families for data files and archived redo logs. If you do not create your own media families, then by default RMAN uses the `RMAN-DEFAULT` media family.

   See Also:

   "Creating Media Families for RMAN Backups"

4. Optionally, configure database backup storage selectors or RMAN media management parameters. These settings give you more fine-grained control over storage selection for backups.

   See Also:

   - "Creating a Database Backup Storage Selector in Enterprise Manager"

   - "Setting Media Management Parameters in RMAN"

You can perform the preceding tasks in any Oracle Secure Backup interface. Where possible, this section explains how to perform these tasks through the Enterprise Manager Database Control console.

See Also:

"Interfaces for Managing Database Backup and Recovery"

### 4.2.1 Configuring RMAN Access to the Oracle Secure Backup SBT Library

You can use Enterprise Manager Database Control to configure RMAN access to Oracle Secure Backup. You need only specify the Oracle Secure Backup home directory. RMAN locates the SBT library automatically.

See Also:

Oracle Secure Backup Installation and Configuration Guide for information on registering an administrative server in Enterprise Manager

By default, RMAN looks in a platform-specific default location for the SBT library. On Linux and UNIX the default library filename is `/lib/libobk.so`, with the extension name varying according to platform: `.so`, `.sl`, `.a`, and so on. On Windows the default library location is `%WINDIR%\System32\orasbt.dll`.

When you install Oracle Secure Backup on Linux and UNIX, the installer automatically copies the SBT library to the `lib` subdirectory of the Oracle Secure Backup home and creates a symbolic link to the library in the `/lib` or `/usr/lib` directory.

By default, RMAN searches the standard path and loads the Oracle Secure Backup SBT library when an SBT channel is allocated.

Note:

You can override the default SBT library location by specifying the library path in the `SBT_LIBRARY` media management parameter when allocating or configuring RMAN channels.

### 4.2.2 Creating a Preauthorized Oracle Secure Backup User

Oracle Secure Backup honors SBT requests only if the Oracle Secure Backup user making the request has been preauthorized for RMAN backup on that host. This preauthorized Oracle Secure Backup user must meet two sets of requirements. First, the preauthorized Oracle Secure Backup user must be mapped to operating system privileges to access the files to be backed up or restored. The preauthorized Oracle Secure Backup user can perform RMAN operations only on the host where it has access to files. Second, the preauthorized Oracle Secure Backup user must also be assigned to an Oracle Secure Backup class possessing the following rights:

- `access Oracle backups` (set to `owner`, `class`, or `all`)

- `perform Oracle backups and restores`

See Also:

Oracle Secure Backup Reference for more information on Oracle Secure Backup rights

Only one Oracle Secure Backup user can be preauthorized for RMAN backup and restore operations on a particular host. A database can have multiple RMAN users that can start backup or restore operations, but Oracle Secure Backup has only one preauthorized Oracle Secure Backup user for that database server.

You can also preauthorize an Oracle Secure Backup user for command-line (`obtool`) operations. This is useful if you use backup and restore scripts.

See Also:

"Assigning Preauthorized Access"

#### 4.2.2.1 How Oracle Secure Backup Preauthorizes SBT Backups

Figure 4-5 illustrates the basic process by which an Oracle Secure Backup user preauthorized for RMAN operations on a particular host submits a backup or restore request to Oracle Secure Backup.

Figure 4-5 Preauthorization for Database Backup and Restore Operations

Description of "Figure 4-5 Preauthorization for Database Backup and Restore Operations"

The process works as follows:

1. When you start RMAN and allocate an SBT channel, Oracle Database starts a server session.

2. The server session uses the SBT library to communicate with the `obproxyd` daemon running locally on its host.

3. The local `obproxyd` daemon determines which operating system user the server session runs under. Assume in this example that the operating system user is named `oracle` and runs on Linux host brhost2.

4. The local `obproxyd` daemon checks the operating system user information with the administrative server `observiced` daemon. If the operating system user on this host and operating system is preauthenticated as an Oracle Secure Backup user, then the login to Oracle Secure Backup is successful.

   For example, assume that the `oracle` operating system user on host brhost2 is preauthorized to run as Oracle Secure Backup user `obuser`. Assume also that `obuser` is a member of the `oracle` class, which is assigned the `perform` `Oracle` `backups` `and` `restores` right by default.

   See Also:

   Oracle Secure Backup Reference for more information on Oracle Secure Backup rights

5. The server session uses the Oracle Secure Backup user to back up or restore files.

   The Oracle Secure Backup operations submitted through the SBT use the operating system user defined by the Oracle Secure Backup user to access the host. In the example shown in Figure 4-5, the backup and restore operations run under the `oracle` operating system account on brhost2.

#### 4.2.2.2 Configuring an RMAN Preauthorization

You can configure a preauthorized Oracle Secure Backup user with required rights to perform backups of Oracle Database files to tape with Oracle Secure Backup during installation of the Oracle Secure Backup software or after installation using either the Oracle Secure Backup Web tool or the `mkuser` command in `obtool`.

To create a preauthorized Oracle Secure Backup user during an Oracle Secure Backup installation on Linux or UNIX, you must set the `obparameters` parameter `create` `preauthorized` `oracle` `user`.

See Also:

Oracle Secure Backup Installation and Configuration Guide for information on configuring `obparameters` for creating a preauthorized `oracle` user

To create a preauthorized Oracle Secure Backup user during an Oracle Secure Backup installation on Windows, you must enable the action for Create "oracle" user when selecting features for the administrative server.

See Also:

Oracle Secure Backup Installation and Configuration Guide for information on administrative server features

To configure a preauthorized Oracle Secure Backup user after installation, use the Web tool or the `mkuser` command in `obtool`. Example 4-1 uses `mkuser` to create an Oracle Secure Backup user named `preauth_user` and assign this user to the `oracle` class. The example uses `--preauth` to map `preauth_user` to the Linux or UNIX user `oracle` on host brhost2. The mapping to an operating system user with access to the files to be backed up or restored is required.

Example 4-1 Preauthorizing an Operating System User to Make RMAN Backups

    mkuser preauth_user --class oracle --preauth brhost2:oracle+rman

See Also:

Oracle Secure Backup Reference to learn about the `mkuser` command

### 4.2.3 Creating Media Families for RMAN Backups

Oracle recommends that you create dedicated media families for use in RMAN operations. If you do not create dedicated RMAN media families, then Oracle Secure Backup uses a default media family.

The default media family for use by RMAN is named `RMAN-DEFAULT`. You cannot delete or rename the `RMAN-DEFAULT` media family, although you can modify some of its attributes through the Oracle Secure Backup Web tool or `obtool`.

See Also:

- "Content-Managed Expiration Policies"

- "Editing or Displaying Media Family Attributes"

It is useful to create different media families for archived redo log and data file backup sets. You can create media families with Enterprise Manager, the Oracle Secure Backup Web tool, or the `mkmf` command in `obtool`.

See Also:

- "Adding a Media Family" for information on adding a media family with Database Control.

- Oracle Secure Backup Reference for complete syntax and semantics for the `obtool` `mkmf` command

When you create a media family, you specify a volume expiration policy that determines when a volume in that media family is eligible to be overwritten and recycled. Volumes in a media family use either a content-managed expiration policy or time-managed expiration policy.

Content-managed volumes can only be used for RMAN operations. You can use time-managed volumes for both RMAN and file-system backup and restore operations. It is possible, therefore, that time-managed volumes could contain a mixture of file-system backups and RMAN backup pieces.

Caution:

If you make RMAN backups to time-managed volumes, then it is possible for a volume to expire and be recycled while the RMAN repository reports a backup piece that was on that volume as available. In this case, you must use the `CROSSCHECK` command in RMAN to resolve the discrepancy.

### 4.2.4 Creating a Database Backup Storage Selector in Enterprise Manager

You can use Oracle Enterprise Manager Database Control to create a database backup storage selector. Database Control gives the selector a system-defined name. To specify the name for the storage selector, use the `mkssel` command in `obtool`.

### 4.2.5 Setting Media Management Parameters in RMAN

If you use Oracle Secure Backup database storage selectors, then you are not required to set media management parameters in RMAN. In some circumstances, however, you might want to override the database storage selectors by setting RMAN parameters.

This section assumes that you are familiar with setting RMAN media management parameters. You can specify media management parameters in RMAN by the following means:

- Environment variables, which are specified with the `ENV` parameter of the `PARMS` option on the `CONFIGURE` or `ALLOCATE` `CHANNEL` commands

- The RMAN `SEND` command

You can use the following Oracle Secure Backup parameters in RMAN backup and restore jobs:

- `OB_MEDIA_FAMILY[_``n``]`

  Use this parameter to define which media backup jobs can use.

- `OB_DEVICE[_``n``]`

  Use this parameter to define which tape drives backups can use.

- `OB_RESOURCE_WAIT_TIME`

  Use this parameter to specify the duration for which a backup or restore job should wait for the required resources to become available.

- `OB_ENCRYPTION`

  Use this parameter to control Oracle Secure Backup encryption behavior. See "Enabling Backup Encryption".

- `OB_RESTORE_DEVICE`

  Use this parameter to specify which tape devices are to be used for a restore operation. If specific devices have not been defined, then Oracle Secure Backup will utilize any available device for the restore operation.

In general, these media management parameters override the settings of matching database backup storage selectors.

See Also:

Oracle Secure Backup Reference to learn about the RMAN media management parameters and their relationship with database backup storage selectors

To set media management parameters in an RMAN database backup:

1. Follow Step 1 through Step 9 in "Performing Backups with RMAN and Oracle Secure Backup".

2. Click Edit RMAN Script.

   The Schedule Customized Backup: Review: Edit RMAN Script page appears.

3. In the main window, modify the script to use media management parameters. For example, assume the backup script is as follows:

       backup device type sbt database include current controlfile;
       backup device type sbt archivelog all not backed up;

   To configure the backup to use the `my_mf` media family, you could modify the script as follows:

       run
       {
         allocate channel c1 device type sbt
           parms 'ENV=(OB_MEDIA_FAMILY=my_mf)';
         backup database include current controlfile;
         backup archivelog all not backed up;
       }

4. Click Submit Job.

   The Status page appears.

## 4.3 Primary and Subordinate RMAN Backup Jobs

When a database backup job is started, Oracle Secure Backup interprets the RMAN commands and creates a subordinate job for the database it includes. All Oracle Secure Backup RMAN backups include at least one subordinate job. But if there are conditions that require separate jobs to be spawned, then Oracle Secure Backup creates multiple subordinate jobs. If you back up two identical copies of the database to separate drives, for example, then two subordinate jobs are generated by the parent job.

The following example shows a database backup and its two subordinate jobs. In this case there are two copies of the backup being written to separate tape drives.

    Recovery Manager: Release 10.2.0.2.0 - Production on Wed Jun 25 12:18:32 2008

    Copyright (c) 1982, 2008, Oracle.  All rights reserved.

    RMAN-06568: connected to target database: TSTVW1 (DBID=1586108579, not open)
    RMAN-06009: using target database control file instead of recovery catalog

    RMAN> run {
    2> set backup COPIES 2 ;
    3> backup tablespace tbs_mult ;
    4> }
    5>
    RMAN-03023: executing command: SET BACKUP COPIES

    RMAN-03090: Starting backup at 25-JUN-08
    RMAN-08030: allocated channel: ORA_SBT_TAPE_1
    RMAN-08500: channel ORA_SBT_TAPE_1: sid=93 devtype=SBT_TAPE
    RMAN-08526: channel ORA_SBT_TAPE_1: Oracle Secure Backup
    RMAN-08008: channel ORA_SBT_TAPE_1: starting full datafile backupset
    RMAN-08010: channel ORA_SBT_TAPE_1: specifying datafile(s) in backupset
    RMAN-08522: input datafile fno=00004 name=/jfersten_tstvw1/oracle/dbs/tbs_mult.dat
    RMAN-08038: channel ORA_SBT_TAPE_1: starting piece 1 at 25-JUN-08
    RMAN-08053: channel ORA_SBT_TAPE_1: finished piece 1 at 25-JUN-08 with 2 copies
    and tag TAG20080625T121838
    RMAN-08503: piece handle=06jjqgcu_1_1 comment=API Version 2.0,MMS Version 10.2.0.0
    RMAN-08503: piece handle=06jjqgcu_1_2 comment=API Version 2.0,MMS Version 10.2.0.0
    RMAN-08540: channel ORA_SBT_TAPE_1: backup set complete, elapsed time: 00:11:06
    RMAN-03091: Finished backup at 25-JUN-08

    Recovery Manager complete.

The primary job is `sbt/8`:

    ob> lsj -l --log sbt/8
    sbt/8:
        Type:                   database tstvw1 (dbid=1586108579)
        Scheduled time:         none
        State:                  completed successfully at 2008/06/25.12:29
        Priority:               100
        Privileged op:          no
        Run on host:            (administrative server)
        Attempts:               0
        Log:
            2008/06/25.12:29:37 Job completed successfully.

The subordinates spawned by `sbt/8` are `sbt/8.1` and `sbt/8.2`.

    ob> lsj -l sbt/8.1
    sbt/8.1:
        Type:                   datafile backup
        Backup piece:           06jjqgcu_1_1
        Family:                 verylongmediafamilyname
        Encryption:             off
        Scheduled time:         none
        State:                  completed successfully at 2008/06/25.12:29
        Priority:               100
        Privileged op:          no
        Run on host:            brhost3
        Attempts:               1
    ob> lsj -l sbt/8.2
    sbt/8.2:
        Type:                   datafile backup
        Backup piece:           06jjqgcu_1_2
        Family:                 verylongmediafamilyname
        Encryption:             off
        Scheduled time:         none
        State:                  completed successfully at 2008/06/25.12:29
        Priority:               100
        Privileged op:          no
        Run on host:            brhost3
        Attempts:               1

In job descriptions, Oracle Secure Backup assigns these jobs names determined by what type of RMAN backup is being performed. Valid types include archivelog, database, datafile, and controlfile. Oracle Secure Backup assigns each RMAN job an identifier whose prefix is the parent sbt job id, followed by a dot (.), followed by a unique small number. For example, 15.1 could be a subordinate job for scheduled job 15. The following example shows a typical `lsj` output containing a variety of Oracle Secure Backup RMAN backups:

    sbt/1.1 none  archivelog backup        completed successfully at 2008/06/25.12:04
    sbt/2   none  database tstvw1          completed successfully at 2008/06/25.12:04
    sbt/2.1 none  controlfile autobackup   completed successfully at 2008/06/25.12:04
    sbt/3   none  database tstvw1          completed successfully at 2008/06/25.12:05
    sbt/3.1 none  datafile backup          completed successfully at 2008/06/25.12:05
    sbt/4   none  database tstvw1          completed successfully at 2008/06/25.12:06
    sbt/4.1 none  restore piece '03jgj1_1' completed successfully at 2008/06/25.12:06
    sbt/5   none  database tstvw1          completed successfully at 2008/06/25.12:06
    sbt/5.1 none  incremental backup       completed successfully at 2008/06/25.12:06
    sbt/6   none  database tstvw1          completed successfully at 2008/06/25.12:12
    sbt/6.1 none  datafile backup          completed successfully at 2008/06/25.12:12
    sbt/7   none  database tstvw1          completed successfully at 2008/06/25.12:17
    sbt/7.1 none  restore piece '05jgj0_1' completed successfully at 2008/06/25.12:17
    sbt/8   none  database tstvw1          completed successfully at 2008/06/25.12:29
    sbt/8.1 none  datafile backup          completed successfully at 2008/06/25.12:29
    sbt/8.2 none  datafile backup          completed successfully at 2008/06/25.12:29

## 4.4 Performing Backups with RMAN and Oracle Secure Backup

After you have configured RMAN to use the Oracle Secure Backup SBT, the procedure for making RMAN backups is identical to the procedure described in Oracle Database Backup and Recovery User's Guide. This section describes how to use Enterprise Manager to back up the database through the Oracle Secure Backup SBT.

To back up the database using Database Control:

1. Log in to the Oracle Enterprise Manager Database Control as an Oracle Secure Backup user with database administrator rights.

2. Click Availability.

   The Availability subpage appears.

3. In the Manage section, click Schedule Backup.

   The Database Instance: database_name > Schedule Backup page appears.

   Description of the illustration osb_oem008.gif

4. Perform the following actions:

   1. In the Customized Backup section, select Whole Database.

      This option specifies an online backup of the Oracle Database data files and archive logs.

   2. In the Host Credentials section, enter the credentials of an Oracle Secure Backup user with access to the targeted database in the Username and Password fields.

   3. Select Save as Preferred Credential if you want Database Control to remember these credentials.

   4. Click Schedule Customized Backup.

   The Schedule Customized Backup: Options page appears.

   Description of the illustration osb_oem009.gif

5. Select Full Backup in the Backup Type section.

6. To encrypt the backup using RMAN encryption (not Oracle Secure Backup encryption), select Secure the backup using Recovery Manager encryption. Do the following:

   1. Select an encryption algorithm from the Encryption Algorithm list.

   2. Select an encryption mode.

      Selecting both encryption modes provides the flexibility of restoring a backup using either the Oracle Database encryption wallet or a password.

      If you select password-protected encryption, then enter a password in the Password and Confirm Password fields.

   Note that for RMAN encryption, the database manages the encryption keys. For Oracle Secure Backup encryption, Oracle Secure Backup manages the keys whether the backup is of the file system or database.

7. Click Next.

   The Schedule Customized Backup: Settings page appears.

   Description of the illustration osb_oem010.gif

8. Click View Default Settings to view the backup settings for the current backup.

   Click Override Current Settings to go the Backup Settings page, where you can change the current settings for number of tape drives and tape backup type. Click the Override button in the Oracle Secure Backup section of the Backup Settings page to change the media family, designated tape drives, or both for the current backup only.

   Select the Tape option and then click Next.

   The Schedule Customized Backup: Schedule page appears.

   Description of the illustration osb_oem011.gif

9. In the Job section, this page displays a job name in the Job field and the type of backup in the Job Description field.

   Select a schedule type. Your options are:

   - One Time (Immediately)

   - One Time (Later)

   - Repeating

   Click Next.

   The Schedule Customized Backup: Review appears.

10. Review your backup characteristics and then click Submit Job.

    The Status page appears.

11. Click View Job to monitor the progress of the backup.

    The Execution: database_name page appears.

    Refresh the page until the Backup link appears.

12. Click Backup.

    The Step: Backup page appears.

    Refresh this page to display the RMAN output for the backup job.

## 4.5 Performing Recovery with RMAN and Oracle Secure Backup

After you have configured RMAN to use the Oracle Secure Backup SBT, the procedure for restoring database files is identical to the procedure described in Oracle Database Backup and Recovery User's Guide. For step-by-step instructions on restoring and recovering your whole database using Oracle Database Control, see the Oracle by Example at the following URL:

`http://www.oracle.com/technology/obe/11gr1_2day_dba/backup/backup.htm#t6`

## 4.6 RMAN and Oracle Secure Backup Encryption

Oracle Database backup encryption can be performed in one of two ways using Oracle Secure Backup:

- Use RMAN backup encryption, which encrypts data within the database.

  This option is available with Oracle Database 10g release 2 (10.2) forward. Please refer to Oracle Database licensing documentation for any restrictions.

- Use Oracle Secure Backup encryption, which encrypts data after RMAN has passed the data through the SBT to Oracle Secure Backup.

  This option is available with Oracle9i forward. While encryption occurs outside the database, the data is encrypted on the server before transport over the network or written to a locally attached tape device.

Note:

Oracle Secure Backup encryption is available for both RMAN and file-system backup operations.

See Also:

Chapter 10, "Managing Backup Encryption"

## 4.7 RMAN Backup Metadata in Oracle Secure Backup

Oracle Secure Backup maintains backup metadata for all RMAN and file-system backup operations. This section explains how to access RMAN metadata within the Oracle Secure Backup catalog.

This section contains these topics:

- About RMAN and Oracle Secure Backup Metadata

- Displaying RMAN Job Information in Oracle Secure Backup

- Displaying Backup Piece Information

### 4.7.1 About RMAN and Oracle Secure Backup Metadata

Oracle Secure Backup maintains a catalog of metadata for Oracle Secure Backup jobs on the administrative server. You can use the Web tool to display catalog metadata about each backup piece, referred to as a backup image in the Oracle Secure Backup Web tool. You can also use the `lsjob`, `catxcr`, and `lspiece` commands in `obtool`.

See Also:

Oracle Database Backup and Recovery User's Guide for more information on accessing RMAN metadata

#### 4.7.1.1 Expiration of RMAN Backups on Tape

You can make RMAN backups on a volume that use a content-managed or time-managed expiration policy. If the RMAN backup is on a content-managed volume, then you should use the `DELETE` `OBSOLETE` command in RMAN to mark backup pieces as deleted in the RMAN repository. In response, Oracle Secure Backup updates its catalog to indicate that the backup pieces are deleted, so both the RMAN repository and Oracle Secure Backup catalog show the pieces as deleted.

Note:

If you use content-managed volumes for RMAN backups, then the RMAN retention configuration determines when the tape expires. If you use a control file for the RMAN repository, then the record keep time must be at least equal to the period you want backups retained.

Oracle does not recommend using the `rmpiece` command in Oracle Secure Backup to delete backup pieces from tape, because the RMAN metadata then fails to reflect the tape contents. This discrepancy can also occur when RMAN backup pieces exist on volumes that are expired by a time-managed expiration policy, or when you forcibly overwrite a volume containing RMAN backup pieces. Use the `CROSSCHECK` command in RMAN to resolve discrepancies between the Oracle Secure Backup catalog and the RMAN repository.

See Also:

Oracle Database Backup and Recovery User's Guide to learn about crosschecking backups and deleting RMAN backups

### 4.7.2 Displaying RMAN Job Information in Oracle Secure Backup

RMAN backups made with the Oracle Secure Backup SBT are subject to all Oracle Secure Backup job management commands.

See Also:

"Managing Backup and Restore Jobs"

When you use RMAN to backup or restore a database, the job contains the name of the database. Example 4-2 shows sample output for backup and restore jobs relating to a database named `orcl`. The Job IDs in this example include `oracle` because the jobs were run by the `oracle` user.

Example 4-2 Database Backup and Restore Jobs

    ob> lsjob --all
    Job ID           Sched time  Contents                       State
    ---------------- ----------- ------------------------------ ---------------------------------------
    oracle/1         none    database orcl (dbid=1091504057) completed successfully at 2008/08/11.11:29
    oracle/1.1       none    datafile backup                 completed successfully at 2008/08/11.11:29
    oracle/2         none    database orcl (dbid=1091504057) completed successfully at 2008/08/11.11:56
    oracle/2.1       none    datafile backup                 completed successfully at 2008/08/11.11:56
    oracle/3         none    database orcl (dbid=1091504057) completed successfully at 2008/08/11.11:57
    oracle/3.1       none    restore piece '06grqejs_1_1'    completed successfully at 2008/08/11.11:57

#### 4.7.2.1 Displaying Job Transcripts

Job transcripts contain detailed information about Oracle Secure Backup jobs. Example 4-3 shows part of the transcript for an archived log backup. This backup uses the `RMAN-DEFAULT` media family.

Example 4-3 Transcript of an Archived Log Backup Job

    ob> catxcr --head 22 sbt/6.1
    2008/06/28.13:01:04 ______________________________________________________________________
    2008/06/28.13:01:04
    2008/06/28.13:01:04         Transcript for job sbt/6.1 running on brhost1
    2008/06/28.13:01:04
    Volume label:
        Volume tag:         ADE202
        Volume ID:          RMAN-DEFAULT-000002
        Volume sequence:    1
        Volume set owner:   root
        Volume set created: Tue Jun 28 13:01:30 2008
        Media family:       RMAN-DEFAULT
        Volume set expires: never; content manages reuse

    Archive label:
        File number:        1
        File section:       1
        Owner:              root
        Client host:        brhost1
        Backup level:       0
        S/w compression:    no
        Archive created:    Tue Jun 28 13:01:30 2008

See Also:

- Oracle Secure Backup Reference for complete syntax and semantics for the `catxcr` command in `obtool`

- "Displaying Job Transcripts" for instructions on using the Oracle Secure Backup Web tool to display job transcripts

#### 4.7.2.2 Displaying SBT Errors

If an error occurs during an SBT session, then Oracle Secure Backup attempts to send the error description to the administrative server to be saved in the job transcript. The database writes SBT errors to the sbtio.log trace file, unless the user has configured the file to be named otherwise. Typically, sbtio.log is located in the `rdbms/log` subdirectory of the Oracle home.

See Also:

Oracle Database Backup and Recovery User's Guide to learn how troubleshoot RMAN backup and restore operations

### 4.7.3 Displaying Backup Piece Information

Oracle Secure Backup maintains information about RMAN backups at the backup piece level. This information can be browsed in the Oracle Secure Backup Web tool under backup image or by using obtool commands. While information regarding backup pieces is available with Oracle Secure Backup, backup sets are logical groupings that only RMAN has knowledge of.

An RMAN backup piece is represented in Oracle Secure Backup as a backup image. You can use the `lspiece` command in `obtool` to display information about backup pieces recorded in the Oracle Secure Backup catalog. Example 4-4 shows sample output for `lspiece`.

Example 4-4 Displaying Backup Pieces

    ob> lspiece --long
    Backup piece OID:       104
        Database:               ob
        Database ID:            1566254457
        Content:                archivelog
        Copy number:            0
        Created:                2008/06/28.13:01
        Host:                   brhost1
        Piece name:             05go3tgd_1_1
    Backup piece OID:       105
        Database:               ob
        Database ID:            1566254457
        Content:                archivelog
        Copy number:            0
        Created:                2008/06/28.13:02
        Host:                   brhost1
        Piece name:             06go3ti5_1_1

Note:

Each piece name must be unique across all databases in the Oracle Secure Backup administrative domain. You can make piece names unique either by using the RMAN catalog option, so that the backup catalog for all databases in the domain is centralized, or by using RMAN format string to create unique piece names.

See Also:

- "RMAN Backup Sets and Oracle Secure Backup Images"

- "Displaying Backup Sections" for instructions on using the Oracle Secure Backup Web tool to display information about backup pieces

- Oracle Secure Backup Reference for complete syntax and semantics for the `lspiece` command

## 4.8 Using RMAN and Oracle Secure Backup in an Oracle RAC Environment

You can use the Oracle Secure Backup SBT library with RMAN to back up a database in an Oracle Real Application Clusters (Oracle RAC) system.

This section contains these topics:

- Installing Oracle Secure Backup in an Oracle RAC Environment

- Network Versus Local Backups

- Duplexing Backups

### 4.8.1 Installing Oracle Secure Backup in an Oracle RAC Environment

Oracle recommends that you install Oracle Secure Backup on each node in the cluster, configuring the node as a client, media server, or both. By including all nodes in the administrative domain, local files on the node can be protected. Oracle Secure Backup handles file-system backup operations for an Oracle RAC client no differently from any other client host.

Figure 4-6 shows a sample administrative domain that includes a three-node Oracle RAC system, with each node configured as an Oracle Secure Backup client. In Oracle RAC environments, RMAN can restore a backup piece to any node within a cluster that has the Oracle Secure Backup software installed, regardless of which node created the backup piece.

Figure 4-6 Using RMAN and Oracle Secure Backup in a Real Application Clusters Environment

Description of "Figure 4-6 Using RMAN and Oracle Secure Backup in a Real Application Clusters Environment"

### 4.8.2 Network Versus Local Backups

For performance reasons, it is important to configure the Oracle RAC environment differently for networked or local backups. RMAN backups can be dynamically allocated in the Oracle RAC environment based on the work load distribution. This technique works well if the Oracle RAC database is backed up over the network using Oracle Secure Backup because it does not matter to Oracle Secure Backup which of the nodes performs a client backup.

If a node in the Oracle RAC environment is a media server, then it is more efficient for this node to create backups on a locally accessed tape device. This technique avoids allocating network bandwidth for backups, as would happen if an Oracle RAC node configured as a client were to perform the backup.

You can configure RMAN backups to be performed from specific nodes. Oracle recommends that RMAN be configured persistently so it must be configured only once and affects all backup and restore operations from that database.

In the following example, there are three tape drives attached to hostA and another three tape drives attached to hostB. The configuration steps are as follows:

1. Connect to any node in the Oracle RAC environment to configure RMAN parameters.

2. Set parallelism.

3. Configure channel (3 channels) /connect / sid hostA.

4. Configure channel (3 channels) /connect / sid hostB.

In the preceding example, you are establishing that six total channels are necessary, three from each host. This configuration applies to every backup and restore operation unless you override this setting. You can start an RMAN operation by connecting to any node within the Oracle RAC environment. The operation is performed only on the two configured hosts.

Note:

If you do not configure persistent settings, then you can accomplish the same goal in RMAN scripts by allocating channels by host.

### 4.8.3 Duplexing Backups

You might want to duplex backup operations, each on a separate volume set, keeping one set on-site for convenient access, and storing a second set off-site for disaster recovery. For ease of management, each duplexed backup operation can be defined by its own database storage selectors and written to its own separate Oracle Secure Backup media family.

See Also:

- "Configuring Media Families"

- "Database Backup Storage Selectors"

Database backup storage selectors are user-defined Oracle Secure Backup media policies for Oracle Database backups. They define which media family, tape device, and resource wait time should be applied by content and copy number of the backup. One database storage selector can apply to all database backups within the administrative domain or multiple storage selectors can be defined for each database.

In the following example, two database storage selectors named `ssel_1` and `ssel_2` are created. They both back up all content of all databases on `host_name`. But `ssel_1` uses media family `mf_1`, while `ssel_2` uses media family `mf_2`:

    ob> mkssel --dbid * --host host_name --content * --family mf_1 -- copynum 1 ssel_1
    ob> mkssel --dbid * --host host_name --content * --family mf_2 -- copynum 2 ssel_2

See Also:

Oracle Secure Backup Reference for complete `mkssel` syntax and semantics

If you use RMAN duplexed backups and `PARALLELISM`, then the number of available tape drives must accommodate both copies simultaneously. If channel configuration is set to `PARALLELISM` of 2 for the duplexed backups in the preceding example, then four tape drives are needed for backup operations (two backup copies multiplied by `PARALLELISM` of 2).

Note:

If a tape drive is not available for one copy, then the other copy cannot proceed. In addition, if a backup stream fails for one copy, then it fails for the other copy as well.

Restore operations require only two tape drives in this situation, because restore operations are not duplexed.