Question: I want to maximize the speed of my RMAN
recovery, and I want to employ parallelism for the recovery process. How
does parallel recovery relate to the number of devices?
Answer: Back before RMAN, the degree of parallelism depended upon the
number of devices that could re-apply the data files in parallel. For
example a parallel recovery from ten backups could be run in parallel if ten
separate devices should simultaneously re-apply the data files (assuming on disk
contention).
Recoveries performed in parallel can speed up the crash, instance, and media
recovery considerably. During a parallel recovery process, the SMON background
process reads the redo-log files sequentially, and the redo-blocks are then
distributed evenly to all recovery processes to be read into the buffer cache.
The parallel slave processes apply the changes to data files. If the data files
involved in the recovery are many, the parallel process really helps.
To specify the number of concurrent recovery processes for instance or crash
recover use the recovery_parallelism initialization parameter to
specifies the number of concurrent recovery processes. This parameter has no
affect on media recovery. To parallelize media recovery, use the parallel clause
in the RECOVER DATABASE statement.
The SQL*Plus recovery_parallelism command specifies parallel media
recovery. The default is NOPARALLEL.
Example:
SQL>RECOVER PARALLEL integer;
SQL>RECOVER TABLESPACE myTBS, yourTBS PARALLEL (degree 4);
SQL>RECOVER DATAFILE ?/u01/orodata/NYORA/sales1.dbf? PARALLEL (DEGREE 3);
SQL>RECOVER DATABASE PARALLEL ; -- default DOP is used.
For media recovery, Oracle uses a division of labor approach to allocate
different processes to different data blocks while rolling forward, thereby
making the procedure more efficient. For example, if parallel recovery is
performed with parallel four, and only one data file is recovered, four spawned
processes read blocks from the data file and apply records instead of only one
process.
Recovery with Oracle Database 10g is automatically parallelized for these three
stages of media recovery:
* Restoration of data files.
* Application of incremental backups.
* Application of redo logs.
The number of channels configured for a database in RMAN determines the degree
of parallelism for data file restoration. In the previous example configuration,
two streams could have been involved in restoring data files since two channels
were configured. The degree of parallelism for restoration of incremental
backups is also dependent on the number of configured channels.
Redo logs are applied by RMAN using the degree of parallelism specified in the
initialization parameter recovery_parallelism.
In Oracle Database 10g, there is no server manager program, so all DBA functions
are done through SQL*PLUS. Using manual recovery methods such as SQL*PLUS,
values can be specified for recovery_parallelism, since it is a dynamic
parameter. However, it cannot exceed the setting for parallel_max_servers.
Using the DEGREE option for the RECOVER command, the degree of parallelism can
also be controlled for other recovery operations.
Also see these related notes on parallel recovery: