How to Identify RMAN Configuration in Oracle Database

 

RMAN (Recovery Manager) is a powerful tool provided by Oracle to manage backup, restore, and recovery operations. To ensure that your Oracle database is properly backed up and recoverable, it’s important to understand the RMAN configuration settings.

Identifying your RMAN configuration allows you to verify and modify the backup strategies, retention policies, and other parameters essential for maintaining a healthy and recoverable database. In this blog post, we’ll walk through how to identify the RMAN configuration settings in Oracle.

1. Connecting to RMAN

Before you can check the RMAN configuration, you need to connect to RMAN. You can do this from the Oracle command line interface or SQL*Plus.

  1. Log in as the Oracle user on your database server.
  2. Open a terminal or command prompt.
  3. Run the following command to connect to RMAN:

rman target /

This command connects RMAN to the target database as a user with appropriate privileges (typically the Oracle DBA user).

Alternatively, if you need to connect to a remote database:


rman target sys/password@db_name

Once you’re connected to RMAN, you can start checking the configuration.

2. Identifying RMAN Configuration

Once you’re connected to RMAN, you can view the configuration settings using the SHOW CONFIGURATION command. This will display the current RMAN configuration for your Oracle database, including backup parameters, retention policies, and other settings.

Run the following command:


SHOW CONFIGURATION;

This will return a list of current RMAN configuration settings, such as:

  • Backup retention policies (e.g., days for keeping backups)
  • Maximum backup sets for each backup
  • Compression settings
  • Backup destination directories
  • Parallelism settings

Here’s an example of what the output might look like:


RMAN configuration parameters for database with db_unique_name ORCL are: CONFIGURE RETENTION POLICY TO REDUNDANCY 2; CONFIGURE BACKUP OPTIMIZATION OFF; CONFIGURE DEFAULT DEVICE TYPE TO DISK; CONFIGURE CONTROLFILE AUTOBACKUP ON; CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/u01/app/oracle/flash_recovery_area/%F'; CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; CONFIGURE MAXSETSIZE TO UNLIMITED; CONFIGURE COMPRESSION ALGORITHM 'BZIP2';

3. Key RMAN Configuration Parameters to Check

Here are some of the most important RMAN configuration parameters you might want to review:

  1. Retention Policy

    • Defines how long backups are kept before being automatically deleted. You can configure it by either redundancy (number of backups) or by time.
    • Example:

      CONFIGURE RETENTION POLICY TO REDUNDANCY 2;
  2. Backup Optimization

    • Determines whether RMAN will skip backups of unchanged data files. This can save storage space.
    • Example:

      CONFIGURE BACKUP OPTIMIZATION ON;
  3. Backup Type

    • Defines whether to use BACKUPSET (recommended) or IMAGE COPY for backups.
    • Example:

      CONFIGURE DEVICE TYPE DISK BACKUP TYPE TO BACKUPSET;
  4. Parallelism

    • Controls the number of parallel backup operations that can run simultaneously, which can improve performance, especially on large databases.
    • Example:

      CONFIGURE DEVICE TYPE DISK PARALLELISM 4;
  5. Compression

    • Specifies whether RMAN should use compression for backups, which can help save storage space. Common algorithms include ZLIB and BZIP2.
    • Example:

      CONFIGURE COMPRESSION ALGORITHM 'BZIP2';
  6. Control File Autobackup

    • Ensures that RMAN automatically backs up the control file after each backup, which is important for recovery.
    • Example:

      CONFIGURE CONTROLFILE AUTOBACKUP ON;
  7. Flash Recovery Area

    • Defines the location where backups and archived logs are stored, helping with recovery.
    • Example:

      CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/u01/app/oracle/flash_recovery_area/%F';

4. Changing RMAN Configuration

If you need to modify any of these RMAN configuration settings, you can use the CONFIGURE command followed by the desired option. For example, to change the backup retention policy:


CONFIGURE RETENTION POLICY TO REDUNDANCY 3;

This would ensure that RMAN keeps the last 3 backups for each datafile.

To turn off backup optimization:


CONFIGURE BACKUP OPTIMIZATION OFF;

5. Viewing and Verifying Specific Parameters

If you need to verify a specific parameter, you can check it by running the SHOW command for that parameter:


SHOW RETENTION POLICY; SHOW BACKUP OPTIMIZATION; SHOW COMPRESSION ALGORITHM;

This will give you a quick view of individual configuration parameters.

6. Using RMAN with Oracle Enterprise Manager (OEM)

If you have Oracle Enterprise Manager (OEM) installed, you can also view and manage RMAN configuration settings from the OEM interface, which provides a user-friendly graphical interface for managing backup strategies.

Identifying the RMAN configuration in Oracle is an essential step in ensuring that your backup and recovery strategy is correctly set up. By using the SHOW CONFIGURATION command, you can easily review your RMAN settings and verify that everything is configured to meet your business needs.

Remember, it’s crucial to keep these configurations optimized according to your database’s size, the business requirements, and the recovery objectives. Regularly reviewing and adjusting the RMAN configuration ensures that your backup and recovery processes run smoothly and that your Oracle database is fully protected.

RMAN-03009: failure of allocate command on ORA_AUX_SBT_TAPE_1 channel



This is an error during Database Clone using RMAN. I was trying to restore database using RMAN Backup 


RMAN-00571: ===========================================================


RMAN-00569: ===============
ERROR MESSAGE STACK FOLLOWS ===============


RMAN-00571: ===========================================================


RMAN-03002: failure of Duplicate Db command
RMAN-05501: aborting duplication of target database


RMAN-03009: failure of allocate command on ORA_AUX_SBT_TAPE_1 channel 
ORA-19554: error allocating device, device type: SBT_TAPE, device name:


ORA-27211: Failed to load Media Management Library


Additional information: 


Cause: Backup Configuration was modified.


Solution:
Use the below command to Resolve the error and continue with Database Restore


rman auxiliary / 
run
{
allocate auxiliary channel c1 type disk;
allocate auxiliary channel c2 type disk;
duplicate database to ‘DEV’ backup location ‘/Daily_Backup/Backup_16042018’;
}
exit;
EOF

Oracle Database Recovery Manager Concepts:Script to Restore Oracle Database from RMAN Backup

During Oracle Database Cloning,restore Oracle database from RMAN backup taken on Source environment to the Target environment.





Steps for Database restore using Oracle Recovery Manager (RMAN)


1.Connect to target database 


Startup the Target database in Nomount stage


SQL> Startup nomount


2.Run the below Command to Restore Oracle database using RMAN 


rman auxiliary / 
run
{
duplicate database to ‘DEV’ backup location ‘/DB_BACKUP/Daily_Backup/daily_bkp_04102018’;
}




Where DEV is the target instance for Restore
Backup Location – Directory where RMAN backup is located


3. Verify that Oracle database is up and running.

Oracle Recovery Manager Features: BACKUP AS COPY

What is the advantage backup as copy feature in RMAN?

RMAN(Recovery Manager) utility creates backup in the form of backupsets or backup pieces by default.RMAN utility also allows other method which is similar to user managed hot backup. It can be acheived using ‘BACKUP AS COPY’ command.Using “Backup as Copy” RMAN creates backup in the form of image copies. However, we do not need to put the database in begin backup/end backup mode as in Conventional Hot Backup.

Syntax for Datafile Backup using Backup as copy:

RMAN> backup as copy datafile 1 format ‘/backup/data/datafile01.dbf’ ;



Another advantage of this feature is that it allows to create image copy of control file.

 RMAN> backup as copy current controlfile format ‘F:CntrlFile_Bkp.ctl’;  



How do we identify backups taken  as Image copies using RMAN?


Use “LIST COPY” Command. “LIST BACKUP” only gives a list of backup sets which were created using default RMAN backup Methos.

Syntax:

RMAN> LIST COPY;

How to Configure RMAN Backups into Multiple Locations?

If we need  RMAN to distribute backup sets among multiple disks on different mountpoints. We can use the below syntax to configure backup in multiple locations.

Using Allocate Channel:

RUN
{
ALLOCATE CHANNEL c1 DEVICE TYPE DISK FORMAT ‘/u01/oracle/data1’; 
ALLOCATE CHANNEL c2 DEVICE TYPE DISK FORMAT ‘/u02/oracle/data2’; 
}

Using Configure Channel:

CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT ‘/u01/%U’, ‘/u02/%U’;


Oracle RMAN (Recovery Manager) Concepts

What is the difference between obsolete and expired Backup in RMAN?

Obsolete Backup: Backup pieces or backup sets which are not needed for recovery.
We can use the REPORT OBSOLETE command to list the obsolete backups and DELETE OBSOLETE command to delete the obsolete backup.

Expired Backup:When the CROSSCHECK command is used to determine whether backups recorded in the repository still exist on disk or tape, if RMAN cannot locate the backups, then it updates their records in the RMAN repository to EXPIRED status.We can then use the DELETE EXPIRED command to remove records of expired backups from the RMAN repository.


Oracle Database Administrator Interview Questions on RMAN

RMAN INTERVIEW QUESTIONS
========================


1.What is the difference between recovery catalog and Nocatalog backup in RMAN?


NoCatalog Backup:


ByDefault RMAN connects to the target database in Nocatalog Mode.
In Nocatalog Mode, Backup Information and Metadata related to RMAN is stored in target database controlfile.


Catalog Backup:


A recovery catalog is a schema created in a separate database that contains metadata obtained from the target control file.
In recovery catalog we can store rman scripts.


We can store metadata about multiple incarnations of a single target database in the catalog.
Recovery catalog is central and can have information of many databases.
If the control file is lost and must be restored from backup, the backup configuration information is available when the database is not mounted.


2.What are the differences between crosscheck and validate commands?


Validate command is to examine a backup set and report whether it can be restored. RMAN scans all of the backup pieces in the specified backup sets and looks at the checksum to verify that the contents are intact so that backup can be successfully restored if necessary.


Crosscheck command is to verify the status of backups and copies recorded in the RMAN repository against media such as disk or tape. The crosscheck command only processes files created on the same device type as the channel running crosscheck.


3.What is obsolete backup & expired backup?


A status of “expired” means that the backup piece or backup set is not found in the backup destination.


A status of “obsolete” means the backup piece is still available, but it is no longer needed. The backup piece is no longer needed since RMAN has been configured to no longer need this piece after so many days have elapsed, or so many backups have been performed.


4.What is the difference between hot backup & RMAN backup?


We need to put the database in Backup mode for Hot  Backup. RMAN Backup does not need the database to be in Backup mode.


5. Which Tables are have information required for RMAN list & report commands ?
 V$BACKUP_FILES and recovery catalog views e.g.,  RC_DATAFILE_COPY or RC_ARCHIVED_LOG.


Below tables contain RMAN Catalog information:


RC_DATABASE_INCARNATION 
RC_BACKUP_COPY_DETAILS
RC_BACKUP_CORRUPTION
RC_BACKUP-DATAFILE_SUMMARY