An RMAN channel corresponds to one server session (default) used in Rman backup, Restore and recovery operation. Each channel establishes a connection from the RMAN client to a target or auxiliary database instance by starting a server session on the instance. The following statement uses parallelization, one RMAN BACKUP command backs up all datafiles of database, with all three channels in use. All the three channels are concurrently active first two channel (server session) copies 5-5 datafiles and last channel rest of 3 file in the total of 13 file in the orcl3 database.
allocate channel d1 type disk FORMAT “D:\BACKUP\RMAN_BACKUP\HOTBACKUP\Monthly_%T_FULL_%d-%s_%p.db”;
allocate channel d2 type disk FORMAT “D:\BACKUP\RMAN_BACKUP\HOTBACKUP\Monthly_%T_FULL_%d-%s_%p.db”;
allocate channel d3 type disk FORMAT “D:\BACKUP\RMAN_BACKUP\HOTBACKUP\Monthly_%T_FULL_%d-%s_%p.db”;
incremental level 0
Check out the following backup logfile generated with above channel description:
allocated channel: d1
channel d1: sid=16 devtype=DISK
allocated channel: d2
channel d2: sid=13 devtype=DISK
allocated channel: d3
channel d3: sid=18 devtype=DISK
Starting backup at 08-JUL-12
channel d1: starting incremental level 0 datafile backupset
channel d1: specifying datafile(s) in backupset
input datafile fno=00001 name=C:\ORACLE1\ORADATA\ORCL3\SYSTEM01.DBF
input datafile fno=00002 name=C:\ORACLE1\ORADATA\ORCL3\UNDOTBS01.DBF
input datafile fno=00005 name=C:\ORACLE1\ORADATA\ORCL3\EXAMPLE01.DBF
input datafile fno=00012 name=C:\ORACLE1\ORADATA\ORCL3\LOGMNRTS.DBF
input datafile fno=00010 name=C:\ORACLE1\ORADATA\ORCL3\XDB01.DBF
channel d1: starting piece 1 at 08-JUL-12
channel d2: starting incremental level 0 datafile backupset
channel d2: specifying datafile(s) in backupset
input datafile fno=00006 name=C:\ORACLE1\ORADATA\ORCL3\INDX01.DBF
input datafile fno=00013 name=C:\ORACLE1\ORADATA\ORCL3\OEM_REPOSITORY.DBF
input datafile fno=00009 name=C:\ORACLE1\ORADATA\ORCL3\USERS01.DBF
input datafile fno=00003 name=C:\ORACLE1\ORADATA\ORCL3\CWMLITE01.DBF
input datafile fno=00004 name=C:\ORACLE1\ORADATA\ORCL3\DRSYS01.DBF
channel d2: starting piece 1 at 08-JUL-12
channel d3: starting incremental level 0 datafile backupset
channel d3: specifying datafile(s) in backupset
input datafile fno=00011 name=C:\ORACLE1\ORADATA\ORCL3\MAIN_DBF01.DBF
input datafile fno=00007 name=C:\ORACLE1\ORADATA\ORCL3\ODM01.DBF
input datafile fno=00008 name=C:\ORACLE1\ORADATA\ORCL3\TOOLS01.DBF
channel d3: starting piece 1 at 08-JUL-12
channel d2: finished piece 1 at 08-JUL-12
piece handle=D:\BACKUP\RMAN_BACKUP\HOTBACKUP\MONTHLY_20120708_FULL_ORCL3-1452_1.DB comment=NONE
channel d2: backup set complete, elapsed time: 00:00:52
channel d3: finished piece 1 at 08-JUL-12
piece handle=D:\BACKUP\RMAN_BACKUP\HOTBACKUP\MONTHLY_20120708_FULL_ORCL3-1453_1.DB comment=NONE
channel d3: backup set complete, elapsed time: 00:02:43
channel d1: finished piece 1 at 08-JUL-12
piece handle=D:\BACKUP\RMAN_BACKUP\HOTBACKUP\MONTHLY_20120708_FULL_ORCL3-1451_1.DB comment=NONE
channel d1: backup set complete, elapsed time: 00:03:05
Finished backup at 08-JUL-12
Starting Control File and SPFILE Autobackup at 08-JUL-12
piece handle=D:\BACKUP\RMAN_BACKUP\HOTBACKUP\C-691421794-20120708-06 comment=NONE
Finished Control File and SPFILE Autobackup at 08-JUL-12
released channel: d1
released channel: d2
released channel: d3
Whether you allocate channels manually or automatically, you can use channel control commands and options to do the following:
- Control the operating system resources RMAN uses when performing RMAN operations
- Affect the degree of parallelism for a backup or restore command
- Set limits on I/O bandwidth consumption (CONFIGURE CHANNEL…RATE)
- Set limits on the size of backup pieces (with the MAXPIECESIZE parameter)
- Send vendor-specific commands to the media manager (SEND)
- Specify vendor-specific parameters for the media manager (CONFIGURE CHANNEL … PARMS)
- Specify which instance performs the operation (CONFIGURE CHANNEL … CONNECT)
Factor affecting the number and size of backup sets
- The number of input files specified in eachbackupSpec clause
- The number of channels that you allocate
- The default number of files in each backup set (4 for datafiles and 16 for archived logs)
- The default number of files read simultaneously by a single channel (8)
- TheMAXSETSIZE parameter (specified on the CONFIGURE and BACKUP commands), which specifies a maximum backup set size
The most important rules for allocated channels in backup set creation are:
- Each allocated channel that performs work in the backup job (not idle) generates at least one backup set.
- RMAN always tries to divide the backup load so that all allocated channels have roughly the same amount of work to do.
- The default number of datafiles in each backup set is determined by an internal RMAN limit (16 for archived logs, 4 for datafiles).
- The number of datafiles multiplexed in a backup set is limited by the lesser of the number of files in each backup set and the default number of files read by a single channel simultaneously (8).
- The maximum size of a backup set is determined by theMAXSETSIZE parameter of the CONFIGURE or BACKUP command.
So look at the issue shared by Helios blog having issue on Oracle version 126.96.36.199 database (2 node RAC system) on AIX 6.1. System is already around 25T and our full backup size almost 3,7T with using compress option. Number of datafiles are almost 1054. Total full backup duration is almost 4, 5 hours using 16 channels.
Issue: Our backup duration became almost 7,8 hours last 3 days. We were investigate backup log file and We noticed backup start 16 channels and that 16 channel backupsets job done almost 4:30 hours. After 16 channels backupsets end one new channel opening and it keep taking backupsets by using 1 channel.
Solution: We investigate issue with Oracle support. Here is the explanation of this behavior RMAN will try to balance the work load such that each channel processes the same amount of data. 17 backupsets are produced; each channel is processing 61-62 datafiles so you have 1054 datafiles. RMAN will initially take the no# files and divide by no# allocated channels – this gives 65.8. The upper limit for filesperset is 64 so: 1054/64 = 16.46 so Rman will create 17 backupsets. As you have 16 channels allocated the first 16 channel will process concurrently and the 17th backupset will inevitably run in isolation. If you allocate 18 channels you will get filesperset of 59 and all 18 channels should process concurrently.
So we increased our number of allocate channels for backup and Issue has been resolved.