Skip Headers
Oracle® Database Backup and Recovery Advanced User's Guide
10g Release 2 (10.2)

Part Number B14191-02
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
View PDF

Tuning Recovery Manager: Overview

RMAN backup and restore operations have the following distinct components:

The slowest of these operations in any RMAN task is called the bottleneck. RMAN tuning involves identifying the bottlenecks for a given task and using RMAN commands, initialization parameter settings, or adjustments to physical media to improve performance on the backup.

The key to tuning RMAN is understanding how it performs I/O. RMAN's backup and restore jobs use two types of I/O buffers: DISK and tertiary storage (usually tape). When performing a backup, RMAN reads input files using disk buffers and writes the output backup file by using either disk or tape buffers. Restore operations use disk or tape buffers for input, depending on where the backup is stored, and disk buffers for output.

To tune RMAN effectively, you must thoroughly understand concepts such as synchronous and asynchronous I/O, disk and tape buffers, and channel architecture. When you understand these concepts, then you can learn how to use fixed views to monitor bottlenecks, and use the techniques described in "Tuning RMAN Backup Performance: Procedure" to solve problems.

There are a number of concepts that affect RMAN performance and that can therefore influence your strategy for backup performance tuning:

I/O Buffer Allocation

RMAN I/O uses two different types of buffers: disk and tape. These buffers are typically different sizes. They are allocated differently, depending upon the device type and the role the buffer plays in an RMAN operation.

Allocation for Disk Buffers

To understand how RMAN allocates buffers to read datafiles during backups, you must understand how RMAN multiplexing works.

RMAN multiplexing is RMAN's ability to read a number of files in a backup simultaneously from different sources to improve reading performance, and then write them to a single backup piece. The level of multiplexing is the number of files read simultaneously.

Multiplexing is described at greater length in "Multiplexed Backup Sets". The level of multiplexing is determined by the algorithm described in "Algorithm for Multiplexed Backups". Review this section before proceeding.

When RMAN backs up from disk, it uses the rules described in the following table to determine how large to make the buffers.

Table 11-1 Datafile Read Buffer Sizing Algorithm

Level of Multiplexing Resulting Buffer Size

Less than or equal to 4

RMAN allocates buffers of size 1 MB so that the total buffer size for all the input files is 16 MB.

Greater than 4 but less than or equal to 8

RMAN allocates disk buffers of size 512 KB so that the total buffer size for all the files is less than 16 MB.

Greater than 8

RMAN allocates a fixed 4 disk buffers of 128 KB for each file, so that the total size is 512 KB for each file.


The number of buffers allocated depends on the following rules:

  • When the ouput of the backup resides on disk, 4 buffers are allocated, their size being operating system dependent.

  • If the operation is a restore, and the backup resides on disk, 4 buffers are allocated, their size being operating system dependent.

  • When restoring a backup, for each active datafile 4 buffers of 128K are allocated.

  • When image copies are produced, only 4 buffers in total are allocated, each of an operating system dependent size.

Allocation of Tape Buffers

If you backup to or restore from an sbt device, then by default the database allocates four buffers for each channel for the tape writers (or reads if doing a restore). The size of these buffers is platform dependent, but is typically 256K. This value can be changed using the ALLOCATE or SEND command using the PARMS and the BLKSIZE option.

RMAN allocates the tape buffers in the SGA if I/O slaves are being used, or the PGA otherwise.

If you use I/O slaves, then set the LARGE_POOL_SIZE initialization parameter to set aside SGA memory dedicated to holding these large memory allocations. This prevents RMAN I/O buffers from competing with the library cache for SGA memory. If I/O slaves for tape I/O were requested but there is not enough space in the SGA for them, slaves are not used, and a message appears in the alert log.

Synchronous and Asynchronous I/O

When RMAN reads or writes data, the I/O is either synchronous or asynchronous. When the I/O is synchronous, a server process can perform only one task at a time. When it is asynchronous, a server process can begin an I/O and then perform other work while waiting for the I/O to complete. It can also begin multiple I/O operations before waiting for the first to complete.

Some operating systems support native asynchronous disk I/O. The database takes advantage of this feature if it is available. On operating systems that do not support native asynchronous I/O, the database can simulate it with special I/O slave processes that are dedicated to performing I/O on behalf of another process. You can control disk I/O slaves by setting the DBWR_IO_SLAVES parameter to a nonzero value. The database allocates four backup disk I/O slaves for any nonzero value of DBWR_IO_SLAVES.

By contrast, tape I/O is always synchronous. For tape I/O, each channel allocated (whether manually or based on a CONFIGURE command) corresponds to a server process, called here a channel process.

Synchronous I/O: Example

Figure 11-1 shows synchronous I/O in a backup to tape.

Figure 11-1 Synchronous I/O

Description of Figure 11-1 follows
Description of "Figure 11-1 Synchronous I/O"

The following steps occur:

  1. The channel process composes a tape buffer.

  2. The channel process executes media manager code that processes the tape buffer and internalizes it for further processing and storage by the media manager.

  3. The media manager code returns a message to the server process stating that it has completed writing.

  4. The channel process can initiate a new task.

Figure 11-2 shows asynchronous I/O in a tape backup. Asynchronous I/O to tape is simulated by using tape slaves. In this case, each allocated channel corresponds to a server process, which in the explanation which follows is identified as a channel process. For each channel process, one tape slave is started (or more than one, in the case of multiple copies).

Figure 11-2 Asynchronous I/O

Description of Figure 11-2 follows
Description of "Figure 11-2 Asynchronous I/O"

The following steps occur:

  1. A channel process writes blocks to a tape buffer.

  2. The channel process sends a message to the tape slave process to process the tape buffer. The tape slave process executes media manager code that processes the tape buffer and internalizes it so that the media manager can process it.

  3. While the tape slave process is writing, the channel process is free to read data from the datafiles and prepare more output buffers.

  4. Once the tape slave channel returns from the media manager code, it requests a new tape buffer, which usually is ready. Thus waiting time for the channel process is reduced, and the backup is completed faster.

Factors Affecting Backup Speed to Tape

The following factors affect the speed of the backup to tape:

Native Transfer Rate

The tape native transfer rate is the speed of writing to a tape without compression. This speed represents the upper limit of the backup rate. The upper limit of your backup performance should be the aggregate transfer rate of all of your tape drives. If your backup is already performing at that rate, and if it is not using an excessive amount of CPU, then RMAN performance tuning will not help.

Tape Compression

The level of tape compression is very important for backup performance. If the tape has good compression, then the sustained backup rate is faster. For example, if the compression ratio is 2:1 and native transfer rate of the tape drive is 6 MB/s, then the resulting backup speed is 12 MB/s. In this case, RMAN must be able to read disks with a throughput of more than 12 MB/s or the disk becomes the bottleneck for the backup.

Note:

You should not use both tape compression provided by the media manager and binary backupset compression as provided by RMAN. If the media manager compression is efficient, then it is usually the better choice. Using RMAN compressed backupsets can be an effective alternative if you need to reduce bandwidth used to move uncompressed backupsets over a network to the media manager, and if the CPU overhead required to compress the data in RMAN is acceptable.

See Oracle Database Backup and Recovery Basics for more on using compressed backupsets.

Tape Streaming

Tape streaming during write operations has a major impact on tape backup performance. Almost all tape drives currently on the market are fixed-speed, streaming tape drives. Because such drives can only write data at one speed, when they run out of data to write to tape, the tape must slow down and stop. Generally, when the drive's buffer empties, the tape is moving so quickly that it actually overshoots; to continue writing, the drive must rewind the tape to locate the point where it stopped writing.

Physical Tape Block Size

The physical tape block size can affect backup performance. The block size is the amount of data written by media management software to a tape in one write operation. In general, the larger the tape block size, the faster the backup. Note that physical tape block size is not controlled by RMAN or the Oracle database server, but by media management software. See your media management software's documentation for details.