1. The concept of the channel
A channel represents a stream of data to a device (disk or tape) and produces a corresponding server session on the target database or a secondary database instance (server sessions)
Multiple channels generate multiple server sessions, which will complete backup, restore, and recovery operations, and so on
Channels are divided into disk channels for backup or restore to disk (disk channel), Backup to tape channel (SBT)
Channels must be allocated before backups and restores are performed on the database
ALLOCATE Channel command starts a server process at the target database, and must define the I/O type used by the server process to perform a backup or restore operation
In fact, it is through channel to control the behavior of backup and recovery
The role of channel control commands:
Controlling the OS resources used by Rman
Influence degree of parallelism
Specify the throttling value for I/O bandwidth (set limit read rate parameter)
Defines the limit of the size of the backup slice (set limit Kbytes)
Specifies the limit value for the currently open file (set limit maxopenfiles)
2. Automatic channel allocation
You can use the following commands to automatically assign channels, and Rman automatically assigns channels based on these configurations once Rman sets the following parameters
CONFIGURE DEVICE TYPE ... PARALLELISM
CONFIGURE DEFAULT DEVICE TYPE
CONFIGURE CHANNEL
Assuming that backup DataFile 1 is performed at the Rman prompt, Rman assigns the channel to it using the preconfigured channel parameters
These commands backup, restore, and delete automatically allocate channels based on values set by the Configure command when running in a non-run block
But the command in the run block requires manual allocation of channels
--Change the default device type
rman> CONFIGURE DEFAULT DEVICE tyep to SBT;
--Configuring the degree of parallelism for the automatic allocation channel
rman> CONFIGURE DEVICE TYPE DISK PARALLELISM 3;
--Configure automatic channel options
rman> CONFIGURE CHANNEL DEVICE TYPE DISK
2> FORMAT = '/backup/rman/%u ';
rman> CONFIGURE CHANNEL DEVICE TYPE DISK
2> maxpiecesize 3G;
--Demo, change device type to SBT and then back to default
Rman> show default device type; --Displays the value of the default device type
RMAN configuration parameters are:
CONFIGURE DEFAULT DEVICE TYPE to DISK; # Default
Rman> Configure default device type to SBT; --Resets the default device type value to SBT
New RMAN configuration parameters:
CONFIGURE DEFAULT DEVICE TYPE to ' sbt_tape ';
New RMAN configuration parameters are successfully stored
Rman> show default device type; --Displays the value of the changed default device type
This column more highlights: http://www.bianceng.cn/database/Oracle/
RMAN configuration parameters are:
CONFIGURE DEFAULT DEVICE TYPE to ' sbt_tape ';
Rman> Configure default device type clear; --Place default device type as default
Old RMAN configuration parameters:
CONFIGURE DEFAULT DEVICE TYPE to ' sbt_tape ';
RMAN configuration parameters are successfully reset to default value
Rman> show default device type;
RMAN configuration parameters are:
CONFIGURE DEFAULT DEVICE TYPE to DISK; # Default
3. Manually allocate the channel
At least one channel needs to be allocated for commands such as Backup,copy,restore,recover
Assigning a channel starts a service process on the server where the target database is located, and the allocated channel actually specifies the concurrency degree
You can specify backups to different media, and you can specify read and write speeds when manual channels are used
Rman> RUN {
2> ALLOCATE CHANNEL ch1 TYPE Disk
3> BACKUP datafile 1,2,4
4> FORMAT '/u01/app/oralce/rmanbak/users_%u.bak ';}
The following example allocates a channel and uses a different channel for different data files to complete the backup work
Rman> RUN {
2> Allocate channel CH1 device type disk;
3> Allocate channel CH2 device type disk;
4> Allocate channel CH3 device type disk;
5> Backup
6> Incremental Level 0
7> (datafile 1,4 channel CH1)
8> (datafile 2,3 channel CH2)
9> (datafile 5,6 channel CH3);
10> alter system archive log current