This chapter describes how to perform setup and configuration tasks. This chapter contains these topics:
See Also:
Oracle Database Backup and Recovery Basics for basic RMAN configuration informationTo 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
Configuring Control File Creation in the Flash Recovery Area
The following statements can create online redo logs in the flash recovery area:
CREATE DATABASE
ALTER DATABASE ADD LOGFILE
ALTER DATABASE ADD STANDBY LOGFILE
ALTER DATABASE OPEN RESETLOGS
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.
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.
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:
Enable archiving to the flash recovery area only and use disk mirroring to create the redundancy needed to protect the archived redo logs.
Enable archiving to the flash recovery area and set other LOG_ARCHIVE_DEST_
n
initialization parameter to locations outside the flash recovery area.
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.
The interactions among different initialization parameters affecting redo log archiving distinctions are as follows:
If LOG_ARCHIVE_DEST
(and, optionally, LOG_ARCHIVE_DUPLEX_DEST
) is set, these parameters will specify the only redo log archiving destinations.
If DB_RECOVERY_FILE_DEST
is specified (that is, if a flash recovery area is configured) and no LOG_ARCHIVE_DEST_
n
is specified, then LOG_ARCHIVE_DEST_10
is implicitly set to the flash recovery area. (You can override this behavior 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 default. If you have a flash recovery area configured, you can explicitly add the flash recovery area to the set of archiving destinations by setting one of the LOG_ARCHIVE_DEST_
n
parameters to LOCATION=USE_DB_RECOVERY_FILE_DEST
(note that this does not have to be LOG_ARCHIVE_DEST_10
).
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.
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:
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 Oracle 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 for the control file autobackup location on disk. Control file autobackups will be placed in the flash recovery area when no other destination is configured.
RESTORE ARCHIVELOG
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 this behavior, then restored archived redo log files will be stored in the flash recovery area.
RECOVER DATABASE
or TABLESPACE
, BLOCKRECOVER
, and FLASHBACK DATABASE
These commands restore archived redo logs from backup for use during media recovery, as required by the command. RMAN restores any redo log files 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_ARCHIVE_DEST_
n
parameters to 'LOCATION=USE_DB_RECOVERY_FILE_DEST
", and make sure you are not using SET ARCHIVELOG DESTINATION
to direct restored archived logs to some other destination.
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:
Locating the Media Management Library: The SBT_LIBRARY Parameter
Testing Whether the Media Manager Library Is Integrated Correctly
Configuring SBT Channels for Use with a Media Manager
See Also:
"Media Management" for an overview of media management software and its implications for RMANBefore 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.
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:
Your operating system specific database documentation and the documentation supplied by your media vendor for instructions on how to achieve media manager integration on your platform
"After Installation of Media Manager, RMAN Channel Allocation Fails: Scenario" for troubleshooting scenarios involving media manager problems
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:
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:
Oracle Database Backup and Recovery Reference for ALLOCATE
CHANNEL
syntax
Oracle Database Backup and Recovery Reference for channel control options
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.
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 specialFORMAT
strings. The unique backup piece names generated by %U
are less than 14 characters.See Also:
Oracle Database Backup and Recovery Reference for the complete list of variables allowable in format strings with theBACKUP
commandSome 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 Backup and Recovery Reference and "Size of Backup Pieces"for details on how to setMAXPIECESIZE
Use the following steps to confirm that RMAN is able to load the media management library when allocating a channel for your media manager.
Start RMAN and connect to the target database. For example, enter:
% rman TARGET /
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 scenarioAfter 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 managerThis section describes how to configure channels specifically for use with a media manager. For an overview of configured channels and how they are used, refer to the section "Configuring Channels". The following setup procedure references the sections in "Configuring Channels" where it is appropriate.
To configure channels for use with a media manager:
Configure a generic channel of DEVICE
TYPE
sbt
as described in "Configuring Channel Settings 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";
After configuring the channel, test by backing up something small, such as the control file:
RMAN> BACKUP DEVICE TYPE sbt CURRENT CONTROLFILE;
Check your configuration by running the following command:
RMAN> SHOW CHANNEL FOR DEVICE TYPE sbt;
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;
After configuring the default device, make a test backup to determine whether it is really going to the media manager:
RMAN> BACKUP CURRENT CONTROLFILE;
Check your configuration by running the following command:
RMAN> SHOW DEFAULT DEVICE TYPE;
If you use more than one tape device, then you must specify the channel parallelism as described in "Configuring Channel Parallelism". 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;
You can configure persistent settings for your channels, such as channel parameters, parallelism, and the default device type for backups. The configured settings are stored in the RMAN repository. If you configure channel settings, then you do not have to use ALLOCATE CHANNEL commands with every RMAN backup, restore, recovery or maintenance command. Configuring persistent channel settings greatly simplifies the use of RMAN.
You can always override configured channels with ALLOCATE
CHANNEL
for a particular backup job surrounded by a RUN block.
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 configured and allocated channels, and Oracle Database Backup and Recovery Reference for syntaxConfiguring parallelism for a device type specifies the number of server sessions to be used for I/O to that device type. By default, channel parallelism for each configured device is set to 1
. As a rule, allocating one channel for each physical device is best. 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.
By default, RMAN allocates a one DISK
channel with default options, and uses it for backup commands.
Note:
This disk channel allocated by default is not the same channel as the default channel, a disk channel which RMAN creates when it first connects to the target instance, and generally does not use for activities such as backups and restores that require large amounts of I/O.However, you may want to change the default DISK
channel settings, for example, to specify a degree of parallelism or output locations for disk backups. Also, if you use a media manger, you must configure any required options for it, such as PARMS
, FORMAT
, MAXPIECESIZE
, and so forth. By configuring channel settings, you define which parameters are used for channels RMAN allocates when you use configured channels for a backup job.
Use the CONFIGURE
CHANNEL
command to configure options for DISK
and sbt
channels. CONFIGURE
CHANNEL
takes the same options used to specify one-time options with ALLOCATE
CHANNEL
.
For example, you can configure default parameters for 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)';
You can configure generic channel settings for a device type, that is, a template that is used for any channels created based on configured settings for that device. If you set the PARALLELISM
for a device, and then make the device default, then RMAN uses the generic configured channel settings for each parallelized channel.
Note that if you use CONFIGURE
CHANNEL
to specify generic channel settings for a device, any previous settings are discarded, even if the settings are not in conflict. For example, after the second CONFIGURE
CHANNEL
command, which specifies only a FORMAT for configured disk channels, the MAXPIECESIZE
for the disk channel is returned to its default value:
RMAN> CONFIGURE CHANNEL DEVICE TYPE DISK MAXPIECESIZE 2G; RMAN> CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT = /tmp/%U;
You can also configure default settings for individual channels from a group of parallelized channels by specifying a channel number.
The SHOW
CHANNEL
, SHOW
DEVICE
TYPE
and SHOW
DEFAULT
DEVICE
TYPE
commands are used to display the current configured channel settings.
After connecting to the target database and recovery catalog (if you use one), issue the SHOW
CHANNEL
command to display the currently configured channel settings. For example, connect the RMAN client to the target and, if applicable, the recovery catalog. Then enter:
RMAN> SHOW CHANNEL;
Sample output for SHOW
CHANNEL
follows:
RMAN configuration parameters are: CONFIGURE CHANNEL DEVICE TYPE SBT RATE 1500K;
Issue the SHOW
DEVICE
TYPE
command to display the configured devices and their PARALLELISM
and backup type settings.
To show the default device type and currently configured settings for disk and sbt devices:
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 DISK PARALLELISM 2 BACKUP TYPE TO COPY; CONFIGURE DEVICE TYPE 'SBT_TAPE' PARALLELISM 2 BACKUP TYPE TO BACKUPSET;
Note:
As with allSHOW
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 Backup and Recovery Reference for details on all of the possible ways of combining arguments to the CONFIGURE
command.Issue the SHOW
DEFAULT
DEVICE
TYPE
command to display the settings for the default device type for backups. 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 backups:
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';
If you manually allocate a channel during a job, then RMAN disregards any configured 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:
"About RMAN Channels" to learn about configured and allocated channels
Oracle Database Backup and Recovery Reference for ALLOCATE
syntax
Oracle Database Backup and Recovery Reference' for CONFIGURE
syntax
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:
When running a Real Application Clusters (RAC) configuration in which individual nodes do not have access to the full set of backups, so different nodes must be configured with different connect strings so that all backups are accessible from some node
When running a Real Application Cluster and using a media manager with multiple tape drives requiring different PARMS
settings
In this example, you want to send disk backups to two different disks. Configure disk channels as follows:
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
In this example, assume that you have two tape drives and want each tape drive to use tapes from a different tape pool. Configure your default output device and default sbt channels as follows:
CONFIGURE DEFAULT DEVICE TYPE TO sbt; # backup goes to sbt CONFIGURE DEVICE TYPE sbt PARALLELISM 2; # two sbt channels will be allocated by default # Assume media manager takes NSR_DATA_VOLUME_POOL to # specify a pool # Configure channel 1 to 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 channel 2 to 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'
When parallelizing, RMAN always allocates channels beginning with CHANNEL
1
and ending with channel number equal to the PARALLELISM
setting.
If you configure settings for a specific channel using CONFIGURE
CHANNEL
with a channel number, RMAN uses those specified configured settings. Otherwise, it uses the generic configuration for channels for that device type, as specified by the CONFIGURE
CHANNEL
command without a channel number.
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)' |
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"To clear a configuration is to return it to its default settings. You can clear channel and device settings by using these commands:
CONFIGURE
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 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 configured 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 "The CONFIGURE
MAXSETSIZE
command limits the size of backup sets created on a channel. This CONFIGURE
setting applies to any channel, whether manually allocated or configured, 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:
The backup of the users
tablespace uses the configured sbt
channel and the configured default MAXSETSIZE
setting of 7500K
.
The backup of the tools
tablespace uses the MAXSETSIZE
setting of 5G
used in the BACKUP
command.
Note:
There is no equivalent toMAXSETSIZE
for controlling the size of image copies. Since an image copy is an exact duplicate of the file being backed up, its size must be identical to the source file.
This fact can present 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 file.
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;
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:
BACKUP
DATABASE
BACKUP
ARCHIVELOG
with ALL
or LIKE
options
BACKUP
BACKUPSET
ALL
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:
"Backup Optimization Algorithm" for the complete criteria that determine whether a file is identical and the conditions under which backup optimization is operative
"Backing Up Files Using Backup Optimization" for examples of how to optimize RMAN backups
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;
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
setting s for duplexing only affect backups of datafiles, control files and archived logs into backup sets, and do 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 theBACKUP
COPIES
and SET
BACKUP
COPIES
commands.See Also:
"Manual Parallelization of Backups" for concepts
Oracle Database Backup and Recovery Reference for BACKUP
syntax
Oracle Database Backup and Recovery Reference for CONFIGURE
syntax
Oracle Database Backup and Recovery Reference for SET
syntax
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
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 tablespace 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
:
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.
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:
Oracle Database Backup and Recovery Reference for BACKUP
syntax
Oracle Database Backup and Recovery Reference for CONFIGURE
syntax
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 8, "RMAN Tablespace Point-in-Time Recovery (TSPITR)" for more details on using CONFIGURE
AUXNAME
in connection with TSPITR, and Chapter 13, "Creating and Updating Duplicate Databases with RMAN" for more on using CONFIGURE
AUXNAME
in performing database duplication.
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';
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 snapshot 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.
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. |
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';
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 control file 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 Database Oracle Clusterware and Oracle Real Application Clusters Administration and Deployment Guide for handling of snapshot control files in RAC configurations, and Oracle Database Backup and Recovery Reference forCONFIGURE
syntaxTo reset the snapshot control file location to the default, run the CONFIGURE
SNAPSHOT
CONTROLFILE
LOCATION
CLEAR
command.
Issue the SHOW
SNAPSHOT
CONTROLFILE
command to display the value set by CONFIGURE SNAPSHOT CONTROLFILE NAME
.
Note:
In releases prior to Oracle9i, theCONFIGURE
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 functionRMAN 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:
Create a net service name in the tnsnames.ora
file that connects to the non-shared SID. For example, enter:
inst1_ded = (DESCRIPTION= (ADDRESS=(PROTOCOL=tcp)(HOST=inst1_host)(port1521)) (CONNECT_DATA=(SERVICE_NAME=inst1)(SERVER=dedicated)) )
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.
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 platform-specific Oracle documentation and your Oracle Database Net Services Reference for a complete description of Oracle Net connect string syntax