Skip Headers

Oracle® Database Backup and Recovery Advanc ed 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< /a>
Go to next page
Next
View PDF

6
Configuri ng the RMAN Environment: Advanced Topics

This chapter describ es 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 backu p and restore operations.

This section contains the following topics:

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

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

The initialization par ameters 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 paramet ers on online redo log creation can be found inOracle Database SQL Reference in the description of the LOGFILE clause of the C REATE 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 de termine the location where the database control files are created.

For a full description o f 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 serv er parameter file, then the database sets the CONTROL_FILES initialization parameter in the server parameter file. If th e database uses a client-side initialization parameter file, then you must set the CONTROL_FILES initialization paramete r 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 log s are automatically managed by the database. Whatever archiving scheme you choose, it is always advisable to create multiple copies o f archived logs.

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

  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< /em> initialization parameter to locations outside the flash recovery area.
  3. Set LOG_ARCHIVE_DEST_n initialization parameters to archive only to n on-flash recovery area locations.

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

Rules for Initialization Parameters Affect ing Redo Log File Destinations

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

  • If LOG_ARCHIVE_DEST (and, optionally, LOG_ARCHIVE_DUPLEX_DEST) is set, these parameters w ill specify the only redo log archiving destinations.
  • If DB_RECOVERY_FIL E_DEST is specified (that is, if a flash recovery area is configured) and no LOG_ARCHIVE_DEST_n< /em> is specified, then LOG_ARCHIVE_DEST_10 is implicitly set to the flash recovery area. (You can override this behavio r by explicitly setting LOG_ARCHIVE_DEST_10 to an empty string.)
  • If you set any local destinations for LOG_ARCHIVE_DEST_n, then archived redo logs are stored only in the destinations you specify using those parameters. In this case, redo log files are not archived in the flash recovery area by d efault. If you have a flash recovery area configured, you can explicitly add the flash recovery area to the set of archiving destinat ions by setting one of the LOG_ARCHIVE_DEST_n parameters to LOCATION=USE_DB_RECOVERY_FILE_DE ST (note that this does not have to be LOG_ARCHIVE_DEST_10).
  • < /a>If you do not set any value for LOG_ARCHIVE_DEST, LOG_ARCHIVE_DEST_n, or DB_ RECOVERY_FILE_DEST, then the redo logs are archived to a default location that is platform-specific. On Solaris, for example, the default is ?/dbs.

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 Filename s 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 cre ate 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:

  • BACKUP

    Do not specify a FORMAT option to the BACKUP command, and do not configure a FORMAT option for disk backups. In such a case, RMAN creates backup pieces and image copies in the flash recovery area, with names in Orac le Managed Files name format.

  • Control File Autobackup

    RMAN can create control file autobackups in the flash recovery area. Use the RMAN command CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK CLEAR to clear any configured format option fo r the control file autobackup location on disk. Control file autobackups will be placed in the flash recovery area when no other dest ination is configured.

  • RESTORE ARCHIVELOG < p>

    Explicitly or implicitly (as in the case of ), set one of the LOG_ARCHIVE_DEST_n) parameters to 'LOCATION=USE_DB_RECOVERY_FILE_DEST'. If you do not specify SET ARCHIVELOG DESTINATION to override t his behavior, then restored archived redo log files will be stored in the flash recovery area.

  • < a name="1014239">RECOVER DATABASE or TABLESPACE, BLOCKR ECOVER, and FLASHBACK DATABASE

    These comm ands restore archived redo logs from backup for use during media recovery, as required by the command. RMAN restores any redo log fil es needed during these operations to the flash recovery area, and delete them once they are applied during media recovery.

    To direct the restored archived redo logs to the flash recovery area, set one of the LOG_ARCHI VE_DEST_n parameters to 'LOCATION=USE_DB_RECOVERY_FILE_DEST", and make sure you are not usi ng SET ARCHIVELOG DESTINATION to direct restored archived logs to some other destination.

Configurin g 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 manag er 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 ge neric steps for configuring RMAN for use with a media manager. The actual steps depend on the media management product that you insta ll and the platform on which you are running the database.

Read the following sections in o rder 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 Correctl y
  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 fo r Using a Media Manager with RMAN

Before you can begin using RMAN wi th a media manager, you must install it and make sure that RMAN can communicate with it. Instructions for this procedure should be av ailable 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-RM AN backups of operating system files on the target database host. This step makes later troubleshooting much easier, by confirming th at 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 instal l 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 purcha sed separately. Contact your media management vendor for details.

< font face="Arial, Helvetica, sans-serif" color="#330099">Locating the Media Management Library: The SBT_LIBRARY Parameter

When allocating or configuring channels for RMAN to use to communicate with a m edia 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 loc ation 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 th e location specified by the SBT_LIBRARY parameter or the default location, then RMAN issues an ORA-27211 er ror and exits.

Whenever channel allocation fails, the database writes a trace file to the < code>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 In tegrated 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 med ia management library is described in the following sections:

Configuring Media Management Software for RMAN B ackups

After installing the media management software, perform whate ver configuration that your vendor requires so that the software can accept RMAN backups. Depending on the type of media management s oftware 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-spec ific 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 restri ctions on file names and sizes imposed by your media manager, you may need to configure RMAN settings that control the naming and siz e 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 na mes. A backup piece name is determined by the FORMAT string specified in the BACKUP command, the CONF IGURE 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.

< a name="1006666">
Note: < p class="NB">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 f or 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 lar ger than limits imposed by your media manager.

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



Testing ALLOCATE CHANNEL on the Media Manager

Use the follow ing 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 ex ample, 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=(N
    SR_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 rec eive the ORA-27211 error, the media management library could not be loaded:

RM
AN-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 all
ocating 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_LIB RARY parameter as described in "Locating the Media Management Library: The SBT_LIBRARY Parameter"< a href="rcmconfg.htm#1012649">.

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

See Also:

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

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 channe l 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 CHA
NNEL 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 s oftware that you are using.

If the backup succeeds, then you are ready to make backups to y our 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 m edia 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 corr ectly done. Refer to "Backup Job Is Hanging: Scenario" if the p roblem persists.

The backup fails with an ORA-19511

This error i ndicates that the media management software is not correctly configured. Ensure that the steps in "Con figuring RMAN to Make Backups to a Media Manager" are correctly done. Also, ensure that you ha ve 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 ab out 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 < a href="rcmconfg.htm#1006908">"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 Back up to the Media Manager". For example, assume that your media vendor requires PARMS settings as follows:
    RMAN> CONFIGURE CHANNEL DEVICE TYPE sbt 
    PAR
    MS='SBT_LIBRARY=/mediavendor/lib/libobk.so ENV=(NSR_SERVER=tape_svr,NSR_
    CLIENT=oracleclnt,NSR_GROUP=ora_tapes)' 
    <
    /a>  FORMAT "BACKUP_%U";
    
    
  2. After configuri ng the channel, test by backing up something small, such as the control file:
    RMAN> BACKUP
     DEVICE TYPE sbt CURRENT CONTROLFILE;
    
    
  3. Ch eck your configuration by running the following command:
    RMAN> SHOW CHANNEL FOR DEVICE TYP
    E sbt;
    
    
  4. Configure the default device to < code>sbt so that RMAN sends all backups to the media manager. For example:
    RMAN> CO
    NFIGURE 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 man ager:
    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 wa nt 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 ch annels 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 an y manual configuration. You may, however, want to parallelize the channels for disk or tape devices to improve performance.

< /a>See Also:

"About RMAN Channels" for a conceptual overview of automatic and man ual channels, and Oracle Datab ase Recovery Manager Reference for syntax



Configuring Parallelism for Automatic Channels

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

The CONFIGURE DEVICE T YPE ... PARALLELISM integer command specifies how many channels (up to 254) RM AN 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:

<
a name="1008641">RMAN> CONFIGURE DEFAULT DEVICE TYPE TO sbt; # default backup device is tape
RMAN> CO
NFIGURE 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.

Configuring a Generic Automatic Channel for a Device Type

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

< /a>

Use the CONFIGURE CHANNEL command to configure automatic channel options for the availab le 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 ca n configure generic disk and tape channels as in this example:

RMAN> CONFIGURE CHANNEL D
EVICE 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 templ ate 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, the n erases this setting and sets a FORMAT:

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

Configured Channels and the Def ault Device Type

The automatic channel that RMAN allocates for its b ackups depends on the default device type. If the default device type is DISK, then RMAN uses the DISK chan nel 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 fo r 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 FO RMAT 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 par
allel
CONFIGURE CHANNEL DEVICE TYPE                # sets parameters for all channels
  P
ARMS 'SBT_LIBRARY=/mediavendor/lib/libobk.so ENV=(NSR_DATA_VOLUME_
POOL=oracle_tapes)' FORMAT '%U_backup';
BACK
UP DATABASE;                             # backs up database

Showing the Automatic Channel Configuration Settings

Showing the Automatic Channel Settings

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

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

Sample output for S HOW CHANNEL follows:

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

< h4 class="H3">Showing the Configured Device Types

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 TYP E command. This default device type setting is not in effect when you use commands other than BACKUP. Note that y ou 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 DE
FAULT 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 Co nfigured Channels

If you manually allocate a channel during a job, t hen 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 th e RUN block, overriding any defaults set by using CONFIGURE DEVICE TYPE, CO NFIGURE 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 num bering channels, you must specify one or more channel options (for example, MAXPIECESIZE or FORMAT) for eac h 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 n ecessary to control the parameters set for each channel separately. This could arise in the following situations:

  • When running a Real Application Clusters (RAC) configuration, in which multiple n odes back up the cluster requiring different connect strings
  • When running a Re al Application Cluster and using a media manager with multiple tape drives requiring different PARMS settings

Configuring S pecific Channels: Examples

For example, assume that you have two tap e 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 r un 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 str
eam to go to data volume pool named first_pool
CONFIGURE CHANNEL 1 DEVICE TYPE sbt 
  PAR
MS '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 str
eam goes to 'first_pool' and second to 'second_pool'

In this exam ple, 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 FOR
MAT '/disk1/%U' # 1st channel to disk1 
CONFIGURE CHANNEL 2 DEVICE TYPE DISK FORMAT '/disk2/%U' # 2nd channel t
o disk2
BACKUP DATABASE; # backup - first channel goes to disk1 and second to disk2
< /a>

Mixing Generic and Specific Chann els

When parallelizing, RMAN always allocates channels beginning wit h 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 chann
el 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
<
a name="1007100">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 s
bt 
      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 R MAN allocates when the default device is sbt and PARALLELISM for sbt is set to 3.

Relations hip Between CONFIGURE CHANNEL and Parallelism Setting

The PARA LLELISM setting is not constrained by the number of specifically configured channels. For example, if you back up to 20 differ ent 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 nu mber of devices, in this instance 20.

RMAN always numbers parallel channels starting with < code>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 con figure DEVICE TYPE sbt (not the synonymous sbt_tape). RMAN always allocates the n umber of channels specified in PARALLELISM, using specifically configured channels if you have configured them and gener ic channels if you have not.

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

< /td>

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

See Als o:

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

Clearing Channel and Device Settings

< !--/TOC=h2-->

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

  • CONF IGURE DEVICE TYPE ... CLEAR
  • CONFIGURE DEFAULT DEVICE TYPE CLEAR
  • CONFIGURE CHANNEL DEVICE TYPE ... CLEAR
  • CONFIGURE CHANNEL n DEVICE TYPE ... CLEAR (where n is an integer)
  • Each CONFIGURE ... CLEAR command clears only itself. For example, CONFIGURE DEVICE TYPE ... CLEAR does not clear C ONFIGURE DEFAULT DEVICE TYPE. The CONFIGURE DEVICE TYPE ... CLEAR command removes the configuration for the specified device type and returns it to the def ault (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< /code> (the default setting).

    The CONFIGURE CHANNEL DEVICE< /code> 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 automati c channels, then clear the options for these channels individually by specifying the channel number in CONFIGURE C HANNEL n DEVICE TYPE ... CLEAR. For example, assume that you run the following:

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

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

    Configuring the Maximum Size of Backup Sets and Pieces< /a>

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

    You can se t 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 t o 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 t his 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 MA XSETSIZE 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 MAXSET
    SIZE TO 7500K;
    BACKUP TABLESPACE users;
    BACKUP TABLESPACE tools MAXSETSIZE 5G;
    
    

    The results will be as follows:

    • The backup of the users tablespace uses the automatic sbt channel and the confi gured default MAXSETSIZE setting of 7500K.
    • The backu p of the tools tablespace uses the MAXSETSIZE setting of 5G used in the BACKUP co mmand.

      Note:

      Th ere is no equivalent to MAXSETSIZE for controlling the size of image copies. Since an image copy is an exact duplicate o f the file being backed up, its size must be identical to the source file.

      This fact can pre sent a problem with some older operating systems which limit the size of individual files. If you are using a raw partition to store a 10GB datafile, and your operating system only supports 4GB files on the file system, you cannot take image copy backups of that fil e.


      < /table>

      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 MAXSETSIZ E. The size of a backup set is measured in the total bytes of the included backup pieces. After connecting to the target datab ase 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 Opt imization

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

      Note that bac kup optimization applies only to the following commands:

      • BACKUP DATABASE
      • BACKUP ARCHIVELOG with ALL or LIKE options
      • BACKUP BACKUPSET ALL

      You can override optimization at any time by spec ifying 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 BA
      CKUP OPTIMIZATION OFF;
      
      

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

      CONFIGURE BACKUP OPTIMIZATION CLEAR;
      
      
      See Also:

      Oracle Database Recovery Manager Reference for BACKUP syntax

      See Also:

      Displaying Backup Optimization Setting : SHOW BACKUP OPTIMIZATION

      You can use SHOW BACKUP OPTIMIZATIO N 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 O
      PTIMIZATION;
      
      

      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 backu p 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 o nly one copy.


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

      # Makes 2 disk copie
      s of each datafile and control file backup set
      # (autobackups excluded)
      CONFIGURE DATAFIL
      E 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 iss ue:

      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 p iece according to the specified FORMAT string: the first copy is placed in the /tmp directory, the second i n 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 defaul t value, run the same CONFIGURE command with the CLEAR option, as in this example:

      CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE sbt CLEAR;
      
      
      < p class="BP">By default, CONFIGURE ... BACKUP COPIES is set to 1 for each device type.


      Note: < a name="1014996">

      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.


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

      SHOW... BACKUP COPIES lets you view how you have used CONFIGURE ... BA CKUP 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 S HOW ARCHIVELOG BACKUP COPIES or SHOW DATAFILE BACKUP COPIES commands. For example, enter:

      SHOW DATAFILE BACKUP COPIES;    # sh
      ows 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 Exclus ion 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:

      • A tablespac e is easy to rebuild, so it is more cost-effective to rebuild it than back it up every day.
      • A tablespace contains temporary or test data that you do not need to back up.
      • A tablespace does not change often and therefore should be backed up on a different schedule from other backups.
      • 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:< /p>

        BACKUP DATABASE;
        
        

        You ca n 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 comma nds:

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

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

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

        RMAN includes th ese tablespaces in future whole database backups.

        Showing the Tablespaces Excluded from Backups

        < /a>

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

        After connecting to the target database and rec overy 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 conf
        iguration parameters are:
        CONFIGURE EXCLUDE FOR TABLESPACE 'OLD_ACCOUNTS';
        
        < a name="1015263">

        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 speci fied 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 sess ions until cleared using CONFIGURE... CLEAR, as shown here:

        CONFI
        GURE AUXNAME FOR DATAFILE 2 CLEAR;
        
        

        If you are performing TSPITR o r 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 w hen you issue another DUPLICATE command: the AUXNAME setting remains in effect until you issue CONFIG URE AUXNAME ... CLEAR. In contrast, you must reissue the SET NEWNAME command every time you rename f iles.

        See Chapter 10, "RMAN Tablespace Point-in-Time Re covery (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

        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 o r when making a backup of the current control file.

        The default value for the snapshot cont rol file is platform-specific and depends on the Oracle home. For example, the default filename on some UNIX platforms in Oracle Data base 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 Fi le

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

        If you ... Then ...

        Create a new dat abase in the current release

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

        Upgrade to the current rel ease from a release prior to 8.1.7

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



        Viewing the Configu red Location of the Snapshot Control File

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

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

        This exampl e shows a snapshot control file that has a nondefault filename:

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

        Setting the Location of t he Snapshot Control File

        Use the CONFIGURE SNAPSHOT CONTROLFIL E NAME TO 'filename' command to change the name of the snapshot c ontrol 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/o
        radata/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 anothe r needs to create a new snapshot control file, you may see the following message:

        waiting f
        or 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 u p the control file, and the job that first starts backing up the control file waits for service from the media manager.

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

        Showing the Current Snapshot Control File Name

        Issue the SHOW SNAPSHO T 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;   # s
        hows CONFIGURE SNAPSHOT CONTROLFILE setting
        
        

        Sample output for SHOW SNAPSHOT CONTROLFILE follows:

        RMAN configuration p
        arameters are:
        CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/oracle/dbs/cf_snap.f';
        
        < div align="center">
        See Also:

        < a href="rcmconfg.htm#1015611">"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 wh en 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 configurat ion varies greatly from system to system. The following procedure illustrates only one method. This scenario assumes that the followi ng service name in the tnsnames.ora connects to the target database using the shared server architecture, where in st1 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=inst
          1)(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 s ession. For example, to connect to a dedicated session you can issue:
          CONNECT SYS/oracle@inst
          1_ded
          SELECT SERVER 
            FROM V$SESSION 
            WHERE SID = (SELECT DISTIN
          CT SID FROM V$MYSTAT);
          
          SERVER   
          ---------
          D
          EDICATED
          1 row selected.
          
          

          To connect to a s hared 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 th e 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-specif ic Oracle documentation and your Oracle Net Serv ices Reference Guide for a complete description of Oracle Net connect string syntax