RMAN CONFIGURE command is used to create or change a persistent configuration affecting RMAN backup, restore, duplication, and maintenance jobs on a particular database
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;
Overriding the Default Device Type
This example configures duplexing to 2
for DISK
backups of data files 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 log files 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';
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 data file 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-13 BP Key: 2038 Status: AVAILABLE Compressed: NO Tag: TAG20130119T100532 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-13 /disk3/oracle/dbs/t_db1.f 5 Full 973497 19-JAN-13 /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-13 BP Key: 2039 Status: AVAILABLE Compressed: NO Tag: TAG20130119T100532 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-13 /disk3/oracle/dbs/t_ax1.f 3 Full 973501 19-JAN-13 /disk3/oracle/dbs/t_undo1.f 4 Full 973501 19-JAN-13 /disk3/oracle/dbs/tbs_111.f
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.
This example illustrates channel connections to Oracle RAC instances node1
and node2
. For both channel connections, RMAN uses the same user name and password that were entered for the target database connection.
CONFIGURE DEVICE TYPE sbt PARALLELISM 2; CONFIGURE DEFAULT DEVICE TYPE TO sbt; CONFIGURE CHANNEL 1 DEVICE TYPE sbt CONNECT '@node1' PARMS 'ENV=(OB_DEVICE=tape1)'; CONFIGURE CHANNEL 2 DEVICE TYPE sbt CONNECT '@node2' PARMS 'ENV=(OB_DEVICE=tape2)';
Configuring Auxiliary File Names
This example uses CONFIGURE AUXNAME
to specify new file names for the data files. The DUPLICATE
command duplicates a database to a remote host with a different directory structure.
# set auxiliary names for the data files 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; } # Unspecify the auxiliary names for the data files 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;
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';
Creating Configurations for Standby Databases
Assume that primary database prod
is associated with two standby databases with the DB_UNIQUE_NAME
names dgprod3
and dgprod4
. Assume that you start RMAN and connect to prod
as TARGET
and connect to a recovery catalog. The following commands configure the default device type for databases dgprod3
and dgprod4
.
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;
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 redo log files to tape. 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-13 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-13 channel ORA_SBT_TAPE_1: finished piece 1 at 19-JAN-13 with 2 copies and tag TAG20130119T110827 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.
Configuring a Default Compression Algorithm
This example assumes that you have a license for the Advanced Compression Option (ACO) of the database.
If you want to make the MEDIUM
compression algorithm the default compression algorithm for all compressed backups, issue the following:
CONFIGURE COMPRESSION ALGORITHM 'MEDIUM';
From this point on, you can use the MEDIUM
compression algorithm by issuing the following command:
BACKUP AS COMPRESSED BACKUPSET DATABASE;
Configuring Sparse Backups
This example creates a persistent configuration that, by default, creates sparse backups to disk and in the backup set format.
CONFIGURE DEVICE TYPE DISK BACKUP TYPE TO BACKUPSET SPARSE ON;
Also See: