Professional Documents
Culture Documents
What is the difference between recovery and restoring of the oracle database?
What are the diefferent tools available for hot backups in oracle? is it preferable
to take it manually all the time or it depends on the size of the database?
What is the disk migration?What is the steps involved in oracle disk migration?
What are the advantahes of operating a database in archivelog mode over oprating it
in no archivelog mode in oracle?
Why more redos are genarated when the oracle database is in begin backup mode?
One of my control file corrupted and I am unable to start database. Could you tell
me how to perform recovery?
If one of your control file is missing or corrupted then we have 2 options to
recover it. Check alert.log for exact name and location of corrupted control file.
Delete it manually and copy from available rest of control file and rename it and
start database. Another option is delete corrupted control file and remove name
from parameter file/ spfile. After removing said control file from spfile, start
your database.
What is the meaning of LGWR SYNC and LGWR ASYNC in log archive destination
parameter of standby configuration?
When use LGWR with SYNC, it means once network I/O initiated, LGWR has to wait for
completion of network I/O before write processing. LGWR with ASYNC, means LGWR
doesn�t wait to finish network I/O and continuing write processing.
Archive logs are being generated around 20GB in my production large database. But
one day almost double archives were generated. What is the reason behind this? How
can I check it?
There are lots of reason behind increasing size of archives like If more database
changes were performed using batch jobs or any special task like merging 2 database
or data etc. You can investigate exact root cause using enabling Log Minor utility.
How do you recover from the loss of datafile if database is running in Archivelog
mode?
We can perform this recovery in 2 ways. One is open database mode and another is
database mount mode. After taking offline lost datafile, we can bring database open
and after that restore lost datafile from last backup. After restoration of
datafile we can perform datafile level recovery for applying archive logs and make
it online. In database mount mode, we can restore datafile from backup and perform
datafile recovery using "Recover datafile" command.
Why we should need to open database using RESETLOGS after finishing incomplete
recovery?
When we are performing incomplete recovery it means we bring database to past time
or rewind period of time using change based, cancel based or time based recovery.
These all recovery make database in prior state of database. The forward sequence
number already available after performing recovery, due to mismatching of this
sequence numbers and prior state of database, it needs to open database with new
sequence number of Redo log and archive logs.
Have you faced any recovery scenario? Explain how you resolved it?
2 months back, a potential table was dropped by an application developer on our
large 24/7 running production database. Immediately he informed us. We have standby
database for our production database. We checked that archives didn�t apply to
standby database up to dropped timing. We stopped archive applying on standby
immediately and open database read only. Took export of dropped table and imported
in production database. After finishing appropriate checking of table, again we
started archive applying in standby database for refreshing.
RMAN COMMANDS
1. LIST Commands :
LIST Commands are generic RMAN commands that will show/list various types of
information when executed within RMAN utility
RMAN> list backup;
It lists all the backups taken using RMAN utility.
RMAN> list backup of database;
The above command lists out all the (individual) files that are in the backup.
RMAN> list backup of tablespace system;
The above command lists out all the files that are in the backup that belong to the
tablespace �system�.
RMAN> list backup of control file;
The above command lists out all backups of the control file.
CONFIGURE Commands :
CONFIGURE commands in RMAN are used to configure/setup various initial settings:
RMAN>CONFIGURE RETENTION POLICY TO REDUNDANCY 2;
The above commands indicates how many days the backup copies need to be retained.
Default is 1 day.
RMAN> CONFIGURE RETENTION POLICY CLEAR;
The above command resets the Retention policy to the default value of 1 day.
CONFIGURE BACKUP OPTIMIZATION ON;
The above command verifies to make sure that identical files are NOT backed up to
the device specified.
CONFIGURE BACKUP OPTIMIZATION CLEAR;
The above command resets the Optimization option to the default value
SHOW Commands :
Show commands are used to show/display the configuration setting values.
RMAN> show all;
The above command shows all the current configuration settings on the screen.
RMAN> show retention policy;
The above command shows the current retention policy.
RMAN> show default device type;
The above command shows the default device type configured for backups.
RMAN> show datafile backup copies;
The above command shows the number of backup copies available in the target
database
4. BACKUP Commands :
Backup commands are the real commands which do the actual backup work.
RMAN> backup database;
The above command backs up the database (target).
RMAN> backup database include current controlfile plus archive log;
The above command backs up the target database and the current control file and
archive log files
5. REPORT Commands :
Report commands list/report specific information. The difference between report and
list command is report command output is in a better format.
RMAN> report obsolete;
The above command reports which backups can be deleted.
DELETE Commands :
Delete commands delete/remove specific items from the server, repository catalog.
RMAN> delete obsolete;
The above command deletes all the backups that are older based on the retention
policy setup.
RMAN> List incarnation;
List Summary of Backups The summary of backups include backupset key, the status,
device type, completion time etc,
RMAN> List Backup Summary;
RMAN> List expired Backup of archivelog all summary;
RMAN> List Backup of tablespace Test summary;
List Backups of various files It provides the summary of the backups available for
each datafile, controlfile, archivelog file and spfile.
RMAN> List Backup By File;
Detailed Report If you want the detailed report on the backups, then issue the
following command.
RMAN> List Backup;
It lists the all available information about the backups. Backups used for Recovery
To list the backups used for restore and recovery,
RMAN> list recoverable backup;
Expired Backups The list backup shows both available and expired backups. To view
only the expired backups,
RMAN> List expired Backup;
RMAN> List expired Backup summary;
RMAN> List expired Backup of Archivelog all;
RMAN> List expired Backup of datafile 10;
Listing Tablespace and Datafile Backups 102 RMAN> List Backup of Tablespace Test;
RMAN> List Backup of Datafile 4;
Listing Archivelog Backups
RMAN> List Archivelog all;
RMAN> List Archivelog all backedup 2 times to device type sbt;
Listing Controlfile and Spfile Backups
RMAN> List Backup of Controlfile;
RMAN> List Backup of Spfile;
The above list commands displayed information about the backusets. If you have
performed Image copy backups then you must use the list copy command as shown
below,
RMAN> List Copy;
RMAN> List Copy of database;
RMAN> List Copy of tablespace test;
RMAN> List Copy of archivelog all;
RMAN> List Copy of archivelog from sequence 12345;
RMAN> List Copy of archivelog from sequence 1000 until sequence 1010;
RMAN> List Copy of Controlfile;
RMAN> List Copy of Spfile;
RMAN: Archivelogs lost Problem: I have lost some of the archivelog files without
taking backup. If I run the rman to backup available archive logs, it throws error
that the archivelog_seq# is not available.
Solution:
run the following command.
RMAN> change archivelog all validate;
Now you run the backup archivelog command. RMAN will backup the available
archivelogs successfully.
RMAN All major Restoration and Recovery Scenarios
Complete Closed Database Recovery.
� It is assumed that your control files are still accessible.
� You have a backup, done for example with backup database plus archivelog;
Your first step is to make sure that the target database is shut down:
$ sqlplus �/ as SYSDBA�
SQL> shutdown abort;
ORACLE instance shut down.
ii) Next, you need to start up your target database in mount mode.
� RMAN cannot restore datafiles unless the database is at least in mount mode,
because RMAN needs to be able to access the control file to determine which backup
sets are necessary 42 to recover the database.
� If the control file isn�t available, you have to recover it first. Issue the
STARTUP MOUNT command shown in the following example to mount the database
SQL> startup mount;
Oracle instance started.
Database mounted.
ii) Use RMAN to restore the database and recover the database.
To use RMAN, connect to the target database:
$ rman target / catalog rman/rman@rmancat
When the restore command is executed, RMAN will automatically go to its last good
backup set and restore the datafiles to the state they were in when that backup set
was created.
� When restoring database files, RMAN reads the datafile header and makes the
determination as to whether the file needs to be restored. The recovery is done by
allocating a channel for I/O and then issuing the RMAN restore database command.
you don�t need to allocate a channel explicitly. Instead, you can use the default
channel mode:
RMAN> restore database;
RMAN> recover database;
SQL> alter database open;
System tablespace is missing
In this case complete recovery is performed, only the system tablespace is missing,
so the database can be opened without resetlogs option.
$ rman target /
RMAN> startup mount;
RMAN> restore tablespace SYSTEM;
RMAN> recover tablespace SYSTEM;
RMAN> alter database open;
Complete Open Database Recovery. Non system tablespace is missing, database is up
$ rman target /
RMAN>sql �alter tablespace offline immediate� ;
RMAN> restore tablespace ;
RMAN> recover tablespace ;
RMAN>sql �alter tablespaceonline� ;
To restore/recover only datafile(s)
$ rman target /
RMAN>.sql �alter database datafile offline�;
RMAN> restore datafile ;
RMAN> recover datafile;
RMAN>sql �alter database datafileonline� ;
Note: datafile_name(within single quotes) can also be used instead of file#
Complete Open Database Recovery (when the database is initially closed). Non system
tablespace is missing
A user datafile is reported missing when trying to startup the database. The
datafile can be turned offline and the database started up. Restore and recovery
are performed using Rman. After recovery is performed the datafile can be turned
online again.
sqlplus �/ as sysdba �
startup mount alter database datafile offline;
alter database open;
exit;
$rman target /
RMAN> restore datafile ;
RMAN> recover datafile ;
RMAN>sql �alter tablespace online�;
Note: datafile_name(within single quotes) can also be used instead of file#
To restore a tablespace to a new location
$ rman target / catalog rman/rman@rcat
Take the tablespace offline.
Specify an accessible location to which you can restore the damaged datafile for
the offline tablespace.
Restore the datafile to the new location.
Switch the restored datafile so that the control file considers it the current
datafile.
To restore the datafiles for tablespace USERS to a new location on disk:
run
{ allocate channel ch1 type disk;
sql �ALTER TABLESPACE USERS OFFLINE IMMEDIATE�;
setnewname for datafile �/disk1/oracle/users_1.dbf� to �/disk2/oracle/users_1.dbf�;
restoretablespace users;
# make the control file recognize the restored file as current switch datafile all;
} RMAN> recover tablespace USERS;
RMAN>sql �alter tablespace USERS online�;
Recovery of a Datafile that has no backups (database is up)
If a non systemdatafile that was not backed up since the last backup, is missing,
recovery can be performed if all archived logs since the creation of the missing
datafile exist. Since the database is up you can check the tablespace name and put
it offline. The option offline immediate is used to avoid that the update of the
datafile header.
Pre requisites: All relevant archived logs.
$ rman target /
RMAN>sql �alter database datafile offline�;
RMAN> restore datafile ;
� no need to create a blank file, restore command takes care of that.
RMAN> recover datafile ;
RMAN>sql �alter database datafile online�;
Note: datafile_name(within single quotes) can also be used instead of file#
7. Control File Recovery
Case-1
� Autobackup is available Always multiplex your controlfiles. If you loose only one
controlfile you can replace it with the one you have in place, and startup the
Database. If both controlfiles are missing, the database will crash.
Pre requisites:
A backup of your controlfile and all relevant archived logs.When using Rmanalway
set configuration parameter autobackup of controlfile to ON.
rman target /
RMAN> startup nomount;
RMAN> restore controlfile from autobackup;
RMAN> alter database mount;
RMAN> recover database;
RMAN> alter database open resetlogs;
Make a new complete backup, as the database is open in a new incarnation and
previous archived log are not relevant.
Case-2
� Autobackup is not available but controlfilebackupset is available
rman target /
RMAN> startup nomount;
RMAN> restore controlfile from <backupset_Location>;
RMAN> alter database mount;
RMAN> restore database;
�required if datafile(s) have been added after the backup
RMAN> recover database;
RMAN> alter database open resetlogs;
Make a new complete backup, as the database is open in a new incarnation and
previous archived log are not relevant.
Case-3 �
If no backup is available, create the controlfile manually using script and then
recover as given above.
Note: RMAN automatically searches in specific locations for online and archived
redo logs during recovery that are not recorded in the RMAN repository, and
catalogs any that it finds. RMAN attempts to find a valid archived log in any of
the current archiving destinations with the current log format. The current format
is specified in the initialization parameter file used to start the instance (or
all instances in a Real Application Clusters installation). Similarly, RMAN
attempts to find the online redo logs by using the filenames as specified in the
control file.
Incomplete Recovery, Until time/sequence/scn
Incomplete recovery may be necessary when the database crashes and needs to be
recovered, and in the recovery process you find that an archived log is missing. In
this case recovery can only be made until the sequence before the one that is
missing. Another scenario for incomplete recovery occurs when an important object
was dropped or incorrect data was committed on it. In this case recovery needs to
be performed until before the object was dropped.
Pre requisites:
A full closed or open database backup and archived logs, the time or sequence that
the �until� recovery needs to be performed.
If the database is open, shutdown it to perform full restore.
shutdown abort
startupnomount
=============================
$rman target / rcvcatrman/rman@rcat
RMAN> run { set until time �to_date(�2012/01/23 16:00:00�, �YYYY/MM/DD
HH14:MI:SS�)�;
allocate channel d1 type disk;
restorecontrolfile to �/tmp/cf�; replicate controlfile from �/tmp/cf�;
sql �alter database mount�;
restore database;
recover database;
}
Make a new complete backup, as the database is opened in new incarnation and
previous archive logs are not relevant.
Recovering After the Loss of All Members of an Online Redo Log Group
If a media failure damages all members of an online redo log group, then different
scenarios can occur depending on the type of online redo log group affected by the
failure and the archiving mode of the database.
If the damaged log group is inactive, then it is not needed for crash recovery; if
it is active, then it is needed for crash recovery.
SQL> startup mount
Case-1
If the group is INACTIVE
Then it is not needed for crash recovery
Clear the archived or unarchived group. (For archive status, check in v$log)
Clearing Inactive, Archived Redo alter database clear logfile group 1 ;
alter database open ;
Clearing Inactive,
Not-Yet-Archived Redo alter database clear unarchivedlogfile group 1 ;
OR (If there is an offline datafile that requires the cleared log to bring it
online, then the keywords UNRECOVERABLE DATAFILE are required. The datafile and its
entire tablespace have to be dropped because the redo necessary to bring it online
is being cleared, and there is no copy of it. )
alter database clear unarchivedlogfile group 1 unrecoverable datafile;
Take a complete backup of database. And now open database:
alter database open ;
Case-2
If the group is ACTIVE
Restore backup and perform an incomplete recovery.
And open database using resetlogs
alter database open resetlogs;
Case-3
If the group is CURRENT
Restore backup and perform an incomplete recovery.
And open database using resetlogs
alter database open resetlogs;
Restoring database to new host from RMAN backup
Restore database backup and archive log backup(if hot) to target server.
2) Copy ORACLE_HOME from source to target if its not already there.
3) If you dont have a controlfile backup which was taken after the cold backup then
take a control file backup on source.
RMAN> backup current controlfile to �;
or
SQL> alter database backup controlfile to �;
4) Copy this controlfile backup to target node
5) On target:
Create pfile or copy it from target and change following parameters:
IFILE
*_DUMP_DEST
LOG_ARCHIVE_DEST
CONTROL_FILES
$ export NLS_DATE_FORMAT=�yyyy-mm-dd hh24:mi�
$ rman target /
RMAN>sql �create spfile from pfile� ;
RMAN> startup nomount ;
RMAN> restore controlfile from �/filename.ctl>� ;
RMAN> alter database mount ;
RMAN> list backup ;
Note the scn number or time of the backup you want to restore
$ rman target /
RMAN> restore database until time �� ;
OR
RMAN> restore database until scn ;
OR
RMAN> restore database from tag �� ;
And now�
RMAN> recover database;
RMAN> alter database open resetlogs ;
Note: Above method can also be used where you want to restore database from old
backups instead of latest one.
Restoring backups from tape.
Use the following steps to restore backups from tape.
$ export NLS_DATE_FORMAT=�yyyy-mm-dd hh24:mi�
RMAN> list backup ;
Note the scn or time of the backup you want to restore.
RMAN>
run{ allocate channel t1 type �SBT_TAPE� parms=�ENV=(NB_ORA_CLIENT=ibm5003bk)�;
restore database until scn ; �scn number as in list backup output
recover database;
}
Notes:
1) untilscn can be used with recover command as well for incomplete recovery. Other
option is to use set until within run block just before restore.
2) from tag �� can also be used (instead of until clause) with restore command
Block Change Tracking
RMAN Incremental Backups backup only the blocks that were changed since the lastest
base incremental backups. But RMAN had to scan the whole database to find the
changed blocks. Hence the incremental backups read the whole database and writes
only the changed blocks. Thus the incremental backups saves space but the reduction
in the time is fairly neglegible.
Block Change Tracking (BCT) is a new feature in Oracle 10g. BCT enables RMAN to
read only the blocks that were changed since the lastest base incremental backups.
Hence by enabling BCT, RMAN reads only the changed blocks and writes only the
changed blocks.
Without BCT, RMAN has to read every block in the database and compare the SCN in
the block with the SCN in the base backup. If the block�s SCN is greater than the
SCN in the base backup then the block is a candidate for the new incremental
backup. Usually only few blocks are changed between backups and the RMAN has to do
unncessary work of reading the whole database.
BCT Stores the information about the blocks being changed intheBlockChange Tracking
File. The background process that does this logging is Change Tracking Writer
(CWTR).
BlockChange Tracking File
BCT File is one per database and in the case RAC, it is shared among all the
instances. BCT File is created in the location defined by the parameter
DB_CREATE_FILE_DEST as OMF file.
To enable BCT
SQL> Alter Database Enable Block Change Tracking;
To disable BCT
SQL> Alter Database Disable Block Change Tracking;
To specify the BCT file location
SQL> Alter Database enable Block Change Tracking using File �/Backup/BCT/bct.ora�;
A useful query,
SQL> Select Completion_time, datafile_blocks, blocks_read, blocks,
used_change_tracking From v$backup_datafile where to_char(completion_time,
�dd/mon/yy�) = to_char(sysdate, �dd/mon/yy�);
Where, datafile_blocks is the total number of blocks in the datafile.
blocks_read is the total number of blocks read by
RMAN blocks is the total number of blocks backed up by the RMAN.
used_change_tracking if yes BCT is used, if no BCT is not used
Restore Vs Recovery
Restore
Restore means using the backup files to replace the original files after a media
failure.
Recovery
Recovery means bringing the database up to date using the restored files, archive
logs and online redo logs.
FRA Parameters
The following parameters are involved in setting up a FRA.
1. DB_CREATE_FILE_DEST � location for all OMF data files.
2. DB_CREATE_ONLINE_LOG_DEST_n
� location for control files and online redo log files. If this parameter is not
set then oracle creates all three types of files in the DB_CREATE_FILE_DEST
location.
3. DB_RECOVERY_FILE_DEST_SIZE �
Size of FRA.
4. DB_RECOVERY_FILE_DEST � Location of FRA.
5. LOG_ARCHIVE-DEST_N � Location of Archive log files.
For eg., DB_CREATE_FILE_DEST = /oradata/dbfiles/ LOG_ARCHIVE-DEST_1 =
�LOCATION=/export/archive/arc_dest1� LOG_ARCHIVE-DEST_2 =
�LOCATION=USE_DB_RECOVERY_FILE_DEST� DB_RECOVERY_FILE_DEST_SIZE =350GB
DB_RECOVERY_FILE_DEST=�LOCATION=/fra/rec_area�
one copy of current control file and online redo log files are stored in FRA also.
Control Files, redolog files and FRA
DB_CREATE_ONLINE_DEST_n : Setting this init parameter enable Oracle to create OMF
control files and online redolog files in the location specified by the parameter.
DB_RECOVERY_FILE_DEST : Setting this init parameter enables Oracle to create OMF
control files and online redolog files in the FRA.
Specifying both the above parameters enable Oracle to create OMF based control and
redolog files on both the locations.
Omitting the above parameters will enable Oracle to create non-OMF based control
and 108 redolog files in the system specific default location.
Setup Flash Recovery Area
To setup the FRA, you need to set two initparamters in the following order.
SQL> Alter system set DB_RECOVERY_FILE_DEST_SIZE=375809638400 scope=spfile;
SQL> Alter system set DB_RECOVERY_FILE_DEST=+ASM_FLASH scope=spfile;
When you configure FRA, LOG_ARCHIVE_DEST and LOG_ARCHIVE_DUPLEX_DEST init
parameters become obsolete. You must use the parameters LOG_ARCHIVE_DEST_n.
Log_Archive_dest_10 is by default set to USE_DB_RECOVERY_FILE_DEST. Archived log
files are stored in the FRA by default. If you have configured other locations a
copy of archived files will also be placed in other locations as well.
USE_DB_RECOVERY_FILE_DEST refers to the FRA. You can also use OEM and DBCA to
configure FRA.
Disable FRA
Question 2
What is the Difference between catalog and nocatalog mode in RMAN?
Answer
Few differences
a.Recovery catalog is central and can have information of many databases.
While in case of nocatalog, control file is used to store the information and it
can store for that database only
b. When new incarnation happens, the old backup information in control file will be
lost. It will be preserved in recovery catalog.
c. In recovery catalog, we can store scripts.
Question 3
How do u know how much RMAN task has been completed?
Answer
By querying v$rman_status or v$session_longops
SELECT SID, SERIAL#, CONTEXT, SOFAR, TOTALWORK,
ROUND(SOFAR/TOTALWORK*100,2) "%_COMPLETE"
FROM V$SESSION_LONGOPS
WHERE OPNAME LIKE 'RMAN%'
AND OPNAME NOT LIKE '%aggregate%'
AND TOTALWORK != 0
AND SOFAR <> TOTALWORK
/
Question 16
How to catalog manual/user-managed backup in RMAN ?
Answer
By using catalog command.
i. disk backup pieces you can use:
CATALOG BACKUPPIECE '<handle>';
ii. You can also catalog all the pieces inside of a directory:
CATALOG START WITH '<directory>';
iii.If backups are in recovery area, we can catalog the whole recovery area with :
CATALOG RECOVERY AREA NOPROMPT;
iv. For tape backup pieces follow:
This is an example using Oracle Secure Backup (OSB):
Define a tape channel in the RMAN automatic configuration:
CONFIGURE CHANNEL DEVICE TYPE 'SBT_TAPE'
PARMS
'SBT_LIBRARY=/usr/local/oracle/backup/lib/libobk.so,ENV=(OB_MEDIA_FAMILY=RMAN-
DEFAULT)';
*. Catalog the tape backup piece using handle:
CATALOG DEVICE TYPE 'SBT_TAPE' BACKUPPIECE '0pivagf8_1_1';
Question 17
What is the use of nofilenamecheck in RMAN ?
Answer
When NOFILENAMECHECK is used with the DUPLICATE command, RMAN does not validate the
filenames during restoration. If the primary database and the standby database are
on the same host, The DUPLICATE NOFILENAMECHECK option should not be used.
Question 18
Do we need to shutdown db to change block change tracking file?
Answer
No need. It can be enabled and disabled online
SQL> ALTER DATABASE ENABLE BLOCK CHANGE TRACKING;
Alternatively, you can specify location of block change tracking file:
SQL> ALTER DATABASE ENABLE BLOCK CHANGE TRACKING USING FILE '/<path>/bct.ora';
To disable:
SQL> ALTER DATABASE DISABLE BLOCK CHANGE TRACKING;
View V$BLOCK_CHANGE_TRACKING can be queried to find out the status of change
tracking in the database.
Question 19
How would you start the Oracle database if you lose your SPFILE and PFILE and your
DB crashed with some error?
Answer
In that case you have remaining option to create new pfile using the non-default
parameters recorded in the the alert.log file. You can find this in the previous
successful startup entries.
You can then start the database using this pfile (init.ora)
SQL> STARTUP PFILE=�location/init<SID>.ora?�;
Then finally create spfile from this pfile. The below command will automatically
create spfile with its original name.
SQL> Create spfile from pfile=�location/init<SID>.ora?�;
IF RMAN auto-backup is configured in any of the above situations, you can restore
the same.
RMAN> RESTORE SPFILE FROM AUTOBACKUP;
Question 20
What is a backup retention policy
Answer
A retention policy describes which backups will be kept and for how long.You can
use the CONFIGURE RETENTION POLICY command to create a persistent and automatic
backup retention policy. When a backup retention policy is in effect, RMAN
considers backups of datafiles and control files as obsolete, that is, no longer
needed for recovery, according to criteria that you specify in the CONFIGURE
command. You can then use the REPORT OBSOLETE command to view obsolete files and
DELETE OBSOLETE to delete them.
Question 21
What is obsolete backup and expired backup?
Answer
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.
obsolete means �not needed,� whereas expired means �not found.�
Question 22
What are the database file�s that RMAN cannot take backup ?
Answer
RMAN cannot take backup of the pfile, redo logs, tns or network configuration
files, password files, external tables and the contents of the Oracle home files.
Question 23
Can I take RMAN backup when the database is down ?
Answer
No, we can take RMAN backup only when the target database is open or in mount
stage.
Question 24
what happens if the retention policy is configured to NONE
Answer
REPORT OBSOLETE and DELETE OBSOLETE do not consider any backups to be obsolete
Question 25
How to see the configuration of the RMAN?
Answer
RMAN > show all;
Question 26
What are the types of retention polices in RMAN?
Answer
There are two mutually exclusive options for implementing a retention policy:
redundancy and recovery window. If no retention policy is configured by the user,
then the REPORT OBSOLETE and DELETE OBSOLETE commands use a default retention
policy of REDUNDANCY 1.
To configure a retention policy based on a recovery window, use the following
command:
RMAN> CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF x DAYS;
To configure a retention policy based on redundancy, use the following command:
RMAN> CONFIGURE RETENTION POLICY TO REDUNDANCY x;
You can also disable the retention policy completely, meaning that RMAN does not
consider any backup to be obsolete. To do so, use the following command:
RMAN> CONFIGURE RETENTION POLICY TO NONE;
Question 27
What is differential (incremental) backup or cumulative (incremental) backup? and
which one is good from the recovery time point of view
Answer
A differential backup, which backs up all blocks changed after the most recent
incremental backup at level 1 or 0
A cumulative backup, which backs up all blocks changed after the most recent
incremental backup at level 0
Cumulative backup are better from the recovery time point of view
Question 28
What is Level 0, Level 1 backup?
Answer
A level 0 incremental backup, which is the base for subsequent incremental backups,
copies all blocks containing data, backing the datafile up into a backup set just
as a full backup would. A level 1 incremental backup can be either of the following
types:
A differential backup, which backs up all blocks changed after the most recent
incremental backup at level 1 or 0
A cumulative backup, which backs up all blocks changed after the most recent
incremental backup at level 0
Question 29
Suppose you lost one datafile and DB is running in ARCHIVELOG mode. You have full
database backup of 1 week/day old and don�t have backup of this (newly created)
datafile. How do you restore/recover file?
Answer
create the datafile and recover that datafile.
SQL> alter database create datafile ��path..� size n;
RMAN> recover datafile file_id;
Question 31
What are new features in Oracle 12c RMAN?
Answer
a.Fine grained recovery:
With Oracle Database 12c, you can use a simple RECOVER TABLE command to perform a
point-in-time recovery of a table/partition without having to go through a manual
point-in-time recovery process. This command automatically performs the following
steps: creation of the auxiliary instance, table recovery, exporting of the object,
and importing it into the production database.b.Support for multi-tenant databases
c. Improved RMAN duplication (cloning) performance: Now Duplicate database with
active database used backup set instead of image copies and hence improving the
performance
d. Separation of Duty using SYSBACKUP role
e. SQL interface in RMAN
f.Expansion of Multi-section support
g. Simplified cross platform migration
Question 32
How to do Listing of backups in RMAN?
Answer
Use LIST to display information about backup sets, proxy copies, and image copies
recorded in the repository. The LIST command displays the files against which you
can run CROSSCHECK and DELETE commands. Use this command to list:
Backups and copies that do not have the status AVAILABLE in the RMAN repository
Backups and copies of datafiles that are available and can possibly be used in a
restore operation
Specified archived logs, backup sets, backup pieces, control file copies, datafile
copies, and proxy copies
Backups and copies restricted by tag, completion time, recoverability, or device
Incarnations of a specified database or of all databases known to the repository
Stored scripts in the recovery catalog
Reporting on Database Files and Backups
Question 33
What is the difference between LIST and REPORT command
Answer
Report command performs more complex analysis than LIST. Use the REPORT command to
answer questions such as the following:
Which files need a backup?
Which files have not had a backup for some time?
Which files are not recoverable due to unrecoverable operations?
Which backup files can be deleted?
What was the physical schema of the database at a previous time.