Disclaimer

Saturday, 23 November 2024

What is DUPLEX in RMAN

 

In RMAN, the SET DUPLEX command is used to create multiple copies of the same backup, a process known as backup duplexing

This feature ensures that multiple identical copies of a backup are generated simultaneously, which enhances redundancy and safeguards against backup corruption or media failures.



What is DUPLEX in RMAN?

  • DUPLEX specifies how many copies of a backup RMAN should create in a single operation.
  • The backup copies are identical and are written to the specified locations or devices.



Syntax Example:


SET DUPLEX = 2; BACKUP DATABASE;
  • This creates 2 copies of each backup piece during the backup operation.



How it Works

  • When you allocate channels (e.g., ch1 in your example), RMAN writes the specified number of copies of each backup piece to the designated destination(s).
  • If you specify DUPLEX=2, RMAN writes two identical backup sets to the configured destinations.
  • Duplexing works with both disk and SBT_TAPE backups.



Practical Example:-

Tape Backup with Duplexing:


RMAN> ALLOCATE CHANNEL ch1 DEVICE TYPE SBT_TAPE PARMS 'ENV=(TDPO_PROFILE=/usr/tivoli/tsm/client/oracle/bin64/tdpo.opt)';

RMAN> SET DUPLEX = 2;

RMAN> BACKUP DATABASE PLUS ARCHIVELOG;


  • This command backs up the database to the tape device and creates two identical copies of each backup piece.

Disk Backup with Duplexing:


RMAN> CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET;
RMAN> SET DUPLEX = 2;
RMAN> BACKUP DATABASE FORMAT '/backup/dir1/db_%U', '/backup/dir2/db_%U';
  • Here, the backup pieces are duplicated and stored in two separate directories (/backup/dir1 and /backup/dir2).


Advantages of DUPLEX

  • Increased Redundancy: Multiple backup copies provide additional safety in case of media failure or corruption.
  • Streamlined Operations: Both copies are created simultaneously, saving time compared to running the backup twice.
  • Compliance: Useful for meeting regulatory or organizational requirements for multiple backup copies.



Limitations of DUPLEX

  • Resource Usage: Requires more storage space since duplicate copies are created.
  • Not Available for Image Copies: Duplexing is supported only for backup sets, not image copies.
  • Number of Copies: RMAN supports duplexing for up to 4 copies.



Key Notes

  • Default Configuration: By default, RMAN creates only one copy of each backup piece unless duplexing is explicitly configured.
  • Persistent Configuration: You can configure duplexing persistently for future backups:

    CONFIGURE BACKUP COPIES FOR DEVICE TYPE DISK TO 2;
    This ensures that all subsequent backups to disk will automatically create two copies.



No comments:

Post a Comment

Understanding SQL Plan Baselines in Oracle Database

  Understanding SQL Plan Baselines in Oracle Database SQL Plan Baseline is the feature in Oracle started from Database 11g that helps to pre...