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.

Download Interview PDF