The RMAN backup and recovery environment is preconfigured for each target database. The configuration is persistent and applies to all subsequent operations on target database, even if you exit and restart RMAN.
- Showing and Clearing Default RMAN Backup Configurations
- Configure RMAN Backup Device Type: Disk or SBT
- Configure RMAN Backup Default Type for Backups: Backup Sets or Copies
- Configure RMAN Backup Channels
You can use the SHOW and CONFIGURE commands to view and change RMAN configurations.
1. Showing and Clearing Default RMAN Backup Configurations
Use SHOW command to display the current value of RMAN settings for the target database.
- Start RMAN and connect to a target database and a recovery catalog (if used).
- Run the RMAN SHOW command
C:\RMAN RMAN> CONNECT TARGET SYS/pass@TEST1; RMAN> SHOW ALL; RMAN configuration parameters for database with db_unique_name PROD1 are: CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 3 DAYS; CONFIGURE BACKUP OPTIMIZATION ON; CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default CONFIGURE CONTROLFILE AUTOBACKUP ON; CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE SBT_TAPE TO '%F'; # default CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default CONFIGURE DEVICE TYPE 'SBT_TAPE' PARALLELISM 2 BACKUP TYPE TO COMPRESSED BACKUPSET; CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE SBT_TAPE TO 1; # default CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE SBT_TAPE TO 1; # default CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default CONFIGURE CHANNEL DEVICE TYPE 'SBT_TAPE' PARMS 'ENV=(OB_DEVICE=tape1)'; CONFIGURE MAXSETSIZE TO UNLIMITED; # default CONFIGURE ENCRYPTION FOR DATABASE OFF; # default CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/disk1/oracle/dbs/snapcf_ev.f'; # default
Parameters that are set to their default values have # default at the end of the configuration setting.
You can also use the SHOW command with the name of a particular configuration for example;
SHOW RETENTION POLICY; SHOW DEFAULT DEVICE TYPE;
Use the CONFIGURE ... CLEAR command to return any configuration to its default value.
CONFIGURE BACKUP OPTIMIZATION CLEAR; CONFIGURE RETENTION POLICY CLEAR; CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK CLEAR;
2. Configure RMAN Backup Device Type: Disk or SBT
RMAN is preconfigured to use disk as the default device type. By default RMAN allocates one disk channel for all operation automatically, and direct all backups to disk if no destination is specified RMAN uses the flash recovery area for all backups.
There is no need to allocate or deallocate a specific channel for backups unless you’re using a tape device.
CONFIGURE DEFAULT DEVICE TYPE TO DISK
Specifies that backups should go to disk by default. If a recovery area is enabled, then the backup location defaults to the flash recovery area. Otherwise, the backup location defaults to an operating system-specific directory on disk
CONFIGURE DEFAULT DEVICE TYPE TO sbt
Specifies that backups should go to tape by default. After RMAN is able to communicate with the media manager, you can configure RMAN to make backups to tape and specify SBT as the default device type.
Override the default device during backup
you can override the default device by using the DEVICE TYPE clause of the BACKUP command.
BACKUP DEVICE TYPE sbt DATABASE; BACKUP DEVICE TYPE DISK DATABASE;
To change the configured default device type:
- Start RMAN and connect to a target database and a recovery catalog (if used).
- Run the SHOW ALL command to show the currently configured default device.
- Run the CONFIGURE DEFAULT DEVICE TYPE command, specifying either TO DISK or TO sbt.
CONFIGURE DEFAULT DEVICE TYPE TO disk; CONFIGURE DEFAULT DEVICE TYPE TO sbt;
3. Configure RMAN Backup Default Type for Backups: Backup Sets or Copies
The BACKUP command can create either backup sets or image copies. The default backup type for disk is an uncompressed backup set. RMAN can write an image copy only to disk. RMAN can create backup sets using binary compression.
To configure the default type of backup:
- Start RMAN and connect to a target database and a recovery catalog (if used).
- Configure backup sets or image copies as the default backup type
The following examples configure the backup type for disk backups to copies and backup sets:
CONFIGURE DEVICE TYPE DISK BACKUP TYPE TO COPY; # image copies CONFIGURE DEVICE TYPE DISK BACKUP TYPE TO BACKUPSET; # uncompressed
The following examples configure compression for backup sets:
CONFIGURE DEVICE TYPE DISK BACKUP TYPE TO COMPRESSED BACKUPSET; CONFIGURE DEVICE TYPE sbt BACKUP TYPE TO COMPRESSED BACKUPSET;
4. Configure RMAN Backup Channels
RMAN channel is a connection to a database server session. RMAN uses channels to perform almost all RMAN tasks. Use CONFIGURE CHANNEL command to configure options for disk or SBT channels.
Configuring Channels for Disk
CONFIGURE CHANNEL DEVICE TYPE DISK MAXPIECESIZE 2G; CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT /tmp/%U; CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT '/disk1/ora_df%t_s%s_s%p';
RMAN automatically replaces the format specifier %t with a four byte time stamp, %s with the backup set number, and %p with the backup piece number.
By configuring an explicit format for disk channels, RMAN does not create backups by default in the flash recovery area.
You can also specify an ASM disk location
CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT '+dgroup1';
Configuring Channel Parallelism for Disk and SBT Devices
The number of channels available for a device type when you run a command determines whether RMAN will read or write in parallel. As a rule, the number of channels used in executing a command should match the number of devices accessed. For tape backups, allocate one channel for each tape drive. For disk backups, allocate one channel for each physical disk.
Failing to allocate the right number of channels adversely affects RMAN performance during I/O operations.
Configuring Parallelism for an SBT Device
In the following example RMAN can back up to a media manager using two tape drives in parallel. Each configured SBT channel will back up roughly half the total data
RMAN> CONFIGURE DEVICE TYPE sbt PARALLELISM 2;
Configuring the Backup Type for an SBT Device
RMAN Changes the default backup type for the SBT device to an uncompressed backup set.
RMAN> CONFIGURE DEVICE TYPE sbt BACKUP TYPE TO BACKUPSET;
CONFIGURE DEVICE TYPE commands used in above examples to set parallelism and backup type do not affect the values of settings not specified.
Manually Overriding Configured Channels
If you manually allocate a channel during a job, then RMAN disregards any configured channel settings. Must be used within a RUN block as show in follwing example
RUN
{
ALLOCATE CHANNEL c1 DEVICE TYPE DISK;
BACKUP TABLESPACE users;
}
| Related Articles | Latest Articles |
