Creating Backup Sets   «Prev  Next»

Lesson 4 Multiplexing and backup sets
Objective Discuss how and why Recovery Manager multiplexes backup sets

Oracle RMAN Backup Multiplexing and FILESPERSET

Oracle Recovery Manager (RMAN) controls how database files are read and how their blocks are written into backup sets. During a backup, one RMAN channel can read blocks from several input files concurrently and interleave those blocks in the same backup piece. Oracle calls this process backup multiplexing.

Multiplexing can combine the read rates of several input files into one output stream. This can help keep a fast backup destination supplied with data when no individual input file can provide blocks quickly enough. The behavior is controlled primarily by the FILESPERSET option of the BACKUP command and the MAXOPENFILES setting of the RMAN channel.

Before examining those settings, it is important to distinguish a backup set from a backup piece. These terms describe related parts of an RMAN backup, but they are not interchangeable.

Backup sets and backup pieces

A backup set is a logical RMAN backup unit recorded in the RMAN repository. It contains backup data from one or more datafiles, control files, server parameter files, or archived redo logs.

A backup piece is a physical file or media-manager object that belongs to a backup set. A backup set contains one or more backup pieces. RMAN creates and manages the pieces, so they should not be treated as independent operating-system backups.

One BACKUP command can create multiple backup sets. Each backup set can then contain one or more pieces. The resulting number of sets and pieces can be affected by the input files, channel allocation, FILESPERSET, MAXPIECESIZE, media-manager restrictions, and the amount of backup data.

Consequently, it is incorrect to assume that each backup specification always creates one backup file. A backup specification can result in one or more backup sets, and a backup set can consist of more than one backup piece.

How RMAN multiplexes input files

When RMAN multiplexes a backup, one channel reads blocks from multiple input files and writes those blocks into the same backup piece. Blocks from the input files can therefore be interleaved in the output.

For example, suppose a channel is backing up three datafiles. Rather than reading the first datafile completely before moving to the second one, the channel can obtain blocks from each datafile as input becomes available. The resulting backup piece can contain blocks from all three files. RMAN records the information required to identify and restore every block.

Multiplexing applies to backup sets. It does not apply to image copies. An image copy reproduces one datafile, control file, or archived redo log as a separate file and is never multiplexed with another input file.
Oracle AI Engineering

Why RMAN uses multiplexing

Multiplexing was particularly useful for maintaining a steady stream of data to sequential tape devices. If one source file could not provide data fast enough, a channel could alternate among several files and combine their read rates.

The same general principle can apply to modern disk and media-management destinations. A channel reading files from different source devices may produce a steadier output stream than a channel that depends on the read rate of only one file.

Multiplexing does not automatically improve every backup. Its effectiveness depends on the source storage, backup destination, channel configuration, compression, encryption, and workload. Cloud and object-storage destinations should not be assumed to behave like sequential tape devices. The complete backup and restore path must be measured under representative conditions.

Higher multiplexing levels can also affect restore performance. When blocks from several input files are distributed throughout a backup piece, RMAN may need to process more of that piece while reconstructing an individual datafile. Administrators should balance backup throughput against restore requirements rather than simply selecting the largest possible multiplexing level.

Controlling backup sets with FILESPERSET

The FILESPERSET option specifies the maximum number of input files that RMAN may place in one backup set. It does not specify the number of physical backup pieces in the set.

In Oracle AI Database 26ai, the default value of FILESPERSET is 64. The number of input files assigned to a backup set is determined by the smaller of the following values:
  • The value of FILESPERSET.
  • The number of files assigned to and read by the channel.
The relationship can be summarized as follows:
Files per backup set =
  min(FILESPERSET, files read by each channel)
The FILESPERSET option can apply to an entire BACKUP command or to an individual backup specification within the command. Its placement should reflect the part of the backup policy that it is intended to control.

Using the default FILESPERSET value

Consider a backup of three datafiles:
BACKUP DATAFILE 1, 2, 3;
Because the default FILESPERSET value is greater than the number of input files, all three datafiles may be assigned to one backup set. If one channel reads these files concurrently, blocks from the three datafiles can be multiplexed into that set's backup piece.

This is a possible result, not a guarantee that every three-file backup will always produce exactly one physical piece. Channel allocation, piece-size limits, media-manager behavior, and other RMAN settings can influence the final output.

Preventing cross-file multiplexing

To place no more than one input datafile in each backup set, specify FILESPERSET 1:
BACKUP FILESPERSET 1 DATAFILE 1, 2, 3;
RMAN creates up to three backup sets for the three datafiles. Because each set contains only one input datafile, blocks from different datafiles cannot be multiplexed within the same set.

This setting can provide more granular backup sets and simpler isolation of an input file. It can also increase the number of backup sets and pieces that RMAN must create, retain, catalog, and manage.

Allowing two input files per backup set

The following command permits RMAN to place as many as two input datafiles in each backup set:
BACKUP FILESPERSET 2 DATAFILE 1, 2, 3;
Two backup sets are required to hold the three input files. One set can contain two datafiles, while the other contains the remaining datafile. The set containing two datafiles can be multiplexed.

The exact pairing of datafiles is not guaranteed. It can depend on the available channels, the input list, the workload, and RMAN's assignment of backup work. A diagram showing datafile 1 paired with datafile 3 illustrates one possible grouping rather than a required grouping.

Controlling concurrent reads with MAXOPENFILES

The MAXOPENFILES setting belongs to an RMAN channel. It limits the number of input files that one channel can have open concurrently. The default value in Oracle AI Database 26ai is 8.

The effective multiplexing level is the smaller of the number of files in the backup set and the channel's MAXOPENFILES value:
Multiplexing level =
  min(MAXOPENFILES, files in the backup set)
For example, the following RUN block permits as many as eight files in a backup set but limits the channel to four concurrently open input files:
RUN {
  ALLOCATE CHANNEL c1
    DEVICE TYPE DISK
    MAXOPENFILES 4;

  BACKUP FILESPERSET 8 DATABASE;
}
Although a backup set can contain as many as eight input files, channel c1 can read no more than four of those files concurrently. The possible multiplexing level for that channel is therefore limited to four.

Comparing FILESPERSET and MAXOPENFILES

Setting Scope What it limits Oracle 26ai default
FILESPERSET BACKUP command or backup specification Input files assigned to each backup set 64
MAXOPENFILES RMAN channel Input files one channel reads concurrently 8

FILESPERSET controls backup-set membership. MAXOPENFILES controls concurrent input reads. RMAN considers both values when determining the possible multiplexing level.

Multiplexing and FILESPERSET

Oracle AI Database 26ai RMAN comparison showing how FILESPERSET 1, FILESPERSET 2, and the default setting affect datafile multiplexing into backup sets.
How FILESPERSET limits input files per backup set while MAXOPENFILES limits concurrent reads and determines the possible RMAN multiplexing level.
The first panel illustrates a possible result when the default FILESPERSET value permits three datafiles to belong to one backup set. The second panel shows how FILESPERSET 1 prevents cross-file multiplexing by limiting each set to one input datafile. The third panel shows one possible grouping when FILESPERSET 2 permits two input datafiles in a set.

Multiplexing and channel parallelism

Multiplexing and parallelism are related performance techniques, but they describe different behavior:
  • Multiplexing occurs when one channel interleaves blocks from multiple input files in a backup piece.
  • Parallelism occurs when multiple channels create separate backup sets or file sections at the same time.
A single backup set is written by one RMAN channel. RMAN does not stripe one backup set across multiple channels. When several channels are available, RMAN distributes backup work among them, and each channel creates its own backup sets.

Increasing the number of channels can reduce the number of files assigned to each channel. This can indirectly change the effective multiplexing level even when the FILESPERSET value remains unchanged.

Backup operations that are not multiplexed

Some RMAN operations deliberately keep their input separate:
  • Image copies: Each image copy corresponds to one input file. An image copy is not multiplexed with another datafile, control file, or archived redo log.
  • Multisection backups: RMAN can divide one large datafile into sections so that multiple channels can back it up in parallel. A section is not multiplexed with another section or with a different datafile.
RMAN backup multiplexing must also be distinguished from media-manager multiplexing. A media manager can combine data from multiple RMAN channels into one tape or output stream. Oracle recommends avoiding media-manager multiplexing for RMAN backups because it can make restore operations less efficient.

Choosing practical multiplexing settings

Keep the default settings unless testing identifies a reason to change them. Multiplexing should be tuned as part of the complete backup system, not as an isolated RMAN feature.

Consider using FILESPERSET 1 when separate backup sets for individual input files provide a meaningful operational benefit, such as avoiding cross-file multiplexing or improving failure isolation. Consider larger values when aggregated input throughput improves backup performance and restore tests remain within the required recovery window.

The following factors can influence the result:
  • The number and type of allocated RMAN channels.
  • The source-storage devices and their available read bandwidth.
  • The performance characteristics of the backup destination.
  • The use of backup compression and encryption.
  • Media-manager configuration and device limits.
  • Backup-piece size, retention, and catalog-management requirements.
  • The recovery-time objectives for complete and individual-file restores.
After changing FILESPERSET or MAXOPENFILES, test both backup and restore performance. Useful measurements include backup elapsed time, sustained throughput, source-storage latency, destination utilization, restore elapsed time, and the number and size of the backup pieces produced.

Lesson summary

RMAN multiplexing allows one channel to interleave blocks from multiple input files in a backup piece. FILESPERSET limits how many input files may belong to each backup set, while MAXOPENFILES limits how many input files a channel can read concurrently.

Backup sets are logical RMAN units, and backup pieces are their physical output files or media-manager objects. A backup set can contain multiple pieces, so the two terms should not be used interchangeably.

Multiplexing can improve backup throughput by combining input streams, but excessive multiplexing can make some restore operations less efficient. Select settings by measuring both backup and restore behavior against the database's recovery requirements.

In the next lesson, you will learn how RMAN uses multiple channels and multisection backups to create backups in parallel.

Backup Sets Properties - Quiz

Test your understanding of backup sets, backup pieces, multiplexing, FILESPERSET, and MAXOPENFILES.
Backup Sets Properties - Quiz

SEMrush Software 4 SEMrush Banner 4