RMAN Interview Questions and Answers

1. What is RMAN?

Recovery Manager is a tool that: manages the process of creating backups and also manages the process of restoring and recovering from them.

2. What is the difference between using recovery catalog and control file?
 When new incarnation happens, the old backup information in control file will be lost. It will be preserved   in recovery catalog. In recovery catalog we can store scripts, Recovery catalog is central and can have   information of many databases.
3. Can we use same target database as catalog?
No, The recovery catalog should not reside in the target database (database should be backed up), because the database can’t be recovered in the mounted state.
4. How do you know that how much RMAN task has been completed?
   By querying v$rman_status or v$session_longops
5. From where list & report commands will get input?
Both the commands command quering v$ and recovery catalog views. V$BACKUP_FILES or many of the recovery catalog views such as
RC_DATAFILE_COPY or RC_ARCHIVED_LOG.
6. Command to delete archive logs older than 7days?
RMAN> delete archivelog all completed before sysdate-7;
7.How to view the current defaults for the database.
RMAN> show all;

8. How to put manual/user-managed backup in RMAN (recovery catalog)?
By using catalog command.
Rman> CATALOG START WITH ‘/tmp/backup.ctl’;


9. What are the differences between crosscheck and validate commands?
Cross check : it will check the backup to exits or not at OS level
Validate     : it will check the backup to restore or not.

10.  How can you see the Current SCN number of the database?

     Select current_scn from v$database;


11. ORACLE RMAN RECOVERY SCENARIOS
How  to recover a datafile  ?
RMAN>run
{
sql ‘alter tablespace mydata offline’;
restore tablespace mydata;
recover tablespace mydata;
sql ‘alter tablespace mydata online’;
}
How to recover a system datafile ?
RMAN>run
{
shutdown immediate;
startup mount;
restore datafile 1;
recover datafile 1;
sql ‘alter database open’;
}

How to Recover a Sysaux Datafile ?


RMAN>run
{
sql ‘alter tablespace mydata offline’;
restore tablespace mydata;
recover tablespace mydata;
sql ‘alter tablespace mydata online’;
}
How to recover a redolog files ?
RMAN>run
{
shutdown immediate;
startup mount;
set until scn 1234; or set until time “to_date(‘2011-01-05 11:30:00’,’YYYY-MM-DD hh24:mi:ss’)”;
recover database;
sql ‘alter database open resetlogs’;
}
How to recover a controlfiles ?
RMAN> run
{
shutdown immediate;
startup nomount;
restore controlfile from autobackup;
sql ‘alter database mount’;
recover database;
sql ‘alter database open resetlogs’;
}

12. How would I start the database if only users with the RESTRICTED SESSION privilege need to access it? 
Startup restrict

13. What is hit ratio?
  It is a measure of well the data cache buffer is handling requests for data. Hit Ratio =            (Logical Reads - Physical Reads - Hits Misses)/ Logical Reads.

14. What happens when you run ALTER DATABASE OPEN RESETLOGS ? The current online redo 

logs are archived, the log sequence number is reset to 1, new database incarnation is created, 
and the online redo logs are given a new time stamp and SCN.

15. In what scenarios open resetlogs required ?

An ALTER DATABASE OPEN RESETLOGS statement is required after incomplete recovery 
(Point in Time Recovery) or recovery with a backup control file.



16. What is SCN (System Change Number) ?

The system change number (SCN) is an ever-increasing value that uniquely identifies a 
committed version of the database at a point in time. Every time a user commits a transaction
Oracle records a new SCN in redo logs.

Oracle uses SCNs in control files datafile headers and redo records. Every redo log file has both a log sequence number and low and high SCN. The low SCN records the lowest SCN recorded in the log file while the high SCN records the highest SCN in the log file.


17.  What are the Architectural components of RMAN?

1.RMAN executable
2.Server processes
3.Channels
4.Target database
5.Recovery catalog database (optional)
6.Media management layer (optional)
7.Backups, backup sets, and backup pieces

18.  What are Channels?

A channel is an RMAN server process started when there is a need to communicate with an I/O device, such as a disk or a tape. A channel is what reads and writes RMAN backup files. It is through the allocation of channels that you govern I/O characteristics such as:
     Type of I/O device being read or written to, either a disk or an sbt_tape 
      Number of processes simultaneously accessing an I/O device
      Maximum size of files created on I/O devices
      Maximum rate at which database files are read
      Maximum number of files open at a time
      
19.  Why is the catalog optional?

Because RMAN manages backup and recovery operations, it requires a place to store necessary information about the database. RMAN always stores this information in the target database control file. You can also store RMAN metadata in a recovery catalog schema contained in a separate database. The recovery catalog
schema must be stored in a database other than the target database.

20.  What does complete RMAN backup consist of ? 

A backup of all or part of your database. This results from issuing an RMAN backup command. A backup consists of one or more backup sets.

21.  What is a Backup set? 

A logical grouping of backup files -- the backup pieces -- that are created when you issue an RMAN backup command. A backup set is RMAN's name for a collection of files associated with a backup. A backup set is composed of one or more backup pieces.
22. There was a media failure. How can you find which files you must recover?
By querying the V$RECOVER_FILE view, which lists all files that need media recovery.

No comments:

Post a Comment