How to Configure and Use RMAN Compressed Backup for Oracle?

Oracle backups grow fast, and compression cuts storage and bandwidth. This article covers RMAN’s built-in BASIC, LOW, MEDIUM, and HIGH levels, external methods, setup steps, and best practices to balance CPU and space.

download-icon
Free Download
for VM, OS, DB, File, NAS, etc.
nick-zhao

Updated by Nick Zhao on 2025/05/20

Table of contents
  • What Is RMAN Backup?

  • Is External Compression Right for RMAN Backup?

  • RMAN Backup Compression Types

  • How to compress Oracle backup with RMAN command?

  • RMAN backup compression best practices

  • How to compress Oracle backup with Vinchin?

  • RMAN backup compression FAQS

  • Conclusion

Backups keep data safe, but they also consume storage and network resources. Oracle’s RMAN offers built-in compression to balance space savings against CPU use, and external tools let you apply OS-level compression when needed. In this article, you’ll learn what RMAN compression is, when to choose external methods, how to configure each compression level across Oracle versions, best practices for real-world performance, and how to monitor and troubleshoot your compressed backups.

What Is RMAN Backup?

RMAN (Recovery Manager) is Oracle’s native tool for full, incremental, and archived-log backups, automating consistency checks and metadata cataloging in the control file or recovery catalog. It tracks which blocks have changed, enabling block-level operations like null-block and unused-block compression before any binary compression is applied. RMAN integrates with tape devices, Oracle Secure Backup, and cloud services, and supports encryption and retention policies for streamlined recovery.

At its most basic, you connect to RMAN and run:

RMAN> BACKUP DATABASE;

This creates a backup set of data files, control files, and archived logs if configured, handling consistency automatically.

You can also tailor backups by object or mode. For example, back up specific tablespaces and archive logs in one command:

RMAN> BACKUP TABLESPACE users, temp PLUS ARCHIVELOG;

This reduces storage by excluding unneeded tablespaces and ensures logs needed for point-in-time recovery are included.

For advanced scenarios, use:

  • BACKUP AS COMPRESSED BACKUPSET for binary compression

  • BACKUP AS COPY for image copies

  • BACKUP … DEVICE TYPE sbt to target tape libraries .
    You can script complex retention windows, use CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 DAYS, and automate pruning of obsolete backups.

Is External Compression Right for RMAN Backup?

External compression means piping RMAN’s uncompressed output through OS tools like gzip, bzip2, or zip. This approach can work when you lack the Oracle Advanced Compression license or want to offload CPU work to another host. For example, you might use:

rman target / <<EOF | gzip > backup.rman.gz
BACKUP DATABASE;
EOF

However, piping adds a decompression step before recovery, which delays restores and prevents RMAN’s block-aware optimizations from shrinking empty blocks. You lose null-block and unused-block compression, and network bandwidth may increase if compression is applied after encryption.

RMAN Backup Compression Types

RMAN supports two compression categories: the default BASIC algorithm (no extra license) and the Advanced Compression option’s LOW, MEDIUM, and HIGH levels. You can enable compression permanently:

RMAN> CONFIGURE COMPRESSION ALGORITHM 'MEDIUM';
RMAN> CONFIGURE DEVICE TYPE DISK BACKUP TYPE TO COMPRESSED BACKUPSET;

Or for one-time backups:

RMAN> BACKUP AS COMPRESSED BACKUPSET DATABASE PLUS ARCHIVELOG;

Compression Levels Overview

The following table summarizes each level:

LevelLicense RequiredCPU ImpactCompression RatioBest For
BASICNoModerateMediumEnvironments without Advanced Compression option
LOWYesLowLowFast backups on CPU-constrained systems
MEDIUMYesMediumHighBalanced workloads and cloud backups
HIGHYesHighVery HighStorage-critical backups in off-peak windows

Precompression Block Processing

Before binary compression, RMAN can zero out free space within blocks (OPTIMIZE FOR LOAD FALSE) to improve ratios on fragmented tablespaces. Null-block compression skips never-written blocks; unused-block compression omits allocated but empty blocks. Both occur before the chosen binary algorithm, maximizing space savings without extra license fees .

How to compress Oracle backup with RMAN command?

Below are step-by-step instructions for various skill levels.

Basic Oracle database compression

First, configure the default algorithm:

RMAN> CONFIGURE COMPRESSION ALGORITHM 'BASIC';

Then enable it on disk:

RMAN> CONFIGURE DEVICE TYPE DISK BACKUP TYPE TO COMPRESSED BACKUPSET;

Finally, run:

RMAN> BACKUP DATABASE;

This uses BASIC compression by default, giving you decent savings without an Advanced Compression license.

One-off compressed backup

For a one-off compressed backup without altering defaults, run:

RMAN> BACKUP AS COMPRESSED BACKUPSET DATABASE PLUS ARCHIVELOG;

To specify MEDIUM or HIGH:

RMAN> BACKUP AS COMPRESSED BACKUPSET DATABASE COMPRESSED FOR MEDIUM;

(Note: COMPRESSED FOR syntax is supported in Oracle 12.2, 18c, 19c, and later).

Advanced Oracle Database Compression

To include zeroing of free space:

RMAN> SET OPTIMIZE FOR LOAD FALSE;
RMAN> BACKUP AS COMPRESSED BACKUPSET DATABASE;

To switch compression levels mid-session:

RMAN> SET COMPRESSION ALGORITHM 'HIGH';
RMAN> BACKUP AS COMPRESSED BACKUPSET DATABASE;

Monitor CPU versus time to choose the best level for OLTP or batch windows.

RMAN backup compression best practices

Effective compression comes from testing and monitoring:

  • Test each level on staging before production.

  • Use MEDIUM for mixed workloads; reserve HIGH for off-peak archives.

  • Avoid LOW on data-intensive loads—its ratio may not justify even its small CPU footprint.

  • Schedule runs with HIGH in windows of low user activity.

  • Combine with incremental backups to limit full backup frequency.

  • Always monitor using:

    SELECT set_count,
           compression_level,
           compressed_bytes,
           uncompressed_bytes
      FROM V$BACKUP_SET
     WHERE compression_level = 'MEDIUM';
  • Diagnose high CPU with V$SESSION_LONGOPS and OS tools like top, pidstat, and iostat to pinpoint RMAN channels causing load spikes.

Compression before encryption yields better overall throughput—set CONFIGURE ENCRYPTION FOR DATABASE ON after configuring compression.

How to compress Oracle backup with Vinchin?

Now let’s turn to a powerful enterprise solution. Vinchin is a professional, enterprise-level database backup solution that supports today’s mainstream databases—Oracle, MySQL, SQL Server, MariaDB, PostgreSQL, and PostgresPro.

Vinchin’s database-protection capabilities include cloud backup and tape archiving, full, incremental, and log backup, archived log backup for Oracle and PostgreSQL, scheduled backup with source-side Oracle data compression and deduplication, and ransomware protection.

The Vinchin web console is simple and intuitive. To back up an Oracle database, you typically:

1. Select the database to backup

Select Oracle Database

2. Choose the backup storage

Select the backup storage

3. Define the backup strategy (full, incremental, schedule, Oracle compression)

Select the backup strategies

4. Submit the job

Submit the job

Vinchin serves a global customer base with top ratings. Try all features free for 60 days—click the button to download and deploy in minutes.

RMAN backup compression FAQS

Q1. How do I restore a compressed backup?
Use CATALOG START WITH '/path/to/backup'; RESTORE DATABASE; RECOVER DATABASE; in RMAN to register and apply the backup.

Q2. Can I switch compression levels mid-stream?
No; RMAN applies the level you specify at backup time and retains it for that backup set.

Q3. Does RMAN compression affect recovery time?
Yes; higher levels take more CPU on restore, so balance for your recovery-time objectives.

Q4. Can I use compression with encrypted backups?
Yes; configure compression first, then enable encryption to minimize encrypted data size.

Q5. How do I verify compression effectiveness?
Query V$BACKUP_SET or V$BACKUP_PIECE to compare COMPRESSED_BYTES and UNCOMPRESSED_BYTES ratios.

Conclusion

RMAN’s built-in compression features—from BASIC through HIGH—let you fine-tune the trade-off between storage savings and CPU use while benefiting from block-level optimizations. External compression can fill gaps when licenses are unavailable but adds complexity. Test each level under realistic loads, monitor CPU and throughput metrics, and apply compression before encryption to maximize efficiency. With these practices, you’ll achieve reliable, space-efficient backups that align with your recovery objectives.

Share on:

Categories: Database Backup