New Features of RMAN


As indicated before, RMAN was introduced in Oracle 8 and has grown in functionality and stability through Oracle 8i and Oracle 9i. Oracle Database 10g continues that tradition and provides a number of new, especially useful features. These are listed in the various sections that follow.

Use of Flash Recovery Area

The ability to flash back, or go back in time, was introduced in Oracle 9i. Oracle Database 10g has introduced a slew of new features in this area as detailed in Chapter 17. What is interesting is that a new command, FLASHBACK DATABASE, can be used to reset the whole database back in time without resorting to a Point-In-Time-Recovery (PITR) using a backup of the database. A particular table can also be restored to a previous point in time, even if it was dropped. Use of such features can sometimes obviate the need for a RMAN or user-managed recovery from backup. All this information is stored in the flash recovery area as determined by the DB_RECOVERY_FILE_DEST parameter and bounded by both the DB_RECOVERY_FILE_DEST_SIZE and DB_FLASHBACK_RETENTION_TARGET parameters for size and retention time respectively. Notice that the latter is just a target; the size parameter along with other internal adjustments may decide the actual amount of data retained for flashback purposes. Note that flashback needs to be specifically enabled, and that you can use RMAN regardless of whether flashback is enabled or not.

The flash recovery area is actually a directory or file system dedicated to storing all recovery-related data such as copies of multiplexed online redo logs and control files, archive logs, flashback logs, and finally RMAN backups as seen in Listing 9.2. In Oracle Database 10g, the flash recovery area can also be an Automatic Storage Management (ASM) disk group. Using a well-protected ASM disk group ensures that this important portion of the database is provided the right amount of protection from disaster. ASM was discussed in detail in Chapter 4, "Setting Up Automatic Storage Management."

Size of Flash Recovery Area

Note that the flash recovery area holds much more than just RMAN backups. By default, it also holds the archive logs and flashback logs. In addition, if so configured, it holds Oracle-managed files, multiplexed copies of the online redo logs, and control files. However, only the total size of this area can be defined, and when there is disk pressure on account of rapid generation of archivelogs and adequate disk is not available, RMAN backups will fail with messages such as ORA-19809: limit exceeded for recovery files and ORA-19804: cannot reclaim 52428800 bytes disk space from 2147483648 limit. Be sure to calculate and set an adequate value for the DB_RECOVERY_FILE_DEST_SIZE parameter. Note that this is independent of the actual disk space available in that filesystem or ASM disk group; this value is simply a logical upper limit and exists to prevent some runaway job from filling up the disk space.


RMAN can back up directly to the disk rather than to tape, specifically to the flash recovery area by default as you saw earlier. By configuring a large bunch of low-cost disks such as SATA (Serial ATA) to function as the flash recovery area, many organizations are trying to provide online backups using disk technology rather than tape technology. The advantages of using disk-based backup are many, including performance and shrinking time windows for backup and most importantly restoration, longevity of technology, avoidance of environmental issues that result in tape read and tape head problems, and so on. RMAN with Oracle Database 10g is poised to provide you with the ability to do this easily.

As with any other backup medium, you will have to define retention periods for backups, and RMAN will automatically manage the expiration of backups and files. This is another advantage of using the flash recovery area for backups.

Fast Incremental Backups

RMAN allows for incremental backups that can be used to back up only the blocks that were changed since the last full backup. Formerly, this was done by recording the SCN (System Change Number) at the last full backup and scanning all the data files for any block whose SCN was later than the previously recorded SCN. Although incremental backups saved backup storage space at the expense of some administrative work during a restore, all data files still had to be scanned, and this overhead made incremental backups impractical in most situations. Now, however, RMAN can perform incremental backups quickly using a new feature called block change tracking.

Block change tracking records the list of blocks in each data file that have changed in a change-tracking file. RMAN uses the change-tracking file to identify changed blocks for incremental backup quickly and directly, thus avoiding the need to scan every block in the data file during an incremental backup. After enabling change tracking, the first level 0 incremental backup still has to scan the entire data file, because the change-tracking file does not yet reflect the status of the blocks. Subsequent incremental backup that use this level 0 as parent will take advantage of the change-tracking file. There is no need to change any of the commands that were previously used to perform incremental backup; RMAN automatically uses the change-tracking files once this is configured.

Because change tracking has some minimal performance overhead on your database during normal operations, it is disabled by default.


One block change-tracking file is created for the whole database. By default, the block change-tracking file is created as an Oracle-managed file in DB_CREATE_FILE_DEST. Alternatively, you can specify the name and location of the block change-tracking file. The size of the change-tracking file is proportional to the size of the database and the number of enabled threads of redo, rather than to the amount or frequency of updates to the database. For databases up to 1TB, a 10MB change-tracking file is sufficient, with sizes doubling every TB. The command to create a change-tracking file is shown in Listing 9.3. Once created, the V$BLOCK_CHANGE_TRACKING view is populated as seen in Listing 9.3.

Listing 9.3. Creating a Change-Tracking File
 SQL> alter database enable block change tracking   2; SQL> SQL> alter database enable block change tracking using file   2  '/u04/app/oracle/product/10.1.0/db_1/oradata/TS10G/rman_chg_track.f'; Database altered. SQL> select status, bytes, filename from v$block_change_tracking; STATUS          BYTES ---------- ---------- FILENAME -------------------------------------------------------------------------------- ENABLED      11599872 /u04/app/oracle/product/10.1.0/db_1/oradata/TS10G/rman_chg_track.f 

MetaLink Note #262853.1, titled "10G RMAN Fast Incremental Backups," provides a quick overview of this useful feature.

When Should You Consider Incremental Backups?

If you are already using RMAN for your database backups, you should consider using incremental backups when the number of updates is minimal compared to the size of the database, regardless of the Oracle database version you are using. Incremental backup is especially useful for databases supporting Data WareHouse (DWH) applications, where the size of the database is large compared to the periodic updates, and you know the tablespaces or data files that would undergo changes during the data load. The use of block change tracking will further enhance the usefulness of incremental backup. Be aware, though, that recovery scenarios when incremental backups are used are slightly more complex than with full backups. This complexity can be reduced by scripting and preparing procedures for all possible recovery scenarios ahead of time.


Incrementally Updated Backups

Also known as backup merging, RMAN in Oracle Database 10g supports the merging of backup incrementals to previously created data file image copies so as to roll them forward to a specified point in time. Using these incrementally updated backups, you can reduce recovery time by applying incrementals specifically to data file image copies and avoid taking a full data file image copy. This backup method is possible only when using data file image copies, rather than backup sets, and these data file image copies are retained on disk rather than tape. This is an incredibly powerful feature that can drastically reduce backup and recovery times. The command to create and maintain such a backup is shown in Listing 9.4.

Listing 9.4. Creating an Incrementally Updated Backup
 RUN {        RECOVER COPY OF DATABASE WITH TAG 'TS10G_INCR_UPDATE';        BACKUP INCREMENTAL LEVEL 1 FOR RECOVER OF COPY WITH TAG 'TS10G_INCR_UPDATE'        DATABASE; } 

The simple example in Listing 9.4 shows how a RMAN command script can be created. Assuming this has not been run before, the first command, RECOVER COPY, will fail with error messages such as no copy of datafile 1 found to recover for those data file image copies that do not yet exist. However, the second BACKUP INCREMENTAL command with FOR RECOVER OF COPY would create a level 0 backup of all the data files in the database with the specified tag for such data files. In the second and all subsequent runs, it will produce level 1 incremental backups of all the data files in the database. If a cataloged data file image copy exists, all incremental data changes are placed in a separate backup set piece that can now be applied to the level 0 copy of the specific data file image copy.

This is clear from Listing 9.5, which is the output produced by the BACKUP command in Listing 9.4. You can see from the first set of bold lines that a level 0 image copy of data file 3 (sysaux01.dbf) was not present and hence it was created in the flash recovery area under the aptly named datafile directory. Similarly, an image copy for data file 1 (system01.dbf) was also not found and hence was created. A comparison of file sizes at the operating system showed that the sizes of the physical data files and their image copies are exactly the same. The next bold section shows that an incremental level 1 data file backup set was created for the example01.dbf, undotbs01.dbf, and users01.dbf files. This backup set piece file, of course, was created in the backupset/2005_05_09 subdirectory. Finally, the control file and SPFILE were backed up into a separate backup set piece.

Listing 9.5. Log of Incrementally Updated Backup

[View full width]

 Starting backup at 09-MAY-05 using channel ORA_DISK_1 no parent backup or copy of datafile 1 found no parent backup or copy of datafile 3 found channel ORA_DISK_1: starting datafile copy input datafile fno=00003 name=/u04/app/oracle/product/10.1.0/db_1/oradata/TS10G/sysaux01 .dbf output filename=/u04/app/oracle/product/10.1.0/db_1/flash_recovery_area/TS10G/datafile /o1_mf_sysaux_1806hz6y_.dbf tag=TS10G_INCR_UPDATE recid=65 stamp=557879069 channel ORA_DISK_1: datafile copy complete, elapsed time: 00:05:55 channel ORA_DISK_1: starting datafile copy input datafile fno=00001 name=/u04/app/oracle/product/10.1.0/db_1/oradata/TS10G/system01.dbf output filename=/u04/app/oracle/product/10.1.0/db_1/flash_recovery_area/TS10G/datafile /o1_mf_system_1806v2bw_.dbf tag=TS10G_INCR_UPDATE recid=66 stamp=557879147 channel ORA_DISK_1: datafile copy complete, elapsed time: 00:01:15 channel ORA_DISK_1: starting incremental level 1 datafile backupset channel ORA_DISK_1: specifying datafile(s) in backupset input datafile fno=00005 name=/u04/app/oracle/product/10.1.0/db_1/oradata/TS10G/example01.dbf input datafile fno=00002 name=/u04/app/oracle/product/10.1.0/db_1/oradata/TS10G/undotbs01.dbf input datafile fno=00004 name=/u04/app/oracle/product/10.1.0/db_1/oradata/TS10G/users01.dbf channel ORA_DISK_1: starting piece 1 at 09-MAY-05 channel ORA_DISK_1: finished piece 1 at 09-MAY-05 piece handle=/u04/app/oracle/product/10.1.0/db_1/flash_recovery_area/TS10G/backupset /2005_05_09/o1_mf_nnnd1_TAG20050509T221838_1806xfjs_.bkp comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01 channel ORA_DISK_1: starting incremental level 1 datafile backupset channel ORA_DISK_1: specifying datafile(s) in backupset including current controlfile in backupset including current SPFILE in backupset channel ORA_DISK_1: starting piece 1 at 09-MAY-05 channel ORA_DISK_1: finished piece 1 at 09-MAY-05 piece handle=/u04/app/oracle/product/10.1.0/db_1/flash_recovery_area/TS10G/backupset /2005_05_09/o1_mf_ncsn1_TAG20050509T221838_1806xgsf_.bkp comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01 Finished backup at 09-MAY-05 

Subsequent incremental executions of the command script would create additional backup set pieces that contain changed blocks that can be used to roll forward the previous level 0 data file image copies. Note that this roll-forward recovery merging can be performed only via RMAN, because the changes are held in a backup set piece.

Recovery Through RESETLOGS

The loss of all control files, or the loss of all copies of an online redo log file, will always force incomplete recovery whether the database was recovered via RMAN or from the traditional hot backup. One of the prerequesites before the database is opened is to perform an ALTER DATABASE OPEN RESETLOGS. In this case, the online redo logs are reset by initialization of both contents and the numbering scheme. As a result, going forward from that point in time, you will not be able to use previous backup sets, also known to RMAN as incarnations. Hence, you will have to immediately create another full backup of the database after you have opened the database with the RESETLOGS operation. With RMAN in Oracle Database 10g, this is no longer required. The procedure to restore a database is as easy and transparent as recovering a backup from the same incarnation. Also, the ALTER DATABASE OPEN RESETLOGS statement has now been modified so that the database archives the current online redo logs (if possible) before clearing the logs. This is an unexpected but welcome side effect! The only caveat is that you cannot restore a data file from a previous incarnation; you will have to perform complete database recovery.

RMAN Tuning

Current enterprise-level databases are usually 24x7, and are employed throughout by users all around the globe. RMAN now allows for additional tuning via the use of the RATE parameter, which can be used to throttle down the I/O in case backup periods affect other online users. You can also use the COMPRESSED keyword with any BACKUP command to compress the backup. This can save backup I/O and disk space at the expense of some CPU on the backup client, and can also relieve network congestion by reducing the amount of backup traffic. The BACKUP command with the DURATION option lets you specify limited time windows for backup activities and minimize load imposed by backup activities during those backup windows. When a backup runs beyond the specified time, it is aborted. An optional PARTIAL parameter can be added to display which files could not be backed up. You can also use the MINIMIZE TIME or MINIMIZE LOAD parameters with the DURATION option to ensure that backups use all available resources in the first instance or throttle the resources so that the backup window is fully utilized in the latter instance.

As well, RMAN can adjust its backup parameters dynamically using the disk topology APIs. This can influence which files are multiplexed, the level of multiplexing, as well as the number and size of buffers used for input and output disk buffers. Note that these buffers are allocated out of the LARGE_POOL_SIZE and this parameter needs to be configured properly.

Other RMAN Improvements

RMAN has introduced a slew of new features too numerous to list in detail. Briefly, they include the following:

  • Automatic file creation. Files are automatically created when data files are found missing during restore or recover operations.

  • Restore failover. If a backup piece is not found or is corrupt, RMAN can automatically use other copies if present or previous backups sets.

  • Backup set creation. The BACKUP command can now create backup sets as well as data file image copies through the use of the new BACKUP AS COPY command. The previous COPY DATAFILE command is now deprecated. Please note this change if you were backing up data file image copies.

  • Backup identification. The RESTORE restore_level PREVIEW command can be used to identify the backups required to carry out a given restore operation, based on the information in the RMAN repository. This could be backup sets or image copies, on disk or on other media such as tapes. You can now use the PREVIEW option to ensure that all required backups are available or to identify situations in which you may want to direct RMAN to use or avoid specific backups. Note that this command is different from the RESTORE restore_level VALIDATE command, which physically checks the availability of the required files.

  • Cross-platform tablespace conversion. The CONVERT TABLESPACE command performs tablespace transportation of a tablespace from a database running on one platform to a database running on a different platform. This conversion is required when the source and target's endian bytes are dissimilar. For more details, refer to MetaLink Note #243304.1.

  • Compressed backup. When the COMPRESSED option is added to any BACKUP command, the data written into the backup set is compressed to reduce the overall size of the backup set using binary compression methods. All backups that create backup sets can create compressed backup sets. Restoring compressed backup sets is no different from restoring uncompressed backup sets. Note that this compression is more efficient than the hardware compression obtained at the tape-drive level.

  • New views. The V$RMAN_OUTPUT and V$RMAN_STATUS views can now be used to view both messages and status from RMAN. Note that these are in-memory views.

There are many other small improvements that when considered together make a very strong case to move to the new version of RMAN.



    Oracle Database 10g Insider Solutions
    SUSE LINUX Enterprise Server 9 Administrators Handbook
    ISBN: 672327910
    EAN: 2147483647
    Year: 2006
    Pages: 214

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net