Skip to content

Oracle Database RMAN Interview Questions – 2

Q: What is RMAN and why is it used in Oracle databases?

Answer: RMAN (Recovery Manager) is a utility in Oracle databases that provides a centralized solution for backup and recovery operations. It is used to automate backup and recovery processes, manage backup storage, and perform disaster recovery operations.


Q: Can you explain the different types of backups in RMAN?

Answer: RMAN supports several types of backups, including full database backups, incremental backups, cumulative incremental backups, and archive log backups. Full database backups capture the entire database, while incremental backups capture only changes made since the last backup. Cumulative incremental backups capture all changes since a specific full backup, and archive log backups capture the redo logs, which are used to recover the database in the event of a failure.


Q: What are the benefits of using RMAN for backup and recovery operations?

Answer: RMAN provides several benefits for backup and recovery operations, including automation, improved backup storage management, reduced downtime during recovery operations, and the ability to perform recoveries to any point in time. RMAN also provides a centralized solution for managing backup and recovery operations, which simplifies administration and reduces the risk of human error.


Q: How does RMAN handle data corruption in Oracle databases?

Answer: RMAN can detect and repair data corruption in Oracle databases through the use of checksum validation and block checking. During a backup operation, RMAN computes a checksum for each block in the database, and during a restore operation, it validates the checksums to ensure that the data being restored is not corrupted. If RMAN detects a corrupt block, it can either repair the block or mark it as unrecoverable, depending on the configuration of the RMAN backup and recovery process.


Q: Can you explain the different types of recoveries in RMAN?

Answer: RMAN supports several types of recoveries, including complete database recovery, point-in-time recovery, and incomplete recovery. Complete database recovery is used to restore the entire database to a specific point in time, while point-in-time recovery is used to recover the database to a specific moment in time. Incomplete recovery is used to recover the database to a specific point in time, but does not guarantee that all data changes made after that time will be lost.


Q: What is the role of the control file in RMAN?

Answer: The control file in RMAN is used to track and manage backup and recovery operations. It contains information about the structure of the database, backup sets and copies, and metadata about backup and recovery operations. The control file is essential for RMAN to perform its backup and recovery operations, as it allows RMAN to track which backups are available and to identify the most recent, complete backup for use in a recovery operation.


Q: Can you explain the process of configuring RMAN for a physical standby database?

Answer: To configure RMAN for a physical standby database, you would first create a recovery catalog and configure RMAN to use it. Next, you would configure the target database connection information, such as the SID, username, and password, for the physical standby database. Finally, you would configure RMAN to perform backup operations on the physical standby database, either by using the RMAN command line interface or by using a backup script.


Q: How do you perform a point-in-time recovery with RMAN?

Answer: To perform a point-in-time recovery with RMAN, you would first restore a full database backup and any necessary archive logs. Next, you would use the RMAN “RECOVER” command with the “UNTIL” option to specify the point-in-time to which you want to recover the database. Finally, you would open the database with the “RESETLOGS” option to reset the database’s redo logs and complete the recovery.


Q: What is the role of the recovery catalog in RMAN?

Answer: The recovery catalog in RMAN is used to store metadata about RMAN backups and recoveries. This metadata includes information about the database structure, backup sets, backup copies, and information about backup and recovery operations. The recovery catalog is used by RMAN to determine which backups are available for recovery operations and to track the state of the database in the event of a failure.


Q: Can you explain the steps involved in configuring RMAN for a cross-platform database migration?

Answer: To configure RMAN for a cross-platform database migration, you would first create a backup of the source database using RMAN. Next, you would copy the backup to the target platform, and configure RMAN on the target platform to access the backup. Finally, you would use RMAN to restore the backup on the target platform, and recover the database to a specific point in time, if necessary. The target database will be configured to use the same schema and data structures as the source database, allowing for a seamless migration.


Q: Can RMAN be used for encrypted backups?

Answer: Yes, RMAN supports encrypted backups. You can encrypt RMAN backups using the “ENCRYPT” keyword in the “BACKUP” command, and specifying a valid encryption algorithm. The encrypted backups can only be restored using RMAN, and the encryption key must be available to RMAN during the restore operation.


Q: What is the process of cloning a database using RMAN?

Answer: To clone a database using RMAN, you would first create a full backup of the source database. Next, you would copy the backup to the target system and restore it on the target system using RMAN. Finally, you would use the RMAN “DUPLICATE” command to create a duplicate of the source database on the target system. The “DUPLICATE” command creates a new database using the backup, and updates the configuration files to reflect the new database instance.


Q: Can you explain the process of backing up a pluggable database using RMAN?

Answer: To backup a pluggable database (PDB) using RMAN, you would first connect to the container database (CDB) as the target database. Next, you would use the RMAN “BACKUP PLUGGABLE DATABASE” command to backup the PDB. This command creates a full backup of the PDB and all its associated datafiles, and stores it in the RMAN backup repository. The PDB backup can be used for recovery operations in the event of a failure.


Q: How does RMAN handle a media failure during a backup operation?

Answer: RMAN is designed to handle media failures during backup operations by automatically failing over to another backup destination. For example, if a disk-based backup destination fails during a backup operation, RMAN will automatically switch to another disk or tape backup destination, if one is available. RMAN also provides the ability to configure backup sets and backup copies, allowing you to have multiple backup destinations for redundancy and improved reliability.


Q: What is the process of creating a recovery catalog in RMAN?

Answer: To create a recovery catalog in RMAN, you would first create a database schema to hold the recovery catalog information. Next, you would connect to the target database as the recovery catalog owner and use the RMAN “CREATE CATALOG” command to create the recovery catalog schema. Finally, you would register the target database with the recovery catalog using the RMAN “REGISTER DATABASE” command. The recovery catalog is used to store metadata about RMAN backups and recoveries, and is used by RMAN to manage backup and recovery operations.


Q: What is the process of backing up a 19c CDB-PDB using RMAN?

Answer: To backup a 19c CDB-PDB using RMAN, you would first connect to the container database (CDB) as the target database. Next, you would use the RMAN “BACKUP PLUGGABLE DATABASE” command to backup a specific pluggable database (PDB), or use the “BACKUP DATABASE” command to backup the entire CDB. These commands create a full backup of the CDB or PDB and all its associated datafiles, and store it in the RMAN backup repository. The CDB-PDB backup can be used for recovery operations in the event of a failure.


Q: How does RMAN handle a media failure during a CDB-PDB backup operation?

Answer: RMAN is designed to handle media failures during CDB-PDB backup operations by automatically failing over to another backup destination. For example, if a disk-based backup destination fails during a backup operation, RMAN will automatically switch to another disk or tape backup destination, if one is available. RMAN also provides the ability to configure backup sets and backup copies, allowing you to have multiple backup destinations for redundancy and improved reliability.


Q: What is the process of cloning a CDB-PDB using RMAN?

Answer: To clone a CDB-PDB using RMAN, you would first create a full backup of the source CDB or PDB. Next, you would copy the backup to the target system and restore it on the target system using RMAN. Finally, you would use the RMAN “DUPLICATE” command to create a duplicate of the source CDB or PDB on the target system. The “DUPLICATE” command creates a new CDB or PDB using the backup, and updates the configuration files to reflect the new database instance.


Q: How do you perform a point-in-time recovery for a CDB-PDB using RMAN?

Answer: To perform a point-in-time recovery for a CDB-PDB using RMAN, you would first restore a full CDB or PDB backup and any necessary archive logs. Next, you would use the RMAN “RECOVER PLUGGABLE DATABASE” command to recover the PDB, or the “RECOVER DATABASE” command to recover the CDB, with the “UNTIL” option to specify the point-in-time to which you want to recover the database. Finally, you would open the CDB or PDB with the “RESETLOGS” option to reset the database’s redo logs and complete the recovery.


Q: How would you recover a dropped table using RMAN in an Oracle 19c CDB-PDB environment?

Answer: To recover a dropped table using RMAN in an Oracle 19c CDB-PDB environment, you would follow these steps:
Determine the most recent backup of the CDB or PDB that contains the dropped table.
Restore the CDB or PDB backup to the target system using RMAN.
Use RMAN to recover the CDB or PDB to the point in time just before the table was dropped.
Use the FLASHBACK TABLE command to recover the dropped table.
Open the CDB or PDB with the RESETLOGS option to reset the redo logs and complete the recovery.


Q: How would you perform a partial database recovery using RMAN in an Oracle 19c CDB-PDB environment?

Answer: To perform a partial database recovery using RMAN in an Oracle 19c CDB-PDB environment, you would follow these steps:

Identify the damaged or corrupted datafiles that need to be recovered.
Determine the most recent backup of the CDB or PDB that contains the damaged datafiles.
Restore the CDB or PDB backup to the target system using RMAN.
Use RMAN to recover the damaged datafiles to the point in time just before the corruption occurred.


Q: Explain how to take a hot backup of an Oracle 19c CDB-PDB environment using RMAN.

Answer: To take a hot backup of an Oracle 19c CDB-PDB environment using RMAN, you would use the following RMAN commands:
RMAN> CONNECT TARGET /
RMAN> CONFIGURE CONTROLFILE AUTOBACKUP ON;
RMAN> CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO ‘<backup_location>/control_%F’;
RMAN> BACKUP AS COPY DATABASE PLUS ARCHIVELOG;


Q: Explain how to perform a point-in-time recovery using RMAN in an Oracle 19c CDB-PDB environment.

Answer: To perform a point-in-time recovery using RMAN in an Oracle 19c CDB-PDB environment, you would use the following RMAN commands:
RMAN> CONNECT TARGET /
RMAN> RESTORE DATABASE TO TIME “TO_DATE(‘2023-01-01 12:00:00’, ‘YYYY-MM-DD HH24:MI:SS’)”;
RMAN> RECOVER DATABASE;
RMAN> ALTER DATABASE OPEN RESETLOGS;


Q: Explain how to perform a full database restore and recovery using RMAN in an Oracle 19c CDB-PDB environment.

Answer: To perform a full database restore and recovery using RMAN in an Oracle 19c CDB-PDB environment, you would use the following RMAN commands:
RMAN> CONNECT TARGET /
RMAN> RESTORE DATABASE;
RMAN> RECOVER DATABASE;
RMAN> ALTER DATABASE OPEN RESETLOGS;


Q: How would you perform incremental backup and recovery using RMAN in an Oracle 19c CDB-PDB environment?

Answer: To perform incremental backup and recovery using RMAN in an Oracle 19c CDB-PDB environment, you would follow these steps:

Take an initial full backup of the CDB or PDB using RMAN.
Create an incremental level 1 backup policy using RMAN.
Schedule regular incremental level 1 backups using RMAN.
If a datafile is damaged or corrupted, restore the latest full backup and all subsequent incremental backups using RMAN.
Use RMAN to recover the damaged datafiles to the point in time just before the corruption occurred.
Open the CDB or PDB with the RESETLOGS option to reset the redo logs and complete the recovery.


Q: Explain how to recover a lost control file using RMAN in an Oracle 19c CDB-PDB environment.

Answer: To recover a lost control file using RMAN in an Oracle 19c CDB-PDB environment, you would follow these steps:

Ensure that you have at least one backup of the control file.
Start the database in NOMOUNT mode.
Connect to RMAN and set the target database to NOMOUNT mode.
Use the RESTORE CONTROLFILE command to restore the control file from backup.
Use the ALTER DATABASE MOUNT command to mount the database.
Use the RECOVER DATABASE command to recover the database.
Use the ALTER DATABASE OPEN RESETLOGS command to open the database with the reset logs option.


Q: Explain how to duplicate a database using RMAN in an Oracle 19c CDB-PDB environment.

Answer: To duplicate a database using RMAN in an Oracle 19c CDB-PDB environment, you would follow these steps:
Create a backup of the source database using RMAN.
Copy the backup files to the target server.
Create a duplicate target database using RMAN.
Connect to RMAN and set the target database to NOMOUNT mode.
Use the DUPLICATE TARGET DATABASE command to duplicate the database to the target system.
Open the duplicate database with the RESETLOGS option to reset the redo logs and complete the duplication process.

Brijesh Gogia
Leave a Reply