Skip Headers
Oracle® Database Backup and Recovery Quick Start Guide
10g Release 2 (10.2)

Part Number B14193-02
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Master Index
Master Index
Go to Feedback page
Feedback

Go to previous page
Previous
Go to next page
Next
View PDF

4 Configuring Persistent Settings for the RMAN Environment

You can use the RMAN CONFIGURE command to create persistent settings in the RMAN environment, which apply to all subsequent operations, even if you exit and restart RMAN. These configured settings can specify disk and SBT channel behavior, backup destinations, policies affecting backup strategy, and others. Some frequently used configuration settings are described below. See Oracle Database Backup and Recovery Basics for more information about configuration settings.

Viewing Current Configured Settings

This command shows all configurable settings:

RMAN> SHOW ALL;

The output lists the CONFIGURE commands to re-create this configuration.

Configuring Disk Devices and Channels

By default, RMAN allocates one disk channel for all operations automatically, and directs all backups to disk if no destination is specified. If your database uses a flash recovery area, then backups to disk are stored there if no other location is specified in the BACKUP command. Otherwise, disk backups are assumed to be stored in a platform-specific default location.

You can also configure a format for a disk channel, to specify a different default location for backups, by using the FORMAT clause with CONFIGURE CHANNEL DEVICE TYPE DISK.

The following command configures RMAN to write disk backups to the /tmp directory:

RMAN> CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT '/tmp/%U';

The format specifier %U is replaced with unique filenames for the files when you take backups. Refer to Oracle Database Backup and Recovery Advanced User's Guide for more details on configuring destinations for your disk backups.

To undo the configuration of a default disk location for backups, use the following CONFIGURE command to clear the setting:

RMAN> CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT CLEAR;

RMAN will write backups to the default location.

Configuring Tape Devices and Channels

After configuring your media management software, you can make the media manager the default destination for RMAN backups:

RMAN> CONFIGURE DEFAULT DEVICE TYPE TO sbt;

Some media managers require a PARMS string to configure device settings:

RMAN> CONFIGURE CHANNEL DEVICE TYPE sbt PARMS='ENV=mml_env_settings';

Multiple channels can be configured to run backups in parallel. This command configures three sbt channels for use in RMAN jobs:

RMAN> CONFIGURE DEVICE TYPE sbt PARALLELISM 3;

Configuring a Retention Policy

Retention policy governs how long database backups are retained, and determines how far into the past you can recover your database. Retention policy can be set in terms of a recovery window (how far into the past you need to be able to recover your database), or a redundancy value (how many backups of each file must be retained). Choosing an effective retention policy is a vital part of your backup strategy.

This command ensures that RMAN retains all backups needed to recover the database to any point in time in the last 7 days:

RMAN> CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 DAYS;

This command ensures that RMAN retains three backups of each datafile:

RMAN> CONFIGURE RETENTION POLICY TO REDUNDANCY 3;

Use DELETE OBSOLETE to immediately delete backups no longer required by the retention policy. (For backups stored in a flash recovery area, you do not need to perform this step. The database automatically deletes obsolete backups in the flash recovery area when space is needed, as well as files that have been backed up to a media manager.)

You can also use the KEEP option of the BACKUP and CHANGE commands to override the configured retention policy for individual backups-- for example, to force the retention of a specific backup taken before a major database change.

Configuring Control File Autobackups

The control file can be automatically backed up after each RMAN backup as a way to protect the RMAN repository. The following command configures RMAN to create these control file autobackups:

RMAN> CONFIGURE CONTROLFILE AUTOBACKUP ON;

By default, RMAN automatically generates names for control file autobackups and stores them in the flash recovery area. The following command configures RMAN to write control file autobackups to the /mybackupdir directory:

RMAN> CONFIGURE CONTROLFILE AUTOBACKUP FORMAT 
           FOR DEVICE TYPE DISK TO '/mybackupdir/cf%F';

The %F element of the format string combines the DBID, day, month, year, and sequence number to generate a unique filename. %F must be included in any control file autobackup format.

Restoring Default Values for Configured Settings

Reset any CONFIGURE setting to its default by running the command with the CLEAR option, as shown here:

RMAN> CONFIGURE CHANNEL DEVICE TYPE sbt CLEAR;
RMAN> CONFIGURE RETENTION POLICY CLEAR;
RMAN> CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK CLEAR;