Oracle RMAN Compressed Backups and Backup Types (Backupset / Copy)

English

Oracle Recovery Manager (RMAN) is a powerful standard tool for managing database backup and recovery. It allows for flexible configurations, such as saving storage with “Compressed Backups” or accelerating recovery with “Image Copies,” depending on operational requirements.

In this article, we will explain the differences between Backupset, Compressed Backupset, and Copy (Image Copy), as well as detailed configuration methods using the CONFIGURE command, which is essential for operational automation.

Conclusion: How to Choose a Backup Method

The backup method is determined by the balance of storage capacity, CPU resources, and Recovery Time Objective (RTO).

  • Priority on Storage Capacity: Compressed Backupset
  • Priority on Recovery Speed: Copy (Image Copy)
  • Standard Operation: Backupset (Normal Backup Set)

1. Basic Configuration using the CONFIGURE Command

Using the CONFIGURE command allows you to permanently set the default behavior of backups. This saves the effort of specifying options on the command line every time and helps standardize operations.

Setting the Default Backup Format

# Set default to "Compressed Backupset"
RMAN> CONFIGURE DEVICE TYPE DISK BACKUP TYPE TO COMPRESSED BACKUPSET;

# Set default to "Image Copy"
RMAN> CONFIGURE DEVICE TYPE DISK BACKUP TYPE TO COPY;

# Revert default to "Normal Backupset"
RMAN> CONFIGURE DEVICE TYPE DISK BACKUP TYPE TO BACKUPSET;

Verification and Initialization of Settings

# Display all current settings
RMAN> SHOW ALL;

# Restore settings to the original installation defaults
RMAN> CONFIGURE DEVICE TYPE DISK CLEAR;

2. RMAN Backup Methods (Backupset / Copy)

RMAN primarily offers two formats: “Backup Set” and “Image Copy.”

2.1 Backupset

This is a logical backup format unique to RMAN, created using the BACKUP command.

  • Mechanism: Aggregates multiple data files into one or more backup pieces (physical files).
  • Features:
    • Unused Block Skipping: Saves space by skipping areas where no data has been written, making it smaller than the actual size.
    • Proprietary Format: Can only be restored via RMAN; files cannot be handled directly with OS commands.

Execution Example: Taking a Backup Set

# Execute a basic database backup
RMAN> BACKUP DATABASE;

# Execute while specifying the destination directory and filename
RMAN> BACKUP DATABASE FORMAT '/backup/%d_%T_%U.bkp';

2.2 Compressed Backupset

This format applies binary compression at the RMAN level to a backup set.

  • Features:
    • Significant Storage Reduction: In addition to skipping unused blocks, it strongly compresses the data itself.
    • CPU Load: Compression processing increases the CPU load during backup execution.

Execution Example: Taking a Compressed Backup

# Back up the entire database with compression
RMAN> BACKUP AS COMPRESSED BACKUPSET DATABASE;

# Back up specifying the compression algorithm (MEDIUM)
RMAN> BACKUP AS COMPRESSED BACKUPSET
       DATABASE
       FORMAT '/backup/%d_%T_%U.bkp'
       COMPRESSED BACKUPSET ALGORITHM 'MEDIUM';

Note: Use of LOW, MEDIUM, or HIGH compression levels requires the Oracle Advanced Compression option license.

2.3 Copy (Image Copy)

This method duplicates data files exactly as they are, identical to an OS-level copy.

  • Features:
    • Fast Recovery: Since the file format is unchanged, recovery is possible simply by replacing (switching) the files during a failure.
    • Capacity Consumption: Consumes the same amount of storage as the production database because it copies all blocks, including unused ones.

Execution Example: Taking an Image Copy

# Take an image copy of the entire database
RMAN> BACKUP AS COPY DATABASE FORMAT '/backup/%d_%T_%U.dbf';

# Copy only a specific tablespace
RMAN> BACKUP AS COPY TABLESPACE users FORMAT '/backup/users_%T.dbf';

# Switch data files to image copies during recovery (Fast Recovery)
RMAN> SWITCH DATABASE TO COPY;

3. Types of Compression Algorithms

In Enterprise Edition (EE), the following compression levels are available:

Compression MethodDescription
BASICDefault. Available without additional licenses (EE).
LOWLowest compression ratio, but with the lightest CPU load.
MEDIUMGood balance between compression ratio and performance (Recommended).
HIGHHighest compression, but the CPU load is very high.

4. Comparison Table of Each Method

Please select the optimal method according to your operational goals.

ItemBackupsetCompressed BackupsetCopy (Image Copy)
Backup SizeSmallSmallestLarge
Unused Block SkippingYesYesNo
Recovery SpeedNormalNormalFast
Direct OS ViewingNoNoYes
CPU LoadLowHighLow

Operational and Security Considerations

  • Scope of Impact: Setting the default to compressed via CONFIGURE affects the CPU load of all backup jobs.
  • Risk: Since compressed backups consume CPU, ensure that backup windows (execution timeframes) do not overlap with business peak hours.
  • Reverting: When reverting settings, using CONFIGURE ... CLEAR is the most reliable method.

FAQ: Frequently Asked Questions

Q: Are settings configured with CONFIGURE still effective after a restart?

A: Yes, settings are stored in the control file (or recovery catalog), so they are maintained even if RMAN or the instance is restarted.

Q: Can I use compressed backups in SE2 (Standard Edition 2)?

A: Yes, AS COMPRESSED BACKUPSET (equivalent to BASIC) is available. However, specifying MEDIUM or higher algorithms requires Enterprise Edition and the corresponding option license.

Q: Can I start the database directly from an image copy?

A: By using the SWITCH command, you can have the backup files recognized as production files, allowing recovery to be completed immediately.


Summary

  • Manage backup defaults with the CONFIGURE command to automate operations.
  • Backupset is the standard format. It automatically excludes unused space.
  • Compressed Backupset saves storage but has a high CPU load.
  • Copy should be selected when “Immediate Recovery” is a priority.

This article is based on Oracle Database 19c (screens and default values may differ in other versions).

[reference]
Oracle Database Backup and Recovery Reference, 19c

コメント

Copied title and URL