RMAN can store backup data in a logical structure called a backup set, which is the smallest unit of an RMAN backup. A backup set contains the data from one or more datafiles, archived redo logs, or control files or server parameter file.
A backup set contains one or more binary files in an RMAN-specific format. This file is known as a backup piece. A backup set can contain multiple datafiles. For example, you can back up ten datafiles into a single backup set consisting of a single backup piece. In this case, RMAN creates one backup piece as output. The backup set contains
only this backup piece.
Unused Block Compression for Back Set
When backing up datafiles to backup sets, RMAN can use unused block compression to skip datafile blocks. RMAN always skips blocks that have never been used. Thus, datafile backup sets are typically smaller than datafile copies and take less time to write. Unused block compression is fundamental to how RMAN writes datafiles into backup pieces and cannot be disabled.
Backup Pieces Filenames
You can either let RMAN determine a unique name for backup pieces or use the FORMAT clause to specify a name. If you do not specify the FORMAT parameter, then RMAN automatically generates a unique filename with the %U substitution variable in the default backup location.
The FORMAT clause supports substitution variables other than %U for generating unique filenames. For example, you can use %d to generate the name of the database, %I for the DBID, %t for the timestamp, and so on.
Backup Pieces Number and Size
By default a backup set contains one backup piece. To restrict the size of each backup piece, specify the MAXPIECESIZE option of the CONFIGURE CHANNEL or ALLOCATE CHANNEL commands.
For example, if a tape can hold 10 GB, but the backup set being created must hold 80 GB of data, then you must instruct RMAN to create backup pieces of 10 GB, small enough to fit on the tapes used with the media manager.
Backup Sets Number and Size
The total number and size of backup sets depends for the most part on an internal RMAN algorithm. However, you can influence RMAN behavior with the MAXSETSIZE parameter in the CONFIGURE or BACKUP command. By limiting the size of the backup set, the parameter indirectly limits the number of files in the set and can possibly force RMAN to create additional backup sets. Also, you can specify BACKUP ... FILESPERSET to specify the maximum number of files in each backup set.
Multiplexed Backup Sets
When creating backup sets, RMAN can simultaneously read multiple files from disk and then write their blocks into the same backup set. For example, RMAN can read from two datafiles simultaneously, and then combine the blocks from these datafiles into a single backup piece. The combination of blocks from multiple files is called backup multiplexing. Image copies, by contrast, are never multiplexed.
RMAN multiplexing is determined by several factors. For example, the FILESPERSET parameter of the BACKUP command determines how many datafiles to put in each backup set. The MAXOPENFILES parameter of ALLOCATE CHANNEL or CONFIGURE CHANNEL defines how many datafiles RMAN can read from simultaneously. The basic multiplexing algorithm is as follows:
Number of files in each backup set
This number is the minimum of the FILESPERSET setting and the number of files read by each channel. The FILESPERSET default is 64.
The level of multiplexing
This is the number of input files simultaneously read and then written into the same backup piece. The level of multiplexing is the minimum of MAXOPENFILES and the number of files in each backup set. The MAXOPENFILES default is 8.
By default, RMAN creates backup sets regardless of whether the destination is disk or a media manager. Some examples of creating RMAN Backset are listed below.
Following example creates full database Backup to disk as backup set.
BACKUP AS BACKUPSET
DEVICE TYPE DISK
Following example makes full database backup to configured device type as backup set.
BACKUP AS BACKUPSET
In this example RMAN creates full database backup to tape device type as backup set.
BACKUP AS BACKUPSET
DEVICE TYPE SBT