Sunday, 4 August 2024

Rman backup & Restore in different locations

Introduction

Managing large Oracle database backups—especially when they exceed multiple terabytes—often forces us to use multiple mount points due to limited storage availability. In my setup, I had RMAN backup files spread across /u02 and /u03, which made restoring using a single RMAN command challenging.

Instead of restructuring storage, I used a workaround: creating soft links. This makes the backup pieces from different locations appear as though they're under one directory—simplifying the RMAN restore process.

Below is a detailed, step-by-step walkthrough based on my practical experience.


Solution

Let’s assume your backup files reside in:

  • /u02/backup/location1

  • /u03/backup/location2

Since RMAN’s DUPLICATE DATABASE command accepts only one backup source, we overcome this by consolidating all files via symbolic links.

Example Structure

In /u02/backup/location1, run the following commands:

cd /u02/backup/location1 ln -s /u03/backup/location2/PROD_df_full_143926_1.bak PROD_df_full_143926_1.bak ln -s /u03/backup/location2/PROD_df_full_143927_1.bak PROD_df_full_143927_1.bak ln -s /u03/backup/location2/PROD_df_full_143929_1.bak PROD_df_full_143929_1.bak ln -s /u03/backup/location2/PROD_df_full_143936_1.bak PROD_df_full_143936_1.bak ln -s /u03/backup/location2/PROD_df_full_143935_1.bak PROD_df_full_143935_1.bak

Afterward, executing ls -l in /u02/backup/location1 yields:

FINP01_df_full_143926_1.bak -> /u03/backup/rbackup/FINS01/FINP01_df_full_143926_1.bak FINP01_df_full_143927_1.bak -> /u03/backup/rbackup/FINS01/FINP01_df_full_143927_1.bak FINP01_df_full_143929_1.bak -> /u03/backup/rbackup/FINS01/FINP01_df_full_143929_1.bak FINP01_df_full_143936_1.bak -> /u03/backup/rbackup/FINS01/FINP01_df_full_143936_1.bak FINP01_df_full_143935_1.bak -> /u03/backup/rbackup/FINS01/FINP01_df_full_143935_1.bak

This setup tricks RMAN into recognizing all backup pieces as coming from a single location.


Step-by-Step: Using RMAN Duplicate with Soft Links

  1. Create Soft Links
    As shown above, link all backup files from /u03 into /u02.

  2. Execute the RMAN Duplicate Command
    Run this command, pointing to the single aggregated location:

    DUPLICATE TARGET DATABASE TO <TARGETDB> BACKUP LOCATION '/u02/backup/location1' NOFILENAMECHECK;

    By doing this, RMAN treats /u02/backup/location1 as the only backup source, while it effectively includes files from both mount points via soft links.


No comments:

Post a Comment