1. Concept:

A backup set is a backup that is taken using the RMANís BACKUP command. A backup set is a logical grouping of one or more physical (binary) files called backup pieces. By default, one backup set contains only one backup piece. A backup piece contains backed up data files, control files, or archived log files. A backup set is stored in an RMAN-specific format. Therefore, a backup set cannot be manually restored. It must be restored using the Recovery Manager (RMAN) RESTORE command before it can be used by Oracle.

Backup sets are of two types: data file backup sets and archived log backup sets. A data file backup set is a backup of data files or control files. A data file backup set is compressed, i.e., it contains only used data blocks.

An archived log backup set is a backup of archived redo logs. An archived log backup set is not compressed.

A backup piece can belong to only one backup set. Backups of data files and archived redo logs cannot be stored in the same backup set.

  1. Datafile in bkset and bk pieces
  • One bk set = one or more datafiles

bkset must have at least one datafile, which means you cannot have part of a datafile(of course lar) in one dataset.

The parameter MAXSETSIZE is used to limit the size of each bk set. This parameter must be larger than the size of the largest datafiles will be backed up.

e.g if I have 3 datafiles with 500m, 600m, 700m, then the MAXSETSIZE must be set larger than or equal to 700m. if not, error will occurred and backup will fail.

  • When we can have multi. Pieces in one bkset? Set the MAXPIECESIZE

By default, MAXPIECESIZE is UNLIMITED; if we set the MAXPIECESIZE to 500M as this case, datafile that larger than 500M will be divided into two or more pieces. For example, backing up a datafile with 1200m will contain three pieces.

  • When we can have more than one bk set in each backup? Set the FILEPERSET parameter:

RMAN> run{
allocate channel d1 type disk
maxpiecesize =300M;
filesperset 2

ìfilesperset 2î means that each backupset contains two datafiles; if the backup contains more than 2 datafiles, say 5 datafiles, it will have 3 backup sets.