Oracle RMAN Interview Questions & Answers
Download PDF

Oracle RMAN frequently Asked Questions by expert members with experience in RMAN. So get preparation for the Oracle RMAN job interview questions

50 RMAN Questions and Answers:

RMAN Interview Questions Table of Contents:

RMAN Job Interview Questions and Answers
RMAN Job Interview Questions and Answers

1 :: Explain what is Channel? How to enable the parallel backups with RMAN?

Channel is a link that RMAN requires to link to target database. This link
is required when backup and recovery operations are performed and recorded.
This channel can be allocated manually or can be preconfigured by using
automatic channel allocation.
The number of allocated channels determines the maximum degree of
parallelism that is used during backup, restore or recovery. For example, if
you allocate 4 channels for a backup operation, 4 background processes for the
operation can run concurrently.
Parallelization of backup sets allocates multiple channels and assigns
files to specific channels. You can configure parallel backups by setting a
PARALLELISM option of the CONFIGURE command to a value greater than 1 or by
manually allocating multiple channels.
RMAN> CONFIGURE DEVICE TYPE PARALLELISM 2 BACKUP TYPE TO COMPRESSED
BACKUPSET;

2 :: Tell me what is FRA? When do you use this?

A flash recovery area, a disk location in which the database can store and
manage files related to backup and recovery.
Flash recovery area where you can store not only the traditional components
found in a backup strategy such as control files, archived log files, and
Recovery Manager (RMAN) datafile copies but also a number of other file
components such as flashback logs. The flash recovery area simplifies backup
operations, and it increases the availability of the database because many
backup and recovery operations using the flash recovery area can be performed
when the database is open and available to users.
Because the space in the flash recovery area is limited by the
initialization parameter DB_ RECOVERY_FILE_DEST_SIZE , the Oracle database
keeps track of which files are no longer needed on disk so that they can be
deleted when there is not enough free space for new files. Each time a file is
deleted from the flash recovery area, a message is written to the alert log.

A message is written to the alert log in other circumstances. If no files
can be deleted, and the recovery area used space is at 85 percent, a warning
message is issued. When the space used is at 97 percent, a critical warning is
issued. These warnings are recorded in the alert log file, are viewable in the
data dictionary view DBA_OUTSTANDING_ALERTS , and are available to you on the
main page of the EM Database Control

3 :: What is db_recovery_file_dest? When do you need to set this value?

db_recovery_file_dest and db_recovery_file_dest_size are used to specify the location and size of the Flash Recovery Area. These database intilization parameters help RMAN to manage the backup storage and delete the obsolete backups and the backups that have already been copied to a tape. At the same time, it keeps as many backups on the disks a the space limits to minimize the restoration and recovery time consumed during data recovery operations.

4 :: How to enable the encryption for RMAN backups?

If you wish to modify your existing backup environment so that all RMAN
backups are encrypted, perform the following steps:
· Set up the Oracle Encryption Wallet
· Issue the following RMAN command:
RMAN> CONFIGURE ENCRYPTION ALGORITHM 'AES256'; -- use 256 bit encryption
RMAN> CONFIGURE ENCRYPTION FOR DATABASE ON; -- encrypt backups

5 :: How to setup the physical stand by database with RMAN?

$ Export ORACLE_SID=TEST
$ rman target /
RMAN> show all;
Using target database controlfile instead of recovery catalog RMAN configuration parameters are:
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 1 DAYS;
CONFIGURE BACKUP OPTIMIZATION OFF;
CONFIGURE DEFAULT DEVICE TYPE TO DISK;
CONFIGURE CONTROLFILE AUTOBACKUP ON;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO 'I:Oracle_Backups%d_%F.rman';
CONFIGURE DEVICE TYPE DISK PARALLELISM 1;
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1;
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1;
CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT 'I:Oracle_Backups%d_%s_%p.rman';
CONFIGURE MAXSETSIZE TO UNLIMITED;
CONFIGURE SNAPSHOT CONTROLFILE NAME TO 'E:ORACLEORA92DATABASESNCFTEST.ORA';
2. Backup the current production database to create a standby database: RMAN> backup database include current controlfile for standby plus archivelog;


3. Manually copy the backup sets from I:Oracle_Backups on the production server to I:Oracle_Backups on the DR Server (location of backups must match on both production and DR).
4. On the DR Server start up the TEST database in nomount mode:
$ set ORACLE_SID=TEST
$ sqlplus /nolog
SQL> connect / as sysdba
SQL> startup nomount
SQL> exit


5. Create the standby database using RMAN (This assumes the database file structures will be identical on both servers):
$ RMAN target ‘sys/fluffy@STTEST’ auxiliary /
RMAN> duplicate target database for standby nofilenamecheck dorecover;

6. Once the DR database is created; you will need to manually add a tempfile:
SQL> alter database open read only;
SQL> alter tablespace temp add tempfile ‘F:Oracle-DatabasesTESTTEMP01.DBF’ size 500M;

7. Put the DR database into managed standby mode:
SQL> shutdown immediate
SQL> startup nomount
SQL> alter database mount standby database;
SQL> alter database recover managed standby database disconnect;

8. On the production database switch logs to initiate replication:
SQL> alter system switch logfile;
The configuration of Dataguard is now complete.

6 :: What is auxiliary channel in RMAN? When do you need this?

An auxiliary channel is a link to auxiliary instance. If you do not have automatic channels configured, then before issuing the DUPLICATE command, manually allocate at least one auxiliary channel within the same RUN command.
When a Duplicate Database created or tablespace point in time recovery is performed Auxiliary database is used. this database can either on the same host or a different host.
RUN

{
ALLOCATE AUXILIARY CHANNEL ch1 DEVICE TYPE sbt;
ALLOCATE AUXILIARY CHANNEL aux1 DEVICE TYPE DISK;
ALLOCATE AUXILIARY CHANNEL aux2 DEVICE TYPE DISK;
ALLOCATE AUXILIARY CHANNEL aux3 DEVICE TYPE DISK;
.
.
.
DUPLICATE TARGET DATABASE TO dupdb;
}

7 :: How to generate the begin backup script?

SQL>set head off
SQL>spool beginbackup.sql
SQL>select 'alter tablespace ' tablespace_name ' begin backup;' from dba_tablespaces;
SQL>spool off

This will create file beginbackup.sql with entry for all tablespaces, remove any unnecessary lines & then execute this script into SQL like

SQL>@beginbackup.sql

(Once you execute this script this will put all tablespaces in to begin backup mode)

Now create backup of your control file in Human Readable format like

alter database backup controlfile to trace as '/some/path';

You can reuse it by removing comment at beginning & replace them with connect / as sysdba
Then Copy all your datafiles, redo logs and control file from your database server to backup location.
After datafiles are copied don't forget to end backup for all tablespace
Here is the scripts
SQL>set head off
SQL>spool endbackup.sql
SQL>select 'alter tablespace ' tablespace_name ' end backup;' from dba_tablespaces;
SQL>spool off


This will create file endbackup.sql with entry for all tablespaces, remove any unnecessary lines & then execute this script into SQL like

SQL>@endbackup.sql

(Once you execute this script this will put all tablespaces in to end backup mode)

8 :: Explain the steps required to enable the RMAN backup for a target database?

1. $ rman target /
2. Configure the persistent parameter of RMAN eg :

RMAN> CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 15 DAYS;

old RMAN configuration parameters:
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 2 DAYS;
new RMAN configuration parameters:
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 15 DAYS;
new RMAN configuration parameters are successfully store
3. Script to take backup
RMAN> run {
BACKUP DATABASE PLUS ARCHIVELOG DELETE INPUT;
DELETE NOPROMPT OBSOLETE;
CROSSCHECK BACKUP;
}

9 :: Explain the steps for recovery of missing data file?

Connect to RMAN and make the affected Tablespace offline immediate.

SQL> !rman target /
RMAN> sql 'ALTER TABLESPACE DATA OFFLINE IMMEDIATE';

Perform Restore and Recover of The tablespace.

RMAN> RESTORE TABLESPACE DATA;
RMAN> RECOVER TABLESPACE DATA;

Make the status online of the tablespace.

RMAN> sql 'ALTER TABLESPACE DATA ONLINE';

In this case oracle at first create and empty datafile and then apply all archived redo logs and online redo logs on the tablespace up to the current time.
Alternate way without using RMAN :

SQL> ALTER DATABASE CREATE DATAFILE 'c:oracleoradatarheacc_capture SIZE 2048m AS datafile_file51_spec;

Determine whether you entered the correct filename. If you did, then check to see whether the log is missing from the operating system. If it is missing, and you have a backup, then restore the backup and apply the log. If you do not have a backup, then if possible perform incomplete recovery up to the point of the missing log.

10 :: What is backup set in RMAN?

RMAN can also store its backups in an RMAN-exclusive format which is called backup set. A backup set is a collection of backup pieces, each of which may contain one or more datafile backups.

11 :: What is the advantage of RMAN utility?

Advantage over tradition backup system:

1). copies only the filled blocks i.e. even if 1000 blocks is allocated to datafile but 500 are filled with data then RMAN will only create a backup for that 500 filled blocks.
2). incremental and accumulative backup.
3). catalog and no catalog option.
4). detection of corrupted blocks during backup;
5). can create and store the backup and recover scripts.
6). increase performance through automatic parallelization( allocating channels), less redo generation.

12 :: What are RTO, MTBF, and MTTR?

RTO: Recovery Time objective-is the maximum amount of time that the database can be unavailable and still stasfy SLA's
MTBF (Meant tiem Between Failure)-
MTTR (Mean tie to recover)- fast recovery solutions

13 :: Tell me can a schema be restored in oracle 9i RMAN when the schema having numerous table spaces?

RMAN gives the command to find all the tablespaces and hence the datafiles belonging to different schemas as:REPORT SCHEMA;This command lists all the schemas, tablespace names and the corresponding data files. After listing, we can restore the datafiles or the tablespaces corresponding to a particular schema.

14 :: How to verify the integrity of the image copy in RMAN environment?

Use below commands :rman> catalog datafilecopy 'f:testsystem.dbf';rman> backup validate check logical datafile 'f:testsystem.dbf';SQL> SELECT * FROM v$database_block_corruption;

15 :: Explain the steps to perform the point in time recovery with a backup which is taken before the resetlogs of the db?

RMAN can perform recovery of the whole database to a specified past time, SCN, or log sequence number. This type of recovery is sometimes called incomplete recovery because it does not completely use all of the available redo. Incomplete recovery of the whole database is also called database point-in-time recovery (DBPITR).1. Rman> RUN{ SET UNTIL TIME 'Nov 15 2002 09:00:00'; # SET UNTIL SCN 1000; # alternatively, specify SCN # SET UNTIL SEQUENCE 9923; # alternatively, specify log sequence number RESTORE DATABASE; RECOVER DATABASE;}

16 :: What is hot backup and what is cold backup?

Cold backup is a backup of database when datafiles are not opened. Hot backup is a backup when datafiles are opend and operational.Suppose your database is in mount stage ( not shutdown ) and you take a backup then it is also a cold backup since datafiles are not opened.

17 :: What is the difference between cumulative incremental and differential incremental backups?

Differential backup: This is the default type of incremental backup which backs up all blocks changed after the most recent backup at level n or lower.
Cumulative backup: Backup all blocks cahnged after the most recent backup at level n-1 or lower.

18 :: How to enable the autobackup for the controlfile using RMAN?

issue command at rman prompt..... RMAN> configure controlfile autobackup on;also we can configure controlfile backup format...... RMAN> configure controlfile autobackup format for device type disk to 2> '$HOME/BACKUP/RMAN/%F.bkp'; $HOME/BACKUP/RMAN/ this can be any desired location.

19 :: Tell me atleast 6 advantages of RMAN backups compare to traditional hot backups?

RMAN has the following advantages over Traditional backups:

1. Ability to perform INCREMENTAL backups
2. Ability to Recover one block of datafile
3. Ability to automatically backup CONTROLFILE and SPFILE
4. Ability to delete the older ARCHIVE REDOLOG files, with the new one's automatically.
5. Ability to perform backup and restore with parallelism.
6. Ability to report the files needed for the backup.
7. Ability to RESTART the failed backup, without starting from beginning.
8. Much faster when compared to other TRADITIONAL backup strategies.

20 :: Explain the steps for recovering the full database from cold backup?

Using RMAN Open the database in mount mode;Rman> restore database Recovry not required, as we are restoring from cold backup. However we can run Rman> recover database Open database now.

21 :: What are the various tape backup solutions available in the market?

There are various Media Management Layer (MML) solutions available for Oracle.

1) EMC's Legato Networker Module for Oracle
2) Symantec's Netbackup Database Agent for Oracle
3) IBM's Tivoli Storage Management (TSM) Database Agent
4) and others in the market.

22 :: How to see information about backups in RMAN?

Use this SQL to checkSQL> SELECT sid,totalwork,sofar FROM v$session_longops
WHERE sid=153;
Here give SID when back start it will show SID

23 :: How to install the RMAN recovery catalog?

Steps to be followed:
1) Create connection string at catalog database.
2) At catalog database, create one new user or use existing user and give that user a recovery_catalog_owner privilege.
3) Login into RMAN with connection string
a) export ORACLE_SID=
b) rman target catalog @connection string
4) rman> create catalog;
5) register database;

24 :: How to identify the expired, active, obsolete backups? Which RMAN command you use?

You can check by using following commandExpired Backup: List ExpiredThen use report obsolete command, it show the backup that you dont need it and after that use Delete obsolete command,It will delete the backup that you dont need it.

25 :: Explain when do you recommend hot backup? What are the pre-reqs?

Database must be Archivelog ModeArchive Destination must be set and LOG_ARCHIVE_START=TRUE (EARLIER VERSION BEFORE 10G)If you go through RMAN then CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # defaultCONFIGURE BACKUP OPTIMIZATION OFF; # defaultCONFIGURE DEFAULT DEVICE TYPE TO DISK; # defaultCONFIGURE CONTROLFILE AUTOBACKUP ON;CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/u01/oracle/autobackup/%F'; CONFIGURE DEVICE TYPE DISK PARALLELISM 2BACKUP TYPE TO BACKUPSET; # defaultCONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # defaultCONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # defaultCONFIGURE MAXSETSIZE TO UNLIMITED; # defaultCONFIGURE ENCRYPTION FOR DATABASE OFF; # defaultCONFIGURE ENCRYPTION ALGORITHM 'AES128'; # defaultCONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # defaultCONFIGURE SNAPSHOT CONTROLFILE NAME TO '/u01/app/oracle/product/10.2.0/db_2/dbs/snapcf_dba.f'; # default
RMAN Interview Questions and Answers
50 RMAN Interview Questions and Answers