Oracle® Database Backup and Recovery Reference 11g Release 1 (11.1) Part Number B28273-01 |
|
|
View PDF |
Purpose
Use the CONFIGURE
command to create or change a persistent configuration affecting RMAN backup, restore, duplication, and maintenance jobs on a particular database. A configuration is in effect for any RMAN session on this database until the configuration is explicitly cleared or changed. You can use the SHOW
command to display the configurations for one or more databases.
See Also:
Oracle Database Backup and Recovery User's Guide to learn how to configure the RMAN environmentAdditional Topics
Prerequisites
Execute this command only at the RMAN prompt.
Unless you specify the FOR DB_UNIQUE_NAME
clause, a connection as TARGET
is required. The target database must be mounted or open.
Usage Notes
The CONFIGURE
command always stores a configuration for a target database in the target database control file. If you use RMAN with a recovery catalog, then RMAN also stores persistent configuration settings for each registered database in the catalog.
Default RMAN Configuration Settings
The RMAN CONFIGURE
settings have defaults. You can return to the default for any CONFIGURE
command by rerunning the command with the CLEAR
option, but you cannot clear individual parameters in this way. For example, you can run CONFIGURE
CHANNEL
DEVICE
TYPE
sbt
CLEAR
but not CONFIGURE
CHANNEL
DEVICE
TYPE
sbt
MAXPIECESIZE
5M
CLEAR
.
RMAN Configuration in a Data Guard Environment
In a Data Guard environment, Oracle recommends that you always use RMAN with a recovery catalog. You can use the CONFIGURE
command to create persistent RMAN configurations for any individual primary or standby database in the Data Guard environment, with the exception of settings for backup retention policy, tablespace exclusion, and auxiliary names. Thus, the primary and standby databases can have different channel configurations, control file autobackup locations, and so on.
You can use the FOR DB_UNIQUE_NAME
clause to configure a database to which RMAN is not connected as TARGET
. You can use CONFIGURE DB_UNIQUE_NAME
to make a new physical standby database known to the recovery catalog and implicitly register it.
Syntax
configure::=
(datafileSpec::=, backupConf::=, cfauConf::=, deviceConf::=, forDbUniqueNameOption::=)
delalConf::=
backupConf::=
(deviceSpecifier::=, sizeSpec::=)
cfauConf::=
(deviceSpecifier::=, formatSpec::=)
deviceConf::=
(deviceSpecifier::=, allocOperandList::=)
sizeSpec::=
Semantics
configure
Syntax Element | Description |
---|---|
DB_UNIQUE_NAME
|
Specifies the net service name for the physical standby database specified by DB_UNIQUE_NAME . The connection identifier must not include the database username and password.
RMAN must also be connected to the primary database as When you run the Note: When the target database needs to connect to other standby or primary databases, it connects as the For a sample use case, suppose that you recently connected RMAN as Note: If the database specified by |
delalConf |
Configures an archived redo log deletion policy. |
AUXNAME FOR DATAFILE datafileSpec TO ' filename ' |
Configures the auxiliary filename for the specified target datafile to ' filename ' (see Example 2-44). Specify CLEAR to unspecify the auxiliary filename.
If you are performing TSPITR or using For example, use this command during TSPITR if the datafiles are on raw disk and you need to restore auxiliary datafiles to raw disk for performance reasons. Typically, you set the When renaming files with the See Also: Oracle Database Backup and Recovery User's Guide to learn how to perform RMAN TSPITR, and Oracle Database Backup and Recovery User's Guide to learn how to duplicate a database with RMAN |
backupConf |
Configures default backup options such as duplexing, optimization, excluding tablespaces, backup set sizes, and retention policies. |
cfauConf |
Configures control file autobackup settings. |
COMPRESSION ALGORITHM ' algorithm_name ' |
Specifies the algorithm that RMAN uses to create compressed backup sets. The default compression algorithm is BZIP2 .
The supported algorithms are Note: The |
deviceConf |
Configures default backup settings for devices, such as the default backup device, channel configurations for devices, default backup types for each device, and parallelism. |
ENCRYPTION |
Specifies transparent-mode encryption settings for the database or tablespaces.
This configuration applies unless overridden with the Note: To create encrypted RMAN backups on disk, the database must have the Advanced Security Option. To create encrypted backups directly on tape, RMAN must use Oracle Secure Backup as its media manager, but the Advanced Security Option is not required.Note that RMAN issues an |
ALGORITHM
|
Specifies the default algorithm to use for encryption when writing backup sets. Possible values are listed in V$RMAN_ENCRYPTION_ALGORITHMS . The CLEAR option resets the database to the default value. |
FOR DATABASE
|
Specifies whether to enable transparent encryption for the entire database. The options are as follows:
Note: You must use the |
FOR TABLESPACE
|
Specifies whether to enable transparent encryption for one or more tablespaces. Configured settings for a tablespace always override configuration set at the database level. The options are as follows:
Note: You must use the |
SNAPSHOT CONTROLFILE NAME TO ' filename ' |
Configures the snapshot control file name and location to ' filename ' . If you run CONFIGURE SNAPSHOT CONTROLFILE NAME CLEAR , then RMAN sets the snapshot control file name to its default.
The default value for the snapshot control file name is platform-specific and dependent on the Oracle home. For example, the default on some UNIX system is Note that the snapshot control file name is valid for this database only. Assume that you configure the snapshot control file name to a nondefault value on the primary database. If you use See Also: Oracle Database Backup and Recovery User's Guide for more information about snapshot control files |
forDbUniqueNameOption |
Creates an RMAN configuration in the recovery catalog for the database in a Data Guard environment specified by DB_UNIQUE_NAME . You can specify a single database with db_unique_name or use ALL for all databases in the recovery catalog that share the DBID of the target database (or DBID specified by the SET DBID command).
Oracle recommends that you connect RMAN to a recovery catalog when performing operations in a Data Guard environment. RMAN must be connected as When you specify Note: It is possible to run |
delalConf
This subclause manages persistent configurations for archived redo log deletion policy.
Syntax Element | Description |
---|---|
ARCHIVELOG DELETION POLICY |
Determines when archived redo log files are eligible for deletion.
The archived log deletion policy applies to all log archiving destinations, including the flash recovery area. Note that the policy does not apply to archived logs in backup sets. Only archived redo logs in the flash recovery area are automatically deleted by the database. You can execute the In the recovery area, the database retains logs eligible for deletion as long as possible. The database deletes the oldest logs first when disk space is required. When the recovery area is under disk pressure, the database may delete archived redo logs needed by Oracle Streams. Note: The deletion policy does not apply to foreign archived redo logs, which are logs received by a logical standby database for a LogMiner session. These logs are transferred from a primary database, but unlike ordinary archived logs they have a different DBID. Foreign archived redo logs cannot be backed up or restored on a logical standby database. |
TO APPLIED ON
|
Specifies that archived redo logs are eligible for deletion if both of the following conditions are met:
Which remote destinations are considered depends on the following criteria:
Note: It is invalid to specify the See Also: Oracle Data Guard Concepts and Administration for details |
BACKED UP integer
|
Specifies that archived redo logs are eligible for deletion if both of the following conditions are met:
If you configure the deletion policy with this clause, then a See Also: |
TO NONE |
Disables the archived log deletion policy. This is the default setting.
Archived redo log files can be located inside or outside of the flash recovery area. Logs in any location can be deleted by manual commands. Only logs in the flash recovery area can be deleted automatically by the database. When the deletion policy is set to
For example, suppose that archived logs have been transferred to required remote destinations. The logs are obsolete according to the recovery window retention policy, but have not been backed up. In this case, the logs are eligible for deletion. Alternatively, suppose that the logs are obsolete and have been backed up to SBT, but have not been transferred to required remote destinations. In this case, the logs are not eligible for deletion. If the deletion policy is set to |
TO SHIPPED TO
|
Specifies that archived redo logs are eligible for deletion if both of the following conditions are met:
Which remote destinations are considered depends on the following criteria:
Note: It is invalid to specify the See Also: Oracle Data Guard Concepts and Administration for details |
backupConf
This subclause manages persistent configurations relating to the BACKUP
command. One configuration is backup optimization. If you enable backup optimization, then RMAN does not back up a file to a device type if the identical file is already backed up on the device type.
Table 2-3 explains the criteria used by backup optimization to determine whether a file is identical and can be potentially skipped. The table also explains the algorithm that RMAN uses when backup optimization is enabled and it needs to determine whether to skip the backup of an identical file. If RMAN does not skip a backup, then it makes the backup exactly as specified.
Table 2-3 Backup Optimization Algorithm
File Type | Criteria for an Identical File | Backup Algorithm When Backup Optimization Is Enabled |
---|---|---|
Datafile |
The datafile must have the same DBID, checkpoint SCN, creation SCN, and |
If a recovery window-based retention policy is enabled, then whether RMAN skips a datafile depends on the backup media. For backups to tape, if the most recent backup is older than the recovery window, then RMAN takes another backup of a datafile even if a backup of an identical datafile exists. In this way, tapes can be recycled after they expire. For backups to disk, RMAN skips the backup if an identical datafile is available on disk, even if that backup is older than the beginning of the recovery window. The window-based retention policy causes RMAN to retain the old backup for as long as it is needed. If a retention policy is enabled with If no retention policy is enabled, then RMAN skips a backup only if at least n backups of an identical file exist on the specified device. RMAN searches for values of n in this order of precedence (that is, values higher on the list override values lower on the list):
|
Archived redo log |
The archived redo log must have the same thread, sequence number, and |
RMAN skips a backup only if at least n backups of an identical file exist on the specified device. RMAN searches for values of n in this order of precedence (that is, values higher on the list override values lower on the list):
|
Backup set |
The backup set must have the same record ID and stamp as an existing backup set. |
RMAN skips a backup only if at least n backups of an identical file exist on the specified device. By default, n
|
Syntax Element | Description |
---|---|
{ARCHIVELOG | DATAFILE} BACKUP COPIES FOR DEVICE TYPE deviceSpecifier TO integer |
Specifies the number of copies of each backup set for DATAFILE (both datafiles and control files) or ARCHIVELOG files on the specified device type (see Example 2-41). You can create from 1 (default) to 4 copies.
RMAN can duplex backups to either disk or tape, but cannot duplex backups to tape and disk simultaneously. When backing up to tape, ensure that the number of copies does not exceed the number of available tape devices. Also, if Control file autobackups are never duplexed. Also, duplexing is not permitted in the flash recovery area. If duplexing is specified in the |
BACKUP OPTIMIZATION
|
Toggles backup optimization ON or OFF (default). Specify CLEAR to return optimization to its default value of OFF .
Backup optimization is enabled when all of the following conditions are met:
Optimization prevents RMAN from backing up a file to a device type if the identical file is already backed up on the device type. RMAN does not signal an error if backup optimization causes all files to be skipped during a backup. Note that the backup retention policy has an effect on which files backup optimization skips. For two files to be identical, their content must be exactly the same. See Table 2-3 for an exhaustive explanation of when a file is considered identical. Note that when you create backup pieces on disk or on media managed by Oracle Secure Backup, optimization excludes undo data from the backup when the data does not belong to an active transaction. Note: Note: You can override backup optimization with the See Also: Oracle Database Backup and Recovery User's Guide for a description of how RMAN determines that it can skip the backup of a file |
EXCLUDE FOR TABLESPACE tablespace_name
|
Excludes the specified tablespace from BACKUP DATABASE commands (see Example 2-43). Note that you cannot exclude the SYSTEM tablespace.
By default, each tablespace is not excluded, that is, the exclude functionality is disabled. The exclusion is stored as an attribute of the tablespace, not the individual datafiles, so the exclusion applies to any files that are added to this tablespace in the future. If you run You can still back up an excluded tablespace by explicitly specifying it in a |
MAXSETSIZE |
Specifies the maximum size of each backup set created on a channel. Use the CLEAR option to return MAXSETSIZE to the default value of UNLIMITED .
Note: This option is ignored by |
TO sizeSpec |
Specifies the maximum size of each backup set as integer gigabytes, kilobytes, or megabytes. |
TO UNLIMITED |
Specifies no size limit for backup sets. |
RETENTION POLICY |
Specifies a persistent, ongoing policy for backup sets and copies that RMAN marks as obsolete, that is, not needed and eligible for deletion.
As time passes, RMAN marks backup sets and copies as obsolete according to the criteria specified in the retention policy. RMAN automatically deletes obsolete backup sets and copies in the flash recovery area when space is needed. RMAN does not automatically delete obsolete files outside the flash recovery area: you must manually execute For backups, the basic unit of the retention policy is a backup set (not a backup piece) or image copy. For example, Note: Use the |
TO NONE |
Disables the retention policy feature. RMAN does not consider any backup sets or copies as obsolete. |
TO RECOVERY WINDOW
|
Specifies a time window in which RMAN should be able to recover the database.
The window stretches from the current time ( Note: The |
TO REDUNDANCY integer |
Specifies that RMAN should retain integer backups of each datafile and control file. The default retention policy setting is REDUNDANCY 1 .
If more than Note: The |
cfauConf
This subclause creates persistent configurations relating to control file autobackups.
Syntax Element | Description |
---|---|
CONTROLFILE AUTOBACKUP |
Controls the control file autobackup feature.
Note: Oracle recommends that you enable control file autobackup feature when using RMAN without a recovery catalog. |
ON |
Specifies that RMAN should perform a control file autobackup in the following circumstances:
If you do not use RMAN with a recovery catalog, then control file autobackups are recommended. The first channel allocated during the backup or copy job creates the autobackup and places it into its own backup set; for post-structural autobackups, the default disk channel makes the backup. RMAN writes the control file and server parameter file to the same backup piece. After the control file autobackup completes, the database writes a message containing the complete path of the backup piece and the device type to the alert log. The default location for the autobackup on disk is the flash recovery area (if configured) or a platform-specific location (if not configured). RMAN automatically backs up the current control file using the default format of You cannot configure RMAN to duplex the control file autobackup, that is, write the autobackup to multiple locations. To create multiple control file backups, you can make the last command in your backup job a Note: The
You can configure the autobackup format even when |
OFF |
Disables the autobackup feature (default).
When this command is |
CLEAR |
Returns this configuration to its default setting of OFF . |
FORMAT FOR
|
Configures the default location and filename format for the control file autobackup on the specified device type (see Example 2-45).
By default, the format is If a flash recovery area is enabled, and if the format is the default The string The CONFIGURE CONTROLFILE AUTOBACKUP FOR DEVICE TYPE DISK TO '+dgroup1'; See Also: |
deviceConf
This subclause creates persistent configurations relating to channels and devices.
Note that RMAN determines the names for configured channels. RMAN uses the following convention: ORA_
devicetype
_
n
, where devicetype
refers to the user device type (such as DISK
or sbt_tape
) and n
refers to the channel number. Channel names beginning with the ORA_
prefix are reserved by RMAN for its own use. You cannot manually allocate a channel with a name that begins with ORA_
.
Note:
Thesbt
and sbt_tape
device types are synonymous, but RMAN output always displays sbt_tape
whether the input is sbt
or sbt_tape
.RMAN names the first DISK
channel ORA_DISK_1
, the second ORA_DISK_2
, and so on. RMAN names the first sbt
channel ORA_SBT_TAPE_1
, the second ORA_SBT_TAPE_2
, and so on. When you parallelize channels, RMAN always allocates channels in numerical order, starting with 1 and ending with the parallelism setting (CONFIGURE
DEVICE
TYPE
...
PARALLELISM
n
).
To run BACKUP
or RESTORE
jobs on specific configured channels, use the system-generated channel names. If you specify channel numbers in the CONFIGURE
CHANNEL
command (see the deviceConf
clause), then RMAN uses the same numbers in the system-generated channel names.
Automatic channel allocation also applies to maintenance commands. If RMAN allocates an automatic maintenance channel, then it uses the same naming convention as any other automatically allocated channel.
Syntax Element | Description |
---|---|
[AUXILIARY] CHANNEL [ integer ] DEVICE TYPE deviceSpecifier |
Specifies the standard or AUXILIARY channel that you are configuring or clearing, as well as the device type of the channel.
Note: Channels allocated with Either configure a generic channel or specify a channel number, where If You must specify at least one channel option. For example, you cannot issue a command such as For generic channels of a specified device type, a new command erases previous settings for this device type. Assume that you run these commands: CONFIGURE CHANNEL DEVICE TYPE sbt MAXPIECESIZE 1G; CONFIGURE CHANNEL DEVICE TYPE sbt FORMAT 'bkup_%U'; The second command erases the Note: RMAN does not simultaneously allocate automatic channels for multiple device types in the See Also: Oracle Database Backup and Recovery User's Guide to learn how configure automatic channels specified by channel number |
allocOperandList |
Specifies control options for the configured channel.
If you configure channels by using the nondefault Note that the CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT '+dgroup1'; See Also: |
CLEAR |
Clears the specified channel. For example, CONFIGURE CHANNEL 1 DEVICE TYPE DISK CLEAR returns only channel 1 to its default, whereas CONFIGURE CHANNEL DEVICE TYPE DISK CLEAR returns the generic disk channel to its default. Note that you cannot specify any other channel options (for example, PARMS ) when you specify CLEAR . |
DEFAULT DEVICE TYPE TO deviceSpecifier |
Specifies the default device type for automatic channels. By default, DISK is the default device type. CLEAR returns the default device type to DISK .
By default, the The |
DEVICE TYPE deviceSpecifier |
Specifies the device type (disk or sbt) to which to apply the settings specified in this CONFIGURE command. The CLEAR option resets backup type and parallelism settings for this device to their defaults.
If you run the CONFIGURE DEVICE TYPE sbt PARALLELISM 1; BACKUP DEVICE TYPE sbt DATABASE; In effect, RMAN does the following when executing this backup: RUN { ALLOCATE CHANNEL ORA_SBT_TAPE_1 DEVICE TYPE sbt; BACKUP DATABASE; } |
BACKUP TYPE TO
|
Configures the default backup type for disk or tape backups. For SBT devices the COPY option is not supported. The default for disk is BACKUPSET .
If The default location for disk backups is the flash recovery area, if one is configured; otherwise, RMAN stores backups in a platform-specific location. The default format for backup filenames is |
PARALLELISM integer |
Configures the number of automatic channels of the specified device type allocated for RMAN jobs. By default, PARALLELISM is set to 1 .
Note: The Suppose you set Note: If you configure To change the parallelism for a device type to CONFIGURE DEVICE TYPE sbt PARALLELISM 3; CONFIGURE DEVICE TYPE sbt PARALLELISM 2; |
Examples
Example 2-40 Configuring Device and Backup Options
This example configures channels of device type DISK
and sbt
and sets the default device type as sbt
. The example also enables backup optimization and configures a recovery windows of two weeks.
CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT '/disk1/backups/%U'; CONFIGURE CHANNEL DEVICE TYPE sbt PARMS 'ENV=(OB_DEVICE_1=tape1)'; CONFIGURE DEFAULT DEVICE TYPE TO sbt; CONFIGURE BACKUP OPTIMIZATION ON; CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 14 DAYS;
Example 2-41 Overriding the Default Device Type
This example configures duplexing to 2
for DISK
backups of datafiles and control files (control file autobackups on disk are a special case and are never duplexed), then configures sbt
as the default device.
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 2; CONFIGURE CHANNEL DEVICE TYPE sbt PARMS 'ENV=(OB_DEVICE_1=tape1)'; CONFIGURE DEFAULT DEVICE TYPE TO sbt;
The first BACKUP
command backs up the archived redo logs on the default sbt
channel. The second BACKUP
command backs up the database to disk locations. Because duplexing is enabled for disk backups, two copies of each output backup set are created.
BACKUP ARCHIVELOG ALL; BACKUP DEVICE TYPE DISK DATABASE FORMAT '/disk1/db_backup_%U','/disk2/db_backup_%U';
Example 2-42 Configuring Automatic Channels Across File Systems
This example configures automatic disk channels across two file systems:
CONFIGURE DEVICE TYPE DISK PARALLELISM 2; CONFIGURE CHANNEL 1 DEVICE TYPE DISK FORMAT '/disk1/%U'; CONFIGURE CHANNEL 2 DEVICE TYPE DISK FORMAT '/disk2/%U';
Because PARALLELISM
is set to 2
, the following command divides the output data between two file systems:
BACKUP DEVICE TYPE DISK DATABASE PLUS ARCHIVELOG;
The following LIST
command shows how the datafile backup was parallelized:
RMAN> LIST BACKUPSET 2031, 2032; List of Backup Sets =================== BS Key Type LV Size Device Type Elapsed Time Completion Time ------- ---- -- ---------- ----------- ------------ --------------- 2031 Full 401.99M DISK 00:00:57 19-JAN-07 BP Key: 2038 Status: AVAILABLE Compressed: NO Tag: TAG20070119T100532 Piece Name: /disk1/24i7ssnc_1_1 List of Datafiles in backup set 2031 File LV Type Ckp SCN Ckp Time Name ---- -- ---- ---------- --------- ---- 1 Full 973497 19-JAN-07 /disk3/oracle/dbs/t_db1.f 5 Full 973497 19-JAN-07 /disk3/oracle/dbs/tbs_112.f BS Key Type LV Size Device Type Elapsed Time Completion Time ------- ---- -- ---------- ----------- ------------ --------------- 2032 Full 133.29M DISK 00:00:57 19-JAN-07 BP Key: 2039 Status: AVAILABLE Compressed: NO Tag: TAG20070119T100532 Piece Name: /disk2/25i7ssnc_1_1 List of Datafiles in backup set 2032 File LV Type Ckp SCN Ckp Time Name ---- -- ---- ---------- --------- ---- 2 Full 973501 19-JAN-07 /disk3/oracle/dbs/t_ax1.f 3 Full 973501 19-JAN-07 /disk3/oracle/dbs/t_undo1.f 4 Full 973501 19-JAN-07 /disk3/oracle/dbs/tbs_111.f
Example 2-43 Configuring Automatic Channels in an Oracle Real Application Clusters (Oracle RAC) Configuration
This example assumes an Oracle RAC database with two nodes. Oracle Secure Backup is the media manager. Tape drive tape1
is directly attached to node1
, while tape drive tape2
is directly attached to node2
. The example configures an automatic sbt
channel for each cluster node.
CONFIGURE DEVICE TYPE sbt PARALLELISM 2; CONFIGURE DEFAULT DEVICE TYPE TO sbt; CONFIGURE CHANNEL 1 DEVICE TYPE sbt CONNECT 'SYS/password@node1' PARMS 'ENV=(OB_DEVICE=tape1)'; CONFIGURE CHANNEL 2 DEVICE TYPE sbt CONNECT 'SYS/password@node2' PARMS 'ENV=(OB_DEVICE=tape2)';
Example 2-44 Configuring Auxiliary Filenames
This example uses CONFIGURE
AUXNAME
to specify new filenames for the datafiles. The DUPLICATE
command duplicates a database to a remote host with a different directory structure.
# set auxiliary names for the datafiles CONFIGURE AUXNAME FOR DATAFILE 1 TO '/oracle/auxfiles/aux_1.f'; CONFIGURE AUXNAME FOR DATAFILE 2 TO '/oracle/auxfiles/aux_2.f'; CONFIGURE AUXNAME FOR DATAFILE 3 TO '/oracle/auxfiles/aux_3.f'; CONFIGURE AUXNAME FOR DATAFILE 4 TO '/oracle/auxfiles/aux_4.f'; RUN { ALLOCATE AUXILIARY CHANNEL dupdb1 TYPE DISK; DUPLICATE TARGET DATABASE TO dupdb LOGFILE GROUP 1 ('?/dbs/dupdb_log_1_1.f', '?/dbs/dupdb_log_1_2.f') SIZE 4M, GROUP 2 ('?/dbs/dupdb_log_2_1.f', '?/dbs/dupdb_log_2_2.f') SIZE 4M REUSE; } # Un-specify the auxiliary names for the datafiles so that they are not overwritten # by mistake: CONFIGURE AUXNAME FOR DATAFILE 1 CLEAR; CONFIGURE AUXNAME FOR DATAFILE 2 CLEAR; CONFIGURE AUXNAME FOR DATAFILE 3 CLEAR; CONFIGURE AUXNAME FOR DATAFILE 4 CLEAR;
Example 2-45 Specifying the Default Format for Control File Autobackup
The following example enables the autobackup feature and configures the default autobackup format for the DISK
and sbt
devices:
CONFIGURE CONTROLFILE AUTOBACKUP ON; CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/disk2/%F'; CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE sbt TO 'cf_auto_%F';
Example 2-46 Creating Configurations for Standby Databases
Assume that database prod
is associated with two standby databases with the DB_UNIQUE_NAME
names dgprod3
and dgprod4
. The following commands connect to the target database prod
and recovery catalog database catdb
. The example configures the default device type for databases dgprod3
and dgprod4
.
CONNECT TARGET SYS/password@prod CONNECT CATALOG rman/password@catdb CONFIGURE DEFAULT DEVICE TYPE TO sbt FOR DB_UNIQUE_NAME dgprod3; CONFIGURE DEVICE TYPE sbt PARALLELISM 2 FOR DB_UNIQUE_NAME dgprod3; CONFIGURE DEFAULT DEVICE TYPE TO DISK FOR DB_UNIQUE_NAME dgprod4;
The control files of the two standby databases are updated with the configuration only after the reverse resynchronization from the recovery catalog to the control file, which occurs the first time that the user connects to dgprod3
and dgprod4
.
The following SHOW
command displays the persistent device type configurations for the database whose unique name is dgprod3
:
RMAN> SHOW DEVICE TYPE FOR DB_UNIQUE_NAME dgprod3; RMAN configuration parameters for database with db_unique_name DGPROD3 are: CONFIGURE DEVICE TYPE 'SBT_TAPE' PARALLELISM 2 BACKUP TYPE TO BACKUPSET; CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default
The following SHOW
command displays the persistent configurations for all databases known to the recovery catalog whose DBID is 3257174182 (the value specified by the preceding SET DBID
command):
SHOW ALL FOR DB_UNIQUE_NAME ALL;
Example 2-47 Optimizing Backups
This scenario illustrates the backup optimization behavior described in Table 2-3. Assume that backup optimization is disabled. At 9 a.m., you back up three copies of all existing archived logs to tape. Note that the BACKUP_TAPE_IO_SLAVES
initialization parameter must be true
when duplexing backups to tape.
BACKUP DEVICE TYPE sbt COPIES 3 ARCHIVELOG ALL;
At 11 a.m., you enable backup optimization:
CONFIGURE BACKUP OPTIMIZATION ON;
At noon, you run the following archived redo log backup:
BACKUP DEVICE TYPE sbt COPIES 2 ARCHIVELOG ALL; Starting backup at 19-JAN-07 current log archived using channel ORA_SBT_TAPE_1 skipping archived log file /d1/db1r_605ab325_1_34_612112605.arc; already backed up 3 time(s) skipping archived log file /d1/db1r_605ab325_1_35_612112605.arc; already backed up 3 time(s) skipping archived log file /d1/db1r_605ab325_1_36_612112605.arc; already backed up 3 time(s) skipping archived log file /d1/db1r_605ab325_1_37_612112605.arc; already backed up 3 time(s) skipping archived log file /d1/db1r_605ab325_1_38_612112605.arc; already backed up 3 time(s) skipping archived log file /d1/db1r_605ab325_1_39_612112605.arc; already backed up 3 time(s) channel ORA_SBT_TAPE_1: starting archived log backup set channel ORA_SBT_TAPE_1: specifying archived log(s) in backup set input archived log thread=1 sequence=40 RECID=170 STAMP=612270506 channel ORA_SBT_TAPE_1: starting piece 1 at 19-JAN-07 channel ORA_SBT_TAPE_1: finished piece 1 at 19-JAN-07 with 2 copies and tag TAG20070119T110827 piece handle=2hi7t0db_1_1 comment=API Version 2.0,MMS Version 10.1.0.0 piece handle=2hi7t0db_1_2 comment=API Version 2.0,MMS Version 10.1.0.0
In this case, the BACKUP
...
COPIES
setting overrides the CONFIGURE
...
COPIES
setting, so RMAN sets n
=2
. RMAN skips the backup of a log only if at least two copies of the log exist on the sbt
device. Because three copies of each log exist on sbt
of all the logs generated on or before 9 a.m., RMAN skips the backups of these logs. However, RMAN backs up two copies of all logs generated after 9 a.m. because these logs have not yet been backed up to tape.