Skip Headers

Oracle® Database Backup and Recovery Advanced User's Guide
10g Release 1 (10.1)

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

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

6
Configuring the RMAN Environment: Advanced Topics

This chapter describes how to perform setup and configuration tasks. This chapter contains these topics:

Configuring the Flash Recovery Area: Advanced Topics

To take maximum advantage of the flash recovery area, it should be used to store and manage as many different types of file as possible: online redo logs, archived redo logs, control files and RMAN's own working files for backup and restore operations.

This section contains the following topics:

Configuring Online Redo Log Creation in the Flash Recovery Area

The following statements can create online redo logs in the flash recovery area:

The default size of an online log created in the flash recovery area is 100 MB. The log member filenames are automatically generated by the database.

The initialization parameters that determine where online redo log files are created are DB_CREATE_ONLINE_LOG_DEST_n, DB_RECOVERY_FILE_DEST and DB_CREATE_FILE_DEST. Details of the effect of various combinations of these parameters on online redo log creation can be found inOracle Database SQL Reference in the description of the LOGFILE clause of the CREATE DATABASE statement.

Configuring Control File Creation in the Flash Recovery Area

The initialization parameters CONTROL_FILES, DB_CREATE_ONLINE_LOG_DEST_n, DB_RECOVERY_FILE_DEST, and DB_CREATE_FILE_DEST all interact to determine the location where the database control files are created.

For a full description of how these parameters interact, see the "Semantics" section of the description of CREATE CONTROLFILE in Oracle Database SQL Reference.

If the database creates an Oracle managed control file, and if the database uses a server parameter file, then the database sets the CONTROL_FILES initialization parameter in the server parameter file. If the database uses a client-side initialization parameter file, then you must set the CONTROL_FILES initialization parameter manually in the initialization parameter file.

Archived Redo Log Creation in the Flash Recovery Area

It is recommended that you the use flash recovery area as an archived log location because the archived logs are automatically managed by the database. Whatever archiving scheme you choose, it is always advisable to create multiple copies of archived logs.

You have the following basic options, listed from most to least recommended:

  1. Enable archiving to the flash recovery area only and use disk mirroring to create copies of the archived redo logs.
  2. Enable archiving to the flash recovery area and set other LOG_ARCHIVE_DEST_n initialization parameter to locations outside the flash recovery area.
  3. Set LOG_ARCHIVE_DEST_n initialization parameters to archive only to non-flash recovery area locations.

If you want to use the flash recovery area, you cannot use the LOG_ARCHIVE_DEST and LOG_ARCHIVE_DUPLEX_DEST initialization parameters. You must use instead the LOG_ARCHIVE_DEST_n parameters, which have somewhat different semantics. Once your database is using LOG_ARCHIVE_DEST_n, you can configure a flash recovery area.

Rules for Initialization Parameters Affecting Redo Log File Destinations

The interactions among different initialization parameters affecting redo log archiving desintations are as follows:

Filenames for Archived Redo Log Files in the Flash Recovery Area

The generated filenames for the archived redo logs in the flash recovery area are Oracle Manged Filenames and are not determined by LOG_ARCHIVE_FORMAT.

RMAN File Creation in the Flash Recovery Area

This section describes RMAN commands or implicit actions (such as control file autobackup) that can create files in the flash recovery area, and how to control whether a specific command creates files there or in some other destination. The assumption in all cases is that a flash recovery area has already been configured for your database. The commands are:

Configuring RMAN to Make Backups to a Media Manager

On most platforms, to back up to and restore from sequential media such as tape you must integrate a media manager with your Oracle database. A media manager is not an Oracle product and must be obtained from a third-party vendor. If you choose to use RMAN with a media manager, then you must obtain all product-specific information from the vendor.

This section describes the generic steps for configuring RMAN for use with a media manager. The actual steps depend on the media management product that you install and the platform on which you are running the database.

Read the following sections in order when configuring the media manager:

  1. Prerequisites for Using a Media Manager with RMAN
  2. Locating the Media Management Library: The SBT_LIBRARY Parameter
  3. Testing Whether the Media Manager Library Is Integrated Correctly
  4. Configuring Automatic Channels for Use with a Media Manager

    See Also:

    "Media Management" for an overview of media management software and its implications for RMAN

Prerequisites for Using a Media Manager with RMAN

Before you can begin using RMAN with a media manager, you must install it and make sure that RMAN can communicate with it. Instructions for this procedure should be available in the media manager vendor's software documentation.

In general, you should begin by installing and configuring the media management software on the target host or production network. Ensure that you can make non-RMAN backups of operating system files on the target database host. This step makes later troubleshooting much easier, by confirming that the basic integration of the media manager with the target host has been successful. Refer to your media management documentation to learn how to back up files to the media manager outside of RMAN.

Then, obtain and install the third-party media management module for integration with the database server. This module contains the media management library that the Oracle database loads and uses when accessing the media manager. It is generally a third-party product which must be purchased separately. Contact your media management vendor for details.

Locating the Media Management Library: The SBT_LIBRARY Parameter

When allocating or configuring channels for RMAN to use to communicate with a media manager, specify the SBT_LIBRARY parameter to provide the path to the media management software library. When RMAN actually allocates channels to communicate with a media manager, it attempts to load the library indicated by the SBT_LIBRARY parameter.

If you do not provide a value for this parameter, RMAN looks in a platform-specific default location. On UNIX, the default library filename is $ORACLE_HOME/lib/libobk.so, with the extension name varying according to platform: .so, .sl, .a, and so forth. On Windows the default library location is %ORACLE_HOME%\bin\orasbt.dll.


Note:

The default media management library file is not part of the standard database installation. It is only present if you install third-party media management software.


If the database is unable to locate a media management library in the location specified by the SBT_LIBRARY parameter or the default location, then RMAN issues an ORA-27211 error and exits.

Whenever channel allocation fails, the database writes a trace file to the USER_DUMP_DEST directory. The following shows sample output:

SKGFQ OSD: Error in function sbtinit on line 2278
SKGFQ OSD: Look for SBT Trace messages in file /oracle/rdbms/log/sbtio.log
SBT Initialize failed for /oracle/lib/libobk.so
See Also:

Testing Whether the Media Manager Library Is Integrated Correctly

After you have confirmed that the database server can load the media management library, test to make sure that RMAN can back up to the media manager. The process for testing the media management library is described in the following sections:

Configuring Media Management Software for RMAN Backups

After installing the media management software, perform whatever configuration that your vendor requires so that the software can accept RMAN backups. Depending on the type of media management software that you installed, you may have to define media pools, configure users and classes, and so forth.

Then, determine which PARMS settings are needed for the ALLOCATE CHANNEL or CONFIGURE CHANNEL commands as well as the recommended FORMAT string for the BACKUP command (if needed). The PARMS parameter sends instructions to the media manager. For example, the following vendor-specific PARMS setting instructs the media manager to back up to a volume pool called oracle_tapes:

PARMS='ENV=(NSR_DATA_VOLUME_POOL=oracle_tapes)'

Refer to your third-party vendor documentation for the appropriate settings.

See Also:


Configuring Backup Piece Names and Sizes for a Media Manager

To work with restrictions on file names and sizes imposed by your media manager, you may need to configure RMAN settings that control the naming and size of backup pieces.

Configuring Backup Piece Names for RMAN Backups to a Media Manager

You may need to manage the naming of backup pieces to be written to the media manager, so that backup pieces have unique names. A backup piece name is determined by the FORMAT string specified in the BACKUP command, the CONFIGURE CHANNEL command, or the ALLOCATE CHANNEL command. The media manager considers the backup piece name as the filename of the backup file, so this name must be unique in the media manager catalog.

You can use the substitution variables provided by RMAN to generate unique backup piece names. If you do not specify the FORMAT parameter, then RMAN automatically generates a unique filename with the %U substitution variable.


Note:

Refer to your media management documentation to determine the string character limit for the media manager. For example, some media managers only support a 14-character backup piece name, and some require special FORMAT strings. The unique backup piece names generated by %U are less than 14 characters.


See Also:

Oracle Database Recovery Manager Reference for the complete list of variables allowable in format strings with the BACKUP command

Configuring Backup Piece Sizes for RMAN Backups to a Media Manager

Some media managers have limits on the maximum size of files that they can back up or restore. You must ensure that RMAN does not produce backup sets larger than limits imposed by your media manager.

To limit backup piece sizes, use the parameter MAXPIECESIZE, which you can set in the CONFIGURE CHANNEL and ALLOCATE CHANNEL commands. Refer to the *.rcv scripts in the demo subdirectory on your system, which is located in an operating system specific location ($ORACLE_HOME/rdbms on UNIX) for an example.

See Also:

Oracle Database Recovery Manager Reference and "Size of Backup Pieces"for details on how to set MAXPIECESIZE



Testing ALLOCATE CHANNEL on the Media Manager

Use the following steps to confirm that RMAN is able to load the media management library when allocating a channel for your media manager.

  1. Start RMAN and connect to the target database. For example, enter:
    % rman TARGET /
    
    
  2. Run the ALLOCATE CHANNEL command with the PARMS required by your media management software. For example, run this command:
    RUN
    {
      ALLOCATE CHANNEL c1 DEVICE TYPE sbt 
        PARMS='SBT_LIBRARY=/mediavendor/lib/libobk.so ENV=(NSR_SERVER=tape_
    srv,NSR_GROUP=oracle_tapes)';
    }
    
    

If you do not receive an error message, then the database successfully loaded the media management library. If you receive the ORA-27211 error, the media management library could not be loaded:

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of allocate command on c1 channel at 11/30/2001 13:57:18
ORA-19554: error allocating device, device type: SBT_TAPE, device name: 
ORA-27211: Failed to load Media Management Library
Additional information: 25

In this case, you must check your media management installation to make sure that the library is correctly installed, and re-check the value for the SBT_LIBRARY parameter as described in "Locating the Media Management Library: The SBT_LIBRARY Parameter".

For any other errors, check the trace file in USER_DUMP_DEST directory for more information.

See Also:

"After Installation of Media Manager, RMAN Channel Allocation Fails: Scenario" for a troubleshooting scenario

Testing a Backup to the Media Manager

After testing a channel allocation on the media manager, make a test backup. For example, to test whether your backup goes successfully to tape, you might run the following command:

RUN
{
  ALLOCATE CHANNEL c1 DEVICE TYPE sbt 
    PARMS='SBT_LIBRARY=/mediavendor/lib/libobk.so ENV=(NSR_SERVER=tape_srv,NSR_
GROUP=oracle_tapes)';
  BACKUP CURRENT CONTROLFILE;
}

The specifics of your PARMS and FORMAT settings depend on the media management software that you are using.

If the backup succeeds, then you are ready to make backups to your media manager.

Possible failures include the following cases:

Case Response

The backup hangs.

A hanging backup usually indicates that the media manager is waiting to mount a tape. Check if there are any media manager jobs in "tape mount request" mode and fix the problem.

Ensure that the steps in "Configuring RMAN to Make Backups to a Media Manager" are correctly done. Refer to "Backup Job Is Hanging: Scenario" if the problem persists.

The backup fails with an ORA-19511

This error indicates that the media management software is not correctly configured. Ensure that the steps in "Configuring RMAN to Make Backups to a Media Manager" are correctly done. Also, ensure that you have the correct PARMS and FORMAT strings required by your media management software.

See Also:

"Testing the Media Management API" and "RMAN Troubleshooting Scenarios" for more information about troubleshooting RMAN with a media manager

Configuring Automatic Channels for Use with a Media Manager

This section describes how to configure automatic channels specifically for use with a media manager. For an overview of automatic channels and how they are used, refer to the section "Configuring Automatic Channels". The following setup procedure references the sections in "Configuring Automatic Channels" where it is appropriate.

To configure automatic channels for use with a media manager:

  1. Configure a generic channel of DEVICE TYPE sbt as described in "Configuring a Generic Automatic Channel for a Device Type". In the configuration enter all parameters that you tested in the section "Testing a Backup to the Media Manager". For example, assume that your media vendor requires PARMS settings as follows:
    RMAN> CONFIGURE CHANNEL DEVICE TYPE sbt 
    PARMS='SBT_LIBRARY=/mediavendor/lib/libobk.so ENV=(NSR_SERVER=tape_svr,NSR_
    CLIENT=oracleclnt,NSR_GROUP=ora_tapes)' 
      FORMAT "BACKUP_%U";
    
    
  2. After configuring the channel, test by backing up something small, such as the control file:
    RMAN> BACKUP DEVICE TYPE sbt CURRENT CONTROLFILE;
    
    
  3. Check your configuration by running the following command:
    RMAN> SHOW CHANNEL FOR DEVICE TYPE sbt;
    
    
  4. Configure the default device to sbt so that RMAN sends all backups to the media manager. For example:
    RMAN> CONFIGURE DEFAULT DEVICE TYPE TO sbt;
    
    
    
  5. After configuring the default device, make a test backup to determine whether it is really going to the media manager:
    RMAN> BACKUP CURRENT CONTROLFILE;
    
    
    
  6. Check your configuration by running the following command:
    RMAN> SHOW DEFAULT DEVICE TYPE;
    
    
  7. If you use more than one tape device, then you must specify the channel parallelism as described in "Configuring Parallelism for Automatic Channels". Assume that you want to back up to your media manager using two tape drives in parallel. In this case, you can run the following commands:
    RMAN> CONFIGURE DEVICE TYPE sbt PARALLELISM 2;       
    RMAN> BACKUP DATABASE; 
    

Configuring Automatic Channels

You can save persistent configuration information such as channel parameters, parallelism, and the default device type in the RMAN repository. Hence, you do not have to manually allocate channels for each backup. Instead, you can configure automatic channels for use in backup, restore, recovery, and maintenance jobs.

You can always override automatic channels with ALLOCATE CHANNEL to allocate channels manually for a particular backup job.

By default, RMAN has preconfigured a disk channel so that you can back up to disk without doing any manual configuration. You may, however, want to parallelize the channels for disk or tape devices to improve performance.

See Also:

"About RMAN Channels" for a conceptual overview of automatic and manual channels, and Oracle Database Recovery Manager Reference for syntax



Configuring Parallelism for Automatic Channels

By default, channel parallelism for each configured device is set to 1. As a rule, allocate one channel for each physical device. If you are backing up to only one disk location or only one tape drive, then you need only one channel.

The CONFIGURE DEVICE TYPE ... PARALLELISM integer command specifies how many channels (up to 254) RMAN should allocate for jobs on the specified device type. This command allocates three channels for jobs on device type DISK :

RMAN> CONFIGURE DEVICE TYPE DISK PARALLELISM 3;

These commands back up to a media manager using two tape drives in parallel:

RMAN> CONFIGURE DEFAULT DEVICE TYPE TO sbt; # default backup device is tape
RMAN> CONFIGURE DEVICE TYPE sbt PARALLELISM 2; # configure two tape channels
RMAN> BACKUP DATABASE; # backup goes to two tapes, in two parallel streams

Each configured sbt channel will back up roughly half the total data.

See Also:

"Determining Channel Parallelism to Match Hardware Devices"

Configuring a Generic Automatic Channel for a Device Type

By default, RMAN automatically allocates a preconfigured DISK channel without any options. However, you may use a media manager that requires special options (PARMS, FORMAT, MAXPIECESIZE, and so forth) or you may want to change the default DISK setting. By configuring channels, you define which parameters are used when RMAN automatically allocates channels.

Use the CONFIGURE CHANNEL command to configure automatic channel options for the available device types: DISK and sbt. You can use the same options for CONFIGURE CHANNEL that you use for ALLOCATE CHANNEL, and you must specify at least one of these options. For example, you can configure generic disk and tape channels as in this example:

RMAN> CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT = '?/bkup_%U';
RMAN> CONFIGURE CHANNEL DEVICE TYPE sbt 
  PARMS='SBT_LIBRARY=/mediavendor/lib/libobk.so ENV=(NSR_SERVER=tape_svr,NSR_
CLIENT=oracleclnt,NSR_GROUP=ora_tapes)';

To configure a generic channel, that is, a template that is used for all parallelized channels, do not assign a number for the channel. If you set the PARALLELISM for a device, and then make the device default, then RMAN uses the same channel configuration for each parallelized channel.

To configure new generic channel settings for a specified device type, simply run a new command for the device type. The following example configures the default DISK channel to MAXPIECESIZE 2G, then erases this setting and sets a FORMAT:

RMAN> CONFIGURE CHANNEL DEVICE TYPE DISK MAXPIECESIZE 2G;
RMAN> CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT = /tmp/%U;

Configured Channels and the Default Device Type

The automatic channel that RMAN allocates for its backups depends on the default device type. If the default device type is DISK, then RMAN uses the DISK channel only. If the default device type is sbt, then RMAN uses the sbt channel only. RMAN cannot automatically allocate channels in backup jobs for multiple device types simultaneously (and, in fact, you should never attempt to use channels for multiple device types simultaneously for any backup job).

The following example creates a configuration in which all backups go to two tapes in parallel. For this example, the media management software requires additional parameters besides specifying the SBT_LIBRARY: ENV=(NSR_DATA_VOLUME_POOL=oracle_tapes). The chosen FORMAT for backup file names is %U_backup.

CONFIGURE DEFAULT DEVICE TYPE TO sbt;        # by default, backup goes to MML
CONFIGURE DEVICE TYPE sbt PARALLELISM 2;     # two tapes in parallel
CONFIGURE CHANNEL DEVICE TYPE                # sets parameters for all channels
  PARMS 'SBT_LIBRARY=/mediavendor/lib/libobk.so ENV=(NSR_DATA_VOLUME_
POOL=oracle_tapes)' FORMAT '%U_backup';
BACKUP DATABASE;                             # backs up database

Showing the Automatic Channel Configuration Settings

The SHOW CHANNEL, SHOW DEVICE TYPE and SHOW DEFAULT DEVICE TYPE commands are used to display the current configured settings for automatic channels.

Showing the Automatic Channel Settings

After connecting to the target database and recovery catalog (if you use one), issue the SHOW CHANNEL command to display the settings for all automatically allocated channels. For example, connect the RMAN client to the target and possibly catlaog databases, and enter:

RMAN> SHOW CHANNEL;    # shows the CONFIGURE setting for the automatic channels

Sample output for SHOW CHANNEL follows:

RMAN configuration parameters are:
CONFIGURE CHANNEL DEVICE TYPE 'SBT' RATE 1500K;

Showing the Configured Device Types

Issue the SHOW DEVICE TYPE command to display the configured devices and their PARALLELISM and backup type settings. The DISK device type is preconfigured.

To show the default device type and configuration for automatic channels:

After connecting to the target database and recovery catalog (if you use one), run the SHOW DEVICE TYPE command. For example, enter:

SHOW DEVICE TYPE;    # shows the CONFIGURE DEVICE TYPE ... PARALLELISM settings

Sample output for SHOW DEVICE TYPE follows:

RMAN configuration parameters are:
CONFIGURE DEVICE TYPE 'SBT_TAPE' PARALLELISM 1 BACKUP TYPE TO BACKUPSET;
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO COMPRESSED BACKUPSET; # default


Note: As with all SHOW commands, the output of SHOW DEVICE TYPE is in the form of a valid RMAN CONFIGURE command. You can in fact enter one command, like those shown in the preceding sample output, to configure the backup type and parallelism simultaneously. Refer to the syntax diagrams for CONFIGURE in Oracle Database Recovery Manager Reference for details on all of the possible ways of combining arguments to the CONFIGURE command.

Showing the Default Device Type

Issue the SHOW DEFAULT DEVICE TYPE command to display the settings for the default device type used by the automatic channels. When you issue the BACKUP command, RMAN allocates only default channels of the type set by the CONFIGURE DEFAULT DEVICE TYPE command. This default device type setting is not in effect when you use commands other than BACKUP. Note that you cannot disable the default device type: it is always either DISK (default setting) or sbt.

To show the default device type for automatic channels:

After connecting to the target database and recovery catalog (if you use one), run the SHOW DEFAULT DEVICE TYPE command. For example, enter:

SHOW DEFAULT DEVICE TYPE;    # shows the CONFIGURE DEFAULT DEVICE TYPE setting

Sample output for SHOW DEFAULT DEVICE TYPE follows:

RMAN configuration parameters are:
CONFIGURE DEFAULT DEVICE TYPE TO 'SBT';

Manually Overriding Configured Channels

If you manually allocate a channel during a job, then RMAN disregards any automatic channel settings. For example, assume that the default device type is configured to sbt, and you execute this command:

RMAN> RUN 
{
  ALLOCATE CHANNEL c1 DEVICE TYPE DISK;
  BACKUP TABLESPACE users;
}

In this case, RMAN uses only the disk channel that you manually allocated within the RUN block, overriding any defaults set by using CONFIGURE DEVICE TYPE, CONFIGURE DEFAULT DEVICE, or CONFIGURE CHANNEL settings.

See Also:

Configuring a Specific Channel for a Device Type

Besides configuring a generic channel for a device, you can also configure one or more specific channels for each device type by manually assigning your own channel numbers to the channels. Run the CONFIGURE CHANNEL n command (where n is a positive integer less than 255) to configure a specific channel. When manually numbering channels, you must specify one or more channel options (for example, MAXPIECESIZE or FORMAT) for each channel. When you use that specific numbered channel in a backup, the configured settings for that channel will be used instead of the configured generic channel settings.

Configure specific channels by number when it is necessary to control the parameters set for each channel separately. This could arise in the following situations:

Configuring Specific Channels: Examples

For example, assume that you have two tape drives and want one tape drive to use tapes from the first pool and the second tape drive to use tapes from second tape pool. You run the following commands:

CONFIGURE DEFAULT DEVICE TYPE TO sbt;    # backup goes to sbt
CONFIGURE DEVICE TYPE sbt PARALLELISM 2; # two tapes used in parallel
# configure first stream to go to data volume pool named first_pool
CONFIGURE CHANNEL 1 DEVICE TYPE sbt 
  PARMS 'SBT_LIBRARY=/mediavendor/lib/libobk.so ENV=(NSR_DATA_VOLUME_POOL=first_
pool)'; 
# configure second stream to go to data volume pool named second_pool
CONFIGURE CHANNEL 2 DEVICE TYPE sbt 
  PARMS 'SBT_LIBRARY=/mediavendor/lib/libobk.so ENV=(NSR_DATA_VOLUME_
POOL=second_pool)'; 
BACKUP DATABASE; # first stream goes to 'first_pool' and second to 'second_pool'

In this example, you want to back up to two different disks because not enough space exists on a single disk. So, you do the following:

CONFIGURE DEFAULT DEVICE TYPE TO disk;        # backup goes to disk
CONFIGURE DEVICE TYPE sbt PARALLELISM 2;      # two channels used in in parallel
CONFIGURE CHANNEL 1 DEVICE TYPE DISK FORMAT '/disk1/%U' # 1st channel to disk1 
CONFIGURE CHANNEL 2 DEVICE TYPE DISK FORMAT '/disk2/%U' # 2nd channel to disk2
BACKUP DATABASE; # backup - first channel goes to disk1 and second to disk2

Mixing Generic and Specific Channels

When parallelizing, RMAN always allocates channels beginning with CHANNEL 1 and ending with channel number equal to the PARALLELISM setting. Hence, RMAN uses a specific configuration for a given channel if you have configured it; otherwise, it uses a generic configuration.

Assume you enter the following channel configuration:

# disk channel configuration
CONFIGURE DEVICE TYPE DISK PARALLELISM 4;
CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT = '/tmp/backup_%U';
CONFIGURE CHANNEL 2 DEVICE TYPE DISK MAXPIECESIZE = 20M; 
CONFIGURE CHANNEL 4 DEVICE TYPE DISK MAXPIECESIZE = 40M; 

# sbt channel configuration
CONFIGURE DEVICE TYPE sbt PARALLELISM 3;
CONFIGURE CHANNEL DEVICE TYPE sbt 
      PARMS='SBT_LIBRARY=oracle.disksbt, ENV=(BACKUP_DIR=?/oradata)';
CONFIGURE CHANNEL 3 DEVICE TYPE sbt 
      PARMS='SBT_LIBRARY=oracle.disksbt, ENV=(BACKUP_DIR=/tmp)';

The following table illustrates the channel names and channel settings that RMAN allocates when the default device is DISK and PARALLELISM for DISK is set to 4.

Channel Name Setting

ORA_DISK_1

FORMAT = '/tmp/backup_%U'

ORA_DISK_2

MAXPIECESIZE = 20M

ORA_DISK_3

FORMAT = '/tmp/backup_%U'

ORA_DISK_4

MAXPIECESIZE = 40M

The following table illustrates the channel names and channel settings that RMAN allocates when the default device is sbt and PARALLELISM for sbt is set to 3.

Channel Name Setting

ORA_SBT_TAPE_1

PARMS='ENV=(BACKUP_DIR=?/oradata)'

ORA_SBT_TAPE_2

PARMS='ENV=(BACKUP_DIR=?/oradata)'

ORA_SBT_TAPE_3

PARMS='ENV=(BACKUP_DIR=/tmp)'

Relationship Between CONFIGURE CHANNEL and Parallelism Setting

The PARALLELISM setting is not constrained by the number of specifically configured channels. For example, if you back up to 20 different tape devices, then you can configure 20 different sbt channels, each with a manually assigned number (from 1 to 20) and each with a different set of channel options. In such a situation, you can set PARALLELISM to any value up to the number of devices, in this instance 20.

RMAN always numbers parallel channels starting with 1 and ending with the PARALLELISM setting. For example, if the default device is sbt and PARALLELISM for sbt is set to 3, then RMAN names the channels as follows:

ORA_SBT_TAPE_1
ORA_SBT_TAPE_2
ORA_SBT_TAPE_3

RMAN always uses the name ORA_SBT_TAPE_n even if you configure DEVICE TYPE sbt (not the synonymous sbt_tape). RMAN always allocates the number of channels specified in PARALLELISM, using specifically configured channels if you have configured them and generic channels if you have not.

See Also:

"Automatic Channel-Specific Configurations" for concepts about manually numbered channels, and "Configuring Specific Channels: Examples"

Clearing Channel and Device Settings

To clear a configuration is to return it to its default settings. You can clear channel and device settings by using these commands:

Each CONFIGURE ... CLEAR command clears only itself. For example, CONFIGURE DEVICE TYPE ... CLEAR does not clear CONFIGURE DEFAULT DEVICE TYPE. The CONFIGURE DEVICE TYPE ... CLEAR command removes the configuration for the specified device type and returns it to the default (PARALLELISM 1).


Note:

You cannot specify any other options when clearing a device type.


The CONFIGURE DEFAULT DEVICE TYPE ... CLEAR command clears the configured default device and returns it to DISK (the default setting).

The CONFIGURE CHANNEL DEVICE TYPE ... CLEAR command erases the channel configuration for the specified device type. RMAN does not change the PARALLELISM setting for the device type because PARALLELISM is specified through a separate CONFIGURE command.

If you have manually assigned options to automatic channels, then clear the options for these channels individually by specifying the channel number in CONFIGURE CHANNEL n DEVICE TYPE ... CLEAR. For example, assume that you run the following:

RMAN> CONFIGURE CHANNEL DEVICE TYPE DISK MAXPIECESIZE = 1800K;
RMAN> CONFIGURE CHANNEL 3 DEVICE TYPE DISK FORMAT = /tmp/%U;
RMAN> CONFIGURE CHANNEL 3 DEVICE TYPE DISK CLEAR;

In this case, RMAN clears the settings for CHANNEL 3, but leaves the settings for the generic DISK channel (the channel with no number manually assigned) intact.

See Also:

"Clearing Automatic Channel Settings"

Configuring the Maximum Size of Backup Sets and Pieces

The CONFIGURE MAXSETSIZE command limits the size of backup sets created on a channel. This CONFIGURE setting applies to any channel, whether manually or automatically allocated, when the BACKUP command is used to create backup sets.

You can set MAXSETSIZE in bytes (default), kilobytes (K), megabytes (M), and gigabytes (G). The default value is given in bytes and is rounded down to the lowest kilobyte value. For example, if you set the maximum set size to 2000, then RMAN rounds down this value to 1 kilobyte (1024 bytes). If you set the maximum set size to 2049, then RMAN rounds down this value to 2 kilobytes (2048 bytes).

The value set by the CONFIGURE MAXSETSIZE command is a default for the given channel. You can override the configured MAXSETSIZE value by specifying a MAXSETSIZE option for an individual BACKUP command.

Assume that you issue the following commands at the RMAN prompt:

CONFIGURE DEFAULT DEVICE TYPE TO sbt;
CONFIGURE CHANNEL DEVICE TYPE sbt PARMS 'ENV=(NSR_DATA_VOLUME_POOL=first_pool)'; 
CONFIGURE MAXSETSIZE TO 7500K;
BACKUP TABLESPACE users;
BACKUP TABLESPACE tools MAXSETSIZE 5G;

The results will be as follows:

Showing the Default Maximum Size of Backup Sets: SHOW MAXSETSIZE

You can use SHOW MAXSETSIZE to view the maximum backup set size set using CONFIGURE MAXSETSIZE. The size of a backup set is measured in the total bytes of the included backup pieces. After connecting to the target database and recovery catalog (if you use one), issue the SHOW MAXSETSIZE command. For example, enter:

SHOW MAXSETSIZE;      # shows the CONFIGURE MAXSETSIZE settings

Sample output for SHOW MAXSETSIZE follows:

RMAN configuration parameters are:
CONFIGURE MAXSETSIZE TO 3072K;

Configuring Backup Optimization

Run the CONFIGURE command to enable and disable backup optimization. Backup optimization skips the backup of files in certain circumstances if the identical file or an identical version of the file has already been backed up. Full details on the backup optimization algorithm are provided in "Backup Optimization".

Note that backup optimization applies only to the following commands:

You can override optimization at any time by specifying the FORCE option on the BACKUP command. For example, you can run:

BACKUP DATABASE FORCE;
BACKUP ARCHIVELOG ALL FORCE;

By default, backup optimization is configured to OFF. To enable backup optimization, run the following command:

CONFIGURE BACKUP OPTIMIZATION ON;

To disable backup optimization, run the following command:

CONFIGURE BACKUP OPTIMIZATION OFF;

To clear the current backup optimization setting, that is, return backup optimization to its default setting of OFF, run this command:

CONFIGURE BACKUP OPTIMIZATION CLEAR;

See Also:

Displaying Backup Optimization Setting: SHOW BACKUP OPTIMIZATION

You can use SHOW BACKUP OPTIMIZATION to view the current settings of backup optimization as configured with the CONFIGURE BACKUP OPTIMIZATION command. After connecting to the target database and recovery catalog (if you use one), issue the SHOW BACKUP OPTIMIZATION command. For example, enter:

SHOW BACKUP OPTIMIZATION;

Sample output for SHOW BACKUP OPTIMIZATION follows:

RMAN configuration parameters are:
CONFIGURE BACKUP OPTIMIZATION ON;

Configuring Backup Duplexing: CONFIGURE... BACKUP COPIES

Use the CONFIGURE ... BACKUP COPIES command to specify how many copies of each backup piece should be created on the specified device type for the specified type of file. This feature is known as duplexing. The CONFIGURE settings applies only to backup sets of datafiles (which includes the current control file) and archived redo logs. It does not affect image copies.


Note:

Control file autobackups on disk are a special case and are never duplexed: RMAN always creates one and only one copy.


To configure the number of backup set copies, specify an integer. The following examples show possible configurations:

# Makes 2 disk copies of each datafile and control file backup set
# (autobackups excluded)
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 2;
# Makes 3 copies of every archived redo log backup to tape
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE sbt TO 3;

If you use the duplexing feature in conjunction with multiple FORMAT strings, then you can name each individual backup set copy. For example, assume that you configure BACKUP COPIES to 3. Then, you can issue:

BACKUP DATABASE FORMAT '/tmp/%U', '?/dbs/%U', '?/oradata/%U';

RMAN generates 3 identical copies of each backup piece in the backup set, and names each piece according to the specified FORMAT string: the first copy is placed in the /tmp directory, the second in the ?/dbs directory, and the third in the ?/oradata directory. Note that you can specify the FORMAT string on the BACKUP, CONFIGURE CHANNEL, and ALLOCATE CHANNEL commands.

To return a BACKUP COPIES configuration to its default value, run the same CONFIGURE command with the CLEAR option, as in this example:

CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE sbt CLEAR;

By default, CONFIGURE ... BACKUP COPIES is set to 1 for each device type.


Note:

If you do not want to create a persistent copies configuration, then you can specify copies with the BACKUP COPIES and SET BACKUP COPIES commands.


See Also:

Showing the Configured Degree of Duplexing: SHOW... BACKUP COPIES

SHOW... BACKUP COPIES lets you view how you have used CONFIGURE ... BACKUP COPIES command to set the number of identical copies that RMAN makes of each of several types of backup.

After connecting to the target database and recovery catalog (if you use one), run the SHOW ARCHIVELOG BACKUP COPIES or SHOW DATAFILE BACKUP COPIES commands. For example, enter:

SHOW DATAFILE BACKUP COPIES;    # shows CONFIGURE DATAFILE BACKUP COPIES setting

Sample output for SHOW DATAFILE BACKUP COPIES follows:

RMAN configuration parameters are:
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE SBT_TAPE TO 1; # default
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default

Configuring Tablespaces for Exclusion from Whole Database Backups

You can run CONFIGURE EXCLUDE FOR TABLESPACE to exempt the specified tablespace from the BACKUP DATABASE command. The exclusion condition applies to any datafiles that you add to this tablespace in the future.

This tablespace exclusion feature is useful when you do not want to make a specified tablespace part of the regular backup schedule, as in these cases:

For example, you can exclude testing tablespaces cwmlite and example from whole database backups as follows:

CONFIGURE EXCLUDE FOR TABLESPACE cwmlite;
CONFIGURE EXCLUDE FOR TABLESPACE example;

If you run the following command, then RMAN backs up all tablespaces in the database except cwmlite and example:

BACKUP DATABASE;

You can still back up the configured tablespaces by explicitly specifying them in a BACKUP command or by specifying the NOEXCLUDE option on a BACKUP DATABASE command. For example, you can enter one of the following commands:

# backs up the whole database, including cwmlite and example
BACKUP DATABASE NOEXCLUDE; 
BACKUP TABLESPACE cwmlite, example;  # backs up only cwmlite and example

You can disable the exclusion feature for cwmlite and example as follows:

CONFIGURE EXCLUDE FOR TABLESPACE cwmlite CLEAR;
CONFIGURE EXCLUDE FOR TABLESPACE example CLEAR;

RMAN includes these tablespaces in future whole database backups.

Showing the Tablespaces Excluded from Backups

SHOW EXCLUDE shows how you have used the CONFIGURE EXCLUDE command to exclude tablespaces from whole database backups.

After connecting to the target database and recovery catalog (if you use one), run the SHOW EXCLUDE command. For example, enter:

RMAN> SHOW EXCLUDE;    # shows the CONFIGURE EXCLUDE setting

Sample output for SHOW EXCLUDE follows:

RMAN configuration parameters are:
CONFIGURE EXCLUDE FOR TABLESPACE 'OLD_ACCOUNTS';
See Also:

Configuring Auxiliary Instance Datafile Names: CONFIGURE AUXNAME

When performing tablespace point-in-time recovery (TSPITR) or duplicating a database using RMAN, you may want to set the names of datafiles in the auxiliary instance before startingthe actual TSPITR or database duplication.

The command for doing so is:

CONFIGURE AUXNAME FOR datafileSpec TO 'filename';

where datafileSpec identifies some datafile by its original name or datafile number, and filename is the new path for the specified file.

For example, you might configure a new auxiliary name for datafile 2 as follows:

CONFIGURE AUXNAME FOR DATAFILE 2 TO '/newdisk/datafiles/df2.df;'

As with other settings, this CONFIGURE setting is persistent across RMAN sessions until cleared using CONFIGURE... CLEAR, as shown here:

CONFIGURE AUXNAME FOR DATAFILE 2 CLEAR;

If you are performing TSPITR or running the DUPLICATE command, then by using CONFIGURE AUXNAME you can preconfigure the filenames for use on the auxiliary database without manually specifying the auxiliary filenames during the procedure.

When renaming files with the DUPLICATE command, CONFIGURE AUXNAME is an alternative to SET NEWNAME. The difference is that after you set the AUXNAME the first time, you do not need to reset the filename when you issue another DUPLICATE command: the AUXNAME setting remains in effect until you issue CONFIGURE AUXNAME ... CLEAR. In contrast, you must reissue the SET NEWNAME command every time you rename files.

See Chapter 10, "RMAN Tablespace Point-in-Time Recovery (TSPITR)" for more details on using CONFIGURE AUXNAME in connection with TSPITR, and Chapter 11, "Duplicating a Database with Recovery Manager" for more on using CONFIGURE AUXNAME in performing database duplication.

Showing the Default Filenames Configured for Auxiliary Channels

To view auxiliary datafile names currently configured for your database, you can use the SHOW AUXNAME command:

RMAN> SHOW AUXNAME;

Sample output follows:

RMAN configuration parameters are:
CONFIGURE AUXNAME FOR DATAFILE '/oracle/oradata/trgt/tools01.dbf' TO 
                               '/tmp/tools01.dbf';

Setting the Snapshot Control File Location

When RMAN needs to resynchronize from a read-consistent version of the control file, it creates a temporary snapshot control file. RMAN needs a snapshot control file only when resynchronizing with the recovery catalog or when making a backup of the current control file.

The default value for the snapshot control file is platform-specific and depends on the Oracle home. For example, the default filename on some UNIX platforms in Oracle Database 10g is $ORACLE_HOME/dbs/snapcf_@.f. Note that if you have a flash recovery area configured, the default location for the snapshot control file is not the flash recovery area.

In general, you should only need to set the control file location when you are upgrading to the current release from a release earlier than 8.1.7. In these earlier releases, the default location for the snapshot control file was not dependent on the Oracle home, whereas in the current release the default location is dependent on the Oracle home.

Default Location of the Snapshot Control File

By default, the location of the snapshot control file is determined by the rules in the following table:

If you ... Then ...

Create a new database in the current release

The snapshot control file location uses the default value. In this case, the default snapshot control file location changes if you change the Oracle home.

Upgrade to the current release from a release prior to 8.1.7

The snapshot control file location is not set to the default value. Instead, RMAN uses the snapshot location that is already stored in the control file. In this case, the snapshot control file location does not change if you change the Oracle home.



Viewing the Configured Location of the Snapshot Control File

You can see the current snapshot location by running the SHOW command. This example shows a snapshot location that is determined by the default rule:

RMAN> SHOW SNAPSHOT CONTROLFILE NAME;
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/oracle/dbs/snapcf_trgt.f'; # default

This example shows a snapshot control file that has a nondefault filename:

RMAN>  SHOW SNAPSHOT CONTROLFILE NAME;
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/oracle/oradata/trgt/snap_trgt.ctl';

Setting the Location of the Snapshot Control File

Use the CONFIGURE SNAPSHOT CONTROLFILE NAME TO 'filename' command to change the name of the snapshot control file. Subsequent snapshot control files that RMAN creates use the specified filename.

For example, start RMAN and then enter:

CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/oracle/oradata/trgt/snap_trgt.ctl';

You can also set the snapshot control file name to a raw device:

CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/dev/vgd_1_0/rlvt5';

If one RMAN job is already backing up the control file while another needs to create a new snapshot control file, you may see the following message:

waiting for snapshot controlfile enqueue

Under normal circumstances, a job that must wait for the control file enqueue waits for a brief interval and then successfully retrieves the enqueue. Recovery Manager makes up to five attempts to get the enqueue and then fails the job. The conflict is usually caused when two jobs are both backing up the control file, and the job that first starts backing up the control file waits for service from the media manager.

See Also:

"Backup Fails Because of Control File Enqueue: Scenario", Oracle Real Application Clusters Administrator's Guide for handling of snapshot control files in RAC configurations, and Oracle Database Recovery Manager Reference for CONFIGURE syntax

To reset the snapshot control file location to the default, run the CONFIGURE SNAPSHOT CONTROLFILE LOCATION CLEAR command.

Showing the Current Snapshot Control File Name

Issue the SHOW SNAPSHOT CONTROLFILE command to display the value set by CONFIGURE SNAPSHOT CONTROLFILE NAME.


Note:

In releases prior to Oracle9i, the CONFIGURE SNAPSHOT CONTROLFILE command was called SET SNAPSHOT CONTROLFILE.


To show the snapshot control file filename:

After connecting to the target database and recovery catalog (if you use one), run the SHOW SNAPSHOT CONTROLFILE command. For example, enter:

SHOW SNAPSHOT CONTROLFILE NAME;   # shows CONFIGURE SNAPSHOT CONTROLFILE setting

Sample output for SHOW SNAPSHOT CONTROLFILE follows:

RMAN configuration parameters are:
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/oracle/dbs/cf_snap.f';
See Also:

"Setting the Snapshot Control File Location" to learn about the snapshot control file and its function

Setting Up RMAN for Use with a Shared Server

RMAN cannot connect to the target database through a shared server dispatcher. RMAN requires a dedicated server process. Nevertheless, you can connect specified sessions to dedicated servers, even when the target is configured for a shared server.

To ensure that RMAN does not connect to a dispatcher when the target database is configured for a shared server, the net service name used by RMAN must include (SERVER=DEDICATED) in the CONNECT_DATA attribute of the connect string.

Oracle Net configuration varies greatly from system to system. The following procedure illustrates only one method. This scenario assumes that the following service name in the tnsnames.ora connects to the target database using the shared server architecture, where inst1 is a value of the SERVICE_NAMES initialization parameter:

inst1_shs =
  (DESCRIPTION=
    (ADDRESS=(PROTOCOL=tcp)(HOST=inst1_host)(port1521))

(CONNECT_DATA=(SERVICE_NAME=inst1)(SERVER=shared))

)

To use RMAN with a shared server:

  1. Create a net service name in the tnsnames.ora file that connects to the nonshared SID. For example, enter:
    inst1_ded =
      (DESCRIPTION=
        (ADDRESS=(PROTOCOL=tcp)(HOST=inst1_host)(port1521))
        (CONNECT_DATA=(SERVICE_NAME=inst1)(SERVER=dedicated))
      )
    
    
  2. Start SQL*Plus and then connect using both the shared server and dedicated server service names to confirm the mode of each session. For example, to connect to a dedicated session you can issue:
    CONNECT SYS/oracle@inst1_ded
    SELECT SERVER 
      FROM V$SESSION 
      WHERE SID = (SELECT DISTINCT SID FROM V$MYSTAT);
    
    SERVER   
    ---------
    DEDICATED
    1 row selected.
    
    

    To connect to a shared server session, you can issue:

    CONNECT SYS/oracle@inst1_shs AS SYSDBA
    SELECT SERVER 
      FROM V$SESSION 
      WHERE SID = (SELECT DISTINCT SID FROM V$MYSTAT);
    
    SERVER   
    ---------
    SHARED 
    1 row selected.
      
    
  3. Connect to the target database (and optionally the recovery catalog) with the dedicated service name. For example, enter:
    % rman TARGET SYS/oracle@inst1_ded CATALOG rman/cat@catdb
    
    See Also:

    Your operating system-specific Oracle documentation and your Oracle Net Services Reference Guide for a complete description of Oracle Net connect string syntax