You are on page 1of 29

Q) will the instance fail even if 1 control file is lost?

Database instance will not fail, if we have enabled controlfile multiplexing . If


not the instance will get terminated on the next datab checkpoint
Q) when do we need to use control file generated from �control file to trace� ?
this file has only database structure. How does it get synchronized with the latest
scn?
The controlfile to trace is used , when we dont have a valid contrilfile backup.
When its created , oracle will assign the lowest datafile scn to controlfile and it
will get updated as the recovery is taking place
Q) Is the transaction in �Inactive� redolog written to datafile? if yes, why it
matters if it is archived or not?
There is no link between redo log status and data buffers writing to datafile. The
inactive means , the LGWR is not writing to that redo log file, but still it may
need for instance recovery
Q). What is incarnation?
Database incarnation is effectively a new �version� of the database that happens
when you reset the online redo logs using �alter database open resetlogs;�.
Q) How does RMAN maintain backup history? i mean, what kind of ids maintained for
this?
RMAN keeps the backup information on meta data tables ,with the help of dbid . RMAN
assigns dbid and backup set id and backup piece id for all backups
Q) If the current redolog log is corrupted, is clearing log enough? don�t we need
to move the file in a different location?
If the redo log is corrupted ,there is no advantage of moving to another location.
But we should clear only those redo logs,which are not required for instance
recovery, other wise an immediate backup is recommended
Q) What needs to happen before inactive redolog becomes current? e..g checkpoint
can make active redolog inactive?
Checpoint is trigged ,when a log switch is taking place.A log becomes active when
LGWR is ready to over write its contents
Q) When we backup database using export pump � what is the difference between we
backup all schemas and when backup full system level
Full database backup backups the database structure . Schema level backups, even
though we backup all schemas ,wont backup the database structure
Q) Can we ever apply redo log files to database rebuilt from import?
No, we can�t
Q) Hot backup was done yesterday night. The database failed at 1 PM. The database
restore and recovery starts. After it exhausts all the archive logs from the backup
location, it will start applying archive logs generated since the last backup.
Now, the scenario is � one or a couple of archive logs are missing in between the
series since the last backup. How far the recovery can go? . Recovery can go till
the first missing archivelog
Q) What is the difference between differential incremental and cumulative
incremental backup?
A) Cumulative :- Backups all the blocks changed from the previous level 0 backup
Differntial:- Bcakups only the blocks changed from the previous backup
Q) While backup being done, database terminates. Actually while one tablespace in
backup mode? Do we need to shutdown and mount the database and then take specific
datafile offline? How do we recover ? do we use a previous day backup
A ) No ,we can bring the datafiles of the tablespace is normal status ,by using
�alter tablespace <tablespace_name> end backup�;
Q) What is a preferred method for backup of archive log files � os or RMAN
RMAN, especially if ASM is used
Q) When there is a media failure � do we still need to take datafile offline?
Media failure means ,Oracle is not able to access the datafile . If we are planning
for online recovery , we need to take the datafile offline
Q) How do we do recovery after restoring files from cold backup? what does it mean
using backup controlfile?
A)We can use � recover database using backup controlfile.�
This is hint for Oracle recovery process to go beyond the time stamp of cold backup

What is an Oracle database partial backup?


What is an oracle database full backup?
What is the difference between oracle media recovery and crash recovery?
What is db_recovery_file_dest in oracle?When do you need to set this value?
What is restricted mode of instance startup in oracle?

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 do you mean by oracle media recovery?

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 incremental checkpoint?


In incremental checkpoint process, CKPT process records lowest Low RBA to the
control file to keep advancing the Buffer checkpoint Queue (BCQ) to make easy and
fastest Active Checkpoint Queue (ACQ).

Does incremental checkpoint recorded in Alert.log? How to disable it?


We can enable disable recording incremental checkpoint in alert.log .We can
enable/disable recording using parameter log_checkpoints_to_alert=true/false.

I am working as Oracle DBA in 24/7 running large production database. Size of


database is around 800 GB. We take hot backup every day night. But one day at
around 4:00 PM, by mistake one table is dropped by application user. Table is very
important. How to recover said dropped table?
If your database is running on Oracle 10g/11g/12c version then there is new feature
available called Recyclebin. You can recover dropped table from user_recyclebin or
dba_recyclebin.

In continuation of above scenario, Recyclebin doesn't enable in my database then


how to recover my table? How to disable it?
Then you should need to restore backup on your UAT or test database server and
enable time based recovery for applying all archives before drop command execution.
For an instance, apply archives up to 3:55 PM here.
In continuation above scenario, why I should need to perform recovery in UAT or
test database server? Can I restore backup in production database server too?
Yes. You can. It is not recommended because your production database is large
database and running 24/7 environment. Restoration and recovery will take downtime.
It is better to perform restoration and recovery process on UAT or Test 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.

How can I know my require table is available in export dump file?


Create indexfile of export dump file using import with indexfile command. A text
file will be generating with all table and index object name with number of rows.
You can confirm your require table object from this text file. If you are using
datapump then there is parameter called "sqlfile" in impdp.

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.

What is the Complete Recovery?


During this recovery we are applying all database changes using archives log and
make it to up to date. Complete recovery can be done full database level or
datafile level or tablespace level. Main concept is to apply all data changes using
archive logs and bring database up to recent time.

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.

Why export/datapump backup called as logical backup?


Export and datapump dump file doesn't backup or contain any physical structure of
database like datafile, control file, redo log file, parameter file, password file.
Instead of physical structure, export dump contains logical structure of database
like definition of tablespaces, segments, schemas, data of segments etc. Due to
these reasons export and datapump dump is called as logical backup.

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.

Which command I should need to execute to back up database which is running on


NOARCHIVELOG mode?
Shutdown immediate. Because without shutdown, we can't perform online backup of
database, which running on NOARCHIVELOG mode. We should need to take cold backup of
database. After clean shutdown database copy of all datafiles, control files, redo
log files, password file, parameter files.

RMAN INTERVIEW QUESTION


1. What is RMAN ?
Recovery Manager (RMAN) is a utility that can manage your entire Oracle backup and
recovery activities.
2. Which Files can be backed up using rman?
Database Files (with RMAN)
Control Files (with RMAN)
Offline Redolog Files (with RMAN)
INIT.ORA (manually)
Password Files (manually)
When you take a hot backup putting Tablespace in begin backup mode, Oracle records
SCN # from header of a database file. What happens when you issue hot backup
database in RMAN at block level backup? How does RMAN mark the record that the
block has been backed up ? How does RMAN know what blocks were backed up so that it
doesn�t have to scan them again?
In 11g, there is Oracle Block Change Tracking feature. Once enabled; this new 10g
feature records the modified since last backup and stores the log of it in a block
change tracking file. During backups RMAN uses the log file to identify the
specific blocks that must be backed up. This improves RMAN�s performance as it does
not have to scan whole datafiles to detect changed blocks.
Logging of changed blocks is performed by the CTRW process which is also
responsible for writing data to the block change tracking file. RMAN uses SCNs on
the block level and the archived redo logs to resolve any inconsistencies in the
datafiles from a hot backup. What RMAN does not require is to put the tablespace in
BACKUP mode, thus freezing the SCN in the header. Rather, RMAN keeps this
information in either your control files or in the RMAN repository (i.e., Recovery
Catalog).
4. 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
5. 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 ansbt_tape
* Number of processes simultaneously accessing an I/O device 131
* 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
6. 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.
7. 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.
8. 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.
9. What is a Backup piece?
A physical binary file created by RMAN during a backup. Backup pieces are written
to your backup medium, whether to disk or tape. They contain blocks from the target
database�s datafiles, archived redo log files, and control files. When RMAN
constructs a backup piece from datafiles, there are a several rules that it
follows:
# Adatafile cannot span backup sets
# Adatafile can span backup pieces as long as it stays within one backup set
# Datafiles and control files can coexist in the same backup sets
# Archived redo log files are never in the same backup set as datafiles or control
files RMAN is the only tool that can operate on backup pieces. If you need to
restore a file from an RMAN backup, you must use RMAN to do it. There�s no way for
you to manually reconstruct database files from the backup pieces. You must use
RMAN to restore files from a backup piece.
10. What are the benefits of using RMAN?
1.Incremental backups that only copy data blocks that have changed since the last
backup.
2. Tablespaces are not put in backup mode, thus there is noextra redo log
generation during online backups.
3. Detection of corrupt blocks during backups.
4. Parallelization of I/O operations.
5. Automatic logging of all backup and recovery operations.
6. Built-in reporting and listing commands.
11. RMAN Restore Preview
The PREVIEW option of the RESTORE command allows you to identify the backups
required to complete a specific restore operation. The output generated by the
command is in the same format as the LIST command. In addition the PREVIEW SUMMARY
command can be used to produce a summary report with the same format as the LIST
SUMMARY command. The following examples show how these commands are used:
# Spool output to a log file
SPOOL LOG TO c:\oracle\rmancmd\restorepreview.lst;
# Show what files will be used to restore the SYSTEM tablespace�sdatafile
RESTORE DATAFILE 2 PREVIEW;
# Show what files will be used to restore a specific tablespace RESTORE TABLESPACE
users PREVIEW;
# Show a summary for a full database
restoreRESTORE DATABASE PREVIEW SUMMARY;
# Close the log file SPOOL LOG OFF;
12. Where should the catalog be created?
The recovery catalog to be used by rman should be created in a separate database
other than the target database. The reason been that the target database will be
shutdown while datafiles are restored.
RMAN> show all;
RMAN configuration parameters are:
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 3 DAYS;
CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP OFF; # default
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO �%F�; # default
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default 134
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default CONFIGURE
MAXSETSIZE TO UNLIMITED; # default CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; #
default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO �/u02/app/oracle/product/10.1.0/db_
1/dbs/snapcf_test.f�; # default
Backup the database.
run
{
backup incremental level $level ${level_keyword}
tag INC${target_db}_$level database include current controlfile;
backuparchivelog all not backed up 1 times delete input;
}
How to resolve the ora-19804 error
Basically this error is because of flash recovery area been full. One way to solve
is to increase the space available for flashback database.
sql>ALTER SYSTEM SET DB_RECOVERY_FILE_DEST_SIZE=5G;
�It can be set to K,M or G
. rman>backup database;
������. channel ORA_DISK_1: specifying datafile(s) in backupset
including current controlfile in backupset
including current SPFILE in backupset
channel ORA_DISK_1: starting piece 1 at 04-JUL-05
channel ORA_DISK_1: finished piece 1 at 04-JUL-05
piece handle=/u02/app/oracle/flash_recovery_area/TEST/backupset/2005_07_04/o1
_mf_ncsnf_TAG20050704T205840_1dmy15cr_.bkp
comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
Finished backup at 04-JUL-05 Oracle Flashback After taking a back upresync the
database. Restoring the whole database.
run
{
shutdown immediate;
startup mount;
restore database;
recover database;
alter database open;
}
What are the various reports available with RMAN
rman>list backup;
rman> list archive;
18. .What does backup incremental level=0 database do?
Backup database level=0 is a full backup of the database.
rman>>backup incremental level=0 database;
You can also use backup full database;
which means the same thing as level=0;
What is the difference between DELETE INPUT and DELETE ALL command in backup?
Generally speaking LOG_ARCHIVE_DEST_n points to two disk drive locations where we
archive the files, when a command is issued through rman to backup archivelogs it
uses one of the location to backup the data. When we specify delete input the
location which was backedup will get deleted, if we specify delete all
alllog_archive_dest_n will get deleted.
DELETE all applies only to archived logs. delete expired archivelog all;
How do I backup archive log?
In order to backup archivelog we have to do the following:-
Run
{
allocate channel t1 type �SBT_TAPE�;
deletenopromptarchivelog until time = �sysdate-3/24�;
deletenoprompt obsolete; release channel t1;
}
How do I do a incremental backup after a base backup?
Run
{
backup incremental level $level ${level_keyword}
tag INC${target_db}_$level database include current controlfile;
backuparchivelog all not backed up 1 times delete input;
}
In catalog database, if some of the blocks are corrupted due to system crash, How
will you recover?
using RMAN BLOCK RECOVER command
You have taken a manual backup of a datafile using o/s. How RMAN will know about
it?
You have to catalog that manual backup in RMAN�s repository by command
RMAN> catalog datafilecopy �/DB01/BACKUP/users01.dbf�; 137
restrictions:
Accessible on disk
> A complete image copy of a single file
Where RMAN keeps information of backups if you are using RMAN without Catalog?
RMAN keeps information of backups in the control file.
CATALOG vs NOCATALOG
the difference is only who maintains the backup records like when is the last
successful backup incremental differential etc.
In CATALOG mode another database (TARGET database) stores all the information.
In NOCATALOG mode controlfile of Target database is responsible.
How do you see information about backups in RMAN?
RMAN> List Backup;
Use this SQL to check
SQL> SELECT sidtotalworksofar FROM v$session_longops WHERE sid 153;
Here give SID when back start it will show SID
How RMAN improves backup time?
RMAN backup time consumption is very less than compared to regular online backup as
RMAN copies only modified blocks.
What is the advantage of RMAN utility?
Central Repository
Incremental Backup
Corruption Detection
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.
28. List the encryption options available with RMAN?
RMAN offers three encryption modes: transparent mode, password mode and dual mode.
29. What are the steps required to perform in $ORACLE_HOME for enabling the RMAN
backups with netbackup or TSM tape library software?
I can explain what are all the steps to take arman backup with TSM tape library as
follows
1.Install TDPO (default path /usr/tivoli/tsm/client/oracle/)
2.Once u installed the TDPO automatically one link is created from TDPO directory
to /usr/lib.Now we need to Create soft link between OS to ORACLE_HOME
ln -s /usr/lib/libiobk64.a $ORACLE_HOME/lib/libobk.a(very imporatant)
3.Uncomment and Modify tdpo.opt file which in
/usr/tivoli/tsm/client/oracle/bin/tdpo.opt as follows
DSMI_ORC_CONFIG /usr/Tivoli/tsm/client/oracle/bin64/dsm.opt
DSMI_LOG /home/tmp/oracle TDPO_NODE backup 139
TDPO_PSWDPATH /usr/tivoli/tsm/client/oracle/bin64
create dsm.sys file in same path and add the entries
SErvername
TCPPort 1500
passwordacess prompt
nodename backup
enablelanfree yes
TCPSERVERADDRESS
5.Createdsm.opt file add an entry SErvername
6.Then take backup
RMAN>run
{
allocate channel t1 type �sbt_tape� parms �ENV (TDPO_OPTFILE
/usr/tivoli/tsm/client/oracle/bin64/tdpo.opt)�;
backup database include current controlfile; release channel t1;
}
30. What is the significance of incarnation and DBID in the RMAN backups?
When you have multiple databases you have to set your DBID (Database Id) which is
unique to each database. You have to set this before you do any restore operation
from RMAN.
There is possibility that incarnation may be different of your database. So it is
advised to reset to match with the current incarnation. If you run the RMAN command
ALTER DATABASE OPEN RESETLOGS then RMAN resets the target database automatically so
that you do not have to run RESET DATABASE.
By resetting the database RMAN considers the new incarnation as the current
incarnation of the database.
31. List at least 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.
32. How do you enable the autobackup for the controlfile using RMAN?
issue command at rman prompt�..
RMAN> configure controlfileautobackup on;
also we can configure controlfile backup format��
RMAN> configure controlfileautobackup format for device type disk to
2> �$HOME/BACKUP/RMAN/ F.bkp�;
$HOME/BACKUP/RMAN/ this can be any desired location.
33. How do you identify what are the all the target databases that are being
backed-up with RMAN database?
You don�t have any view to identify whether it is backed up or not . The only
option is connect to the target database and give list backup this will give you
the backup information with date and timing.
34. 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 changed after the most recent backup at level
n-1 or lower.
35. How do you identify the block corruption in RMAN database?How do you fix it?
usingv$block_corruption view u can find which blocks corrupted.
Rman>> block recover datafileblock ;
Using the above statement u recover the corrupted blocks. First check whether the
block is corrupted or not by using this command
sql>select file# block# from v$database_block_corruption;
file# block 2 507 the above block is corrupted� conn to Rman To recover the block
use this command�
Rman>blockrecoverdataile 2 block 507;
the above command recover the block 507 Now just verify it�..
Rman>blockrecover corruption list;
36. How do you clone the database using RMAN software? Give brief steps? When do
you use crosscheck command?
Check whether backup pieces proxy copies or disk copies still exist.
Two commands available in RMAN to clone database:
1) Duplicate
2) Restore.
37. What is the difference between obsolete RMAN backups and expired RMAN backups?
The term obsolete does not mean the same as expired. In short obsolete means �not
needed � whereas expired means �not found.�
38. List some of the RMAN catalog view names which contain the catalog information?
RC_DATABASE_INCARNATION RC_BACKUP_COPY_DETAILS
RC_BACKUP_CORRUPTION
RC_BACKUP-DATAFILE_SUMMARY to name a few
39. What is db_recovery_file_dest ? When do you need to set this value?
If Database Flashback option is on then use this option.
40. How do you setup the RMAN tape backups?
RMAN Target /
run
{
Allocate channel ch1 device type sbt_tapemaxpiecesize 4g Format� D_ U_ T_ t�;
sql �alter system switch logfile�;
Backup database; backup archivelog from time �sysdate-7�;
Backup Format � D_CTLFILE_P_ U_ T_ t� Current controlfile;
release channel ch1;
}
This is backup script for Tivoli Backup Server
41. How do you 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;
42. When do you recommend hot backup? What are the pre-reqs?
Database must be Archivelog Mode
Archive 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; # default
CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE 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; # default
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default CONFIGURE
MAXSETSIZE TO UNLIMITED; # default CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
CONFIGURE ENCRYPTION ALGORITHM �AES128�; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO
�/u01/app/oracle/product/10.2.0/db_2/dbs/snapcf_dba.f�; # default
43. What is the difference between physical and logical backups?
In Oracle Logical Backup is �which is taken using either Traditional Export/Import
or Latest Data Pump�.
Where as Physical backup is known �when you take Physical O/s Database related
Files as Backup�.
44. What is RAID? What is RAID0? What is RAID1? What is RAID 10?
RAID: It is a redundant array of independent disk
RAID0: Concatenation and stripping
RAID1: Mirroring
45. What are things which play major role in designing the backup strategy?
I Believe in designing a good backup strategy it will not only be simply backup but
also a contingency plan.
In this case you should consider the following:
How long is the allowable down time during recovery?
If short you could consider using dataguard.
2. How long is the backup period?
� If short I would advise to use RMAN instead of user managed backup.
3. If limited disk space for backup never use user managed backup.
4. If the database is large you could consider doing full rman backups on a weekend
and do a incremental backup on a weekday.
5. Schedule your backup on the time where there is least database activity this is
to avoid resource huggling.
6. Backup script should always be automized via scheduled jobs. This way operators
would never miss a backup period.
7. Retention period should also be considered.
Try keeping atleast 2 full backups. (current and previous backup). Cold backup:
shutdown the database and copy the datafiles with the help of O.S. command. this is
simply copying of datafiles just like any other text file copy.
Hot backup: backup process starts even though database in running. The process to
take a hot backup is
1) sql> alter database begin backup;
2) copy the datafiles.
3) after copying
sql> alter database end backup;
Begin backup clause will generate the timestamp. it�ll be used in backup
consistency i.e. when begin backup pressed it�ll generate the timestamp. During
restore database will restore the data from backup till that timestamp and
remaining backup will be recovered from archive log.
46. What is hot backup and what is cold backup?
Hot backup when the database is online cold backup is taken during shut down period
47. How do you test that your recovery was successful?
SQL> SELECT count(*) FROM flashback_table;
48. How do you backup the Flash Recovery Area?
A:RMAN> BACKUP RECOVERY FILES;
The files on disk that have not previously been backed up will be backed up. They
are full and incremental backup sets, control file auto-backups, archive logs and
datafile copies.
49. How to enable Fast Incremental Backup to backup only those data blocks that
have changed?
A:SQL> ALTER DATABASE enable BLOCK CHANGE TRACKING;
50. How do you set the flash recovery area?
A:SQL> ALTER SYSTEM SET db_recovery_file_dest_size = 100G;
SQL> ALTER SYSTEM SET db_recovery_file_dest = �/u10/oradata/school�;
51. How can you use the CURRENT_SCN column in the V$DATABASE view to obtain the
currentSCN?
A:SQL> SELECT current_scn FROM v$database;
52. You have taken a manual backup of a datafile using o/s. How RMAN will know
about it?
You have to catalog that manual backup in RMAN�s repository by command
RMAN>catalogdatafilecopy �/DB01/BACKUP/users01.dbf�;
restrictions:>
Accessible on disk> A complete image copyof a single file
53. In catalog database, if some of the blocks are corrupted due to system crash,
How will you recover?
using RMAN BLOCK RECOVER command
54. List advantages of RMAN backups compare to traditional hot backups?
RMAN has the following advantages over Traditional backups:
1. Ability to perform INCREMENTALbackups
2. Ability to Recover one block of datafile
3. Ability to automatically backup CONTROLFILEand SPFILE
4. Ability to delete the older ARCHIVE REDOLOG files
55. How do you identify the expired, active, obsolete backups?Which RMAN command
you use?
Rman> crosscheck backup;
Rman> crosscheck archivelog all;
Rman>listbackup;
Rman> list archive logall
56. How do you enable the autobackup for the controlfile using RMAN?
RMAN> configure controlfileautobackup on;
also we can configurecontrolfile backup format��
RMAN> configure control file auto backup format for device type disk
57. How do you identify what are the all the target databases that are being
backed-up with RMAN database?
You don�t have any view to identify whether it is backed up or not . The only
option is connect to the target database and give list backup, this will give you
the backup information with date and timing
58. 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 changed after the most recent backup at level
n-1 or lower
59. Explain 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 RETENTIONPOLICY TO RECOVERY WINDOW OF 1 DAYS;
CONFIGURE BACKUP OPTIMIZATION
60. 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 with in the same RUN command.
61. What is backup set?
RMAN can also store its backups in an RMAN-exclusive format which is called backup
set. A backupset is a collection of backup pieces, each of which may contain one or
more datafile backups.
62. What is RMAN and how does one use it?
Recovery Manager (or RMAN) is an Oracle provided utility for backing-up, restoring
and recoveringOracle Databases.
RMAN ships with the database server and doesn�t require a separate installation.
TheRMAN executable is located in your ORACLE_HOME/bin directory.
63. What kind of backup are supported by RMAN?
Backup SetsDatafilesCopiesOSBackupWhat is the Flash Recovery Area?
A: It is a unified storage location for all recovery-related files and activities
in an Oracle Database. Itincludes Control File, Archived Log Files, Flashback Logs,
Control File Autobackups, Data Files, andRMAN files.
64. How do you define a Flash Recovery Area?
To define a Flash Recovery Area set the following Oracle Initialization Parameters.
SQL> ALTER SYSTEM SET db_recovery_file_dest_size = 100G;
SQL> ALTER SYSTEM SET db_recovery_file_dest = �/u10/oradata/school�;
65. How do you use the V$RECOVERY_FILE_DEST view to display information regarding
the flashrecovery area?
SQL> SELECT name, space_limit, space_used,space_reclaimable, number_of_filesFROM v
$recovery_file_dest;
66. How can you display warning messages?
SQL> SELECT object_type, message_type,message_level, reason,
suggested_actionFROMdba_outstanding_alerts;
67. How to use the best practice to use Oracle Managed File (OMF) to let Oracle
database to create andmanage the underlying operating system files of a database?
SQL> ALTER SYSTEM SETdb_create_file_dest = �/u03/oradata/school�;
SQL> ALTER SYSTEM SETdb_create_online_dest_1 = �/u04/oradata/school�;
68. How to enable Fast Incremental Backup to backup only those data blocks that
have changed?
SQL> ALTER DATABASE enable BLOCK CHANGE TRACKING;
69. How do you monitor block change tracking?
A:SQL> SELECT filename, status, bytes FROM v$block_change_tracking;
It shows where the block change-tracking file is located, the status of it and the
size.
70. How do you use the V$BACKUP_DATAFILE view to display how effective the block
change trackingis in minimizing the incremental backup I/O?
A:SQL> SELECT file#, AVG(datafile_blocks), AVG(blocks_read),AVG
(blocks_read/datafile_blocks), AVG(blocks)FROM
v$backup_datafileWHEREused_change_tracking = �YES� AND incremental_level> 0GROUP BY
file#;
If the AVG (blocks_read/datafile_blocks) column is high then you may have to
decrease the timebetween the incremental backups.
71. How do you backup the entire database?
A:RMAN> BACKUP DATABASE;
72. How do you backup an individual tablespaces?
A:RMAN> CONFIGURE DEFAULT DEVICE TYPE TO DISK;
RMAN>BACKUP TABLESPACE system;
73. How do you backup datafiles and control files?
A:RMAN> BACKUP DATAFILE 3;
RMAN> BACKUP CURRENT CONTROLFILE;
Use a fast recovery without restoring all backups from their backup location to the
location specified inthe controlfile.
A:RMAN> SWITCH DATABASE TO COPY;
74. RMAN will adjust the control file so that the data files point to the backup
file location and then starts recovery.Why use Rman ?
1. No Extra Costs.. It is available free.
2.RMAN introduced in Oracle 8 it has become simpler with new version and easier
that user managed backups.
3.Proper Security
4.You are 100% sure your database has been backed up .
5.It contains details of backup taken in the central repository
6.Facility of Testing validity of backups also command like cross check to checkthe
status of backup.
7.Oracle 10g has got further optimized incremental backups with has resulted
inimprovement of performance during backup
8.and recovery time
9.Parrallel operation are supported
10.Better Querying facility for knowing different details of backup.
11.No Extra redo generated when backup is taken. compared to online backup
12.Withoutrman.which results in saving of space in hard disk.
13.RMAN is an intelligent tool 152
14.Maintains repository of backup metadata.
15.Remembers backup locations 16.Knows what needs backup set locations
17.Knows what needs to be backed up 18.Knows what is required for recovery
19.Know what backups are redundant 20.It handles database corruptions
75. Oracle Enhancement for Rman in 10g
1.Flash Recovery Area
2.Incrementally Updated Backups
3.Faster Incremental Backups
4.SWITCH DATABASE COMMAND.
5.Binary Compression
6.Global Scripting
7.Duration Clause
8.Configure This
9.Oracle Enhancement for Rman in 10g
10.Automatic Channel Failover
11.Compress Backup Sets
12.Recovery Through Reset Logs
13.Cross Backup Sets
76. Global Scripting
A.RMAN> print script full_backup to file �my_script_file.txt�
Oracle Database 10g provides a new concept of global scripts, which you can
executeagainst any database registered in the recovery catalog, as long as your
RMAN client isconnected to the recovery catalog and a target database
simultaneously.CPISOLUTION.COM
RMAN> create global script global_full_backup
77. Outline the steps for recovery of missing data file?
Losing Datafiles Whenever you are in NoArchivelog Mode:
If you are in noarchivelog mode and you loss any datafile then whether it is
temporary or permanent media failure, the database will automatically shut down. If
failure is temporary then correct the underline hardware and start the database.
Usually crash recovery will perform recovery of the committed transaction of the
database from online redo log files. If you have permanent media failure then
restore a whole database from a good backup. How to restore a database is as
follows:
If a media failure damages datafiles in a NOARCHIVELOG database, then the only
option for recovery is usually to restore a consistent whole database backup. As
you are in noarchivelog mode so you have to understand that changes after taken
backup is lost.
If you logical backup that is export file you can import that also.
In order to recover database in noarchivelog mode you have to follow the following
procedure.
1)If the database is open shutdown it.
SQL>SHUTDOWN IMMEDIATE;
2)If possible, correct the media problem so that the backup database files can be
restored to their original locations.
3)Copy all of the backup control files, datafiles to the default location if you
corrected media failure. However you can restore to another location. Remember that
all of the files not only the damaged files.
4)Because online redo logs are not backed up, you cannot restore them with the
datafiles and control files. In order to allow the database to reset the online
redo logs, you must have to do incomplete recovery: RECOVER DATABASE UNTIL CANCEL
CANCEL
5)Open the database in RESETLOGS mode:
ALTER DATABASE OPEN RESETLOGS;
In order to rename your control files or in case of media damage you can copy it to
another location and then by setting (if spfile)
STARTUP NOMOUNT
alter system set
control_files=�+ORQ/orq1/controlfile/control01.ctl�,�+ORQ/orq1/controlfile/control0
2.ctl� scope=spfile;
STARTUP FORCE MOUNT;
In order to rename data files or online redo log files first copy it to new
location and then point control file to new location by,
ALTER DATABASE RENAME FILE �+ORQ/orq1/datafile/system01.dbf�;� TO
�+ORQ/orq1/datafile/system02.dbf�; Losing Datafiles Whenever you are in Archivelog
Mode:
If the datafile that is lost is under SYSTEM tablespace or if it is a datafile
contain active undo segments then database shuts down. If the failure is temporary
then correct the underline hardware and start the database. Usually crash recovery
will perform recovery of the committed transaction of the database from online redo
log files. If the datafile that is lost in not under SYSTEM tablespace and not
contain active undo segments then the affected datafile is gone to offline.
The database remains open. In order to fix the problem take the affected tablespace
offline and then recover the tablespace.
78. Outline the steps for recovery with missing online redo logs?
Redo log is CURRENT (DB was shut down cleanly) If the CURRENT redo log is lost and
if the DB is closed consistently, OPEN RESETLOGS can be issued directly without any
transaction loss. It is advisable to take a full backup of DB immediately after the
STARTUP.
Redo log is CURRENT (DB was not shut down cleanly)
When a current redo log is lost, the transactions in the log file are also lost
before making to archived logs. Since a DB startup can no more perform a crash
recovery (since all the nowavailable online log files are not sufficient to startup
the DB in consistent state), an incomplete media recovery is the only option. We
will need to restore the DB from a previous backup and restore to the point just
before the lost redo log file. The DB will need to be opened in RESETLOGS mode.
There is some transaction loss in this scenario.
RMAN> RESTORE CONTROLFILE FROM �;
RMAN> ALTER DATABASE MOUNT;
RMAN> RESTORE DATABASE;
RMAN> RECOVER DATABASE UNTIL TIME �to_date(�MAR 05 2009 19:00:00',�MON DD YYYY
HH24:MI:SS�)�;
RMAN> ALTER DATABASE OPEN RESETLOGS;
Outline steps for recovery with missing archived redo logs?
If a redo log file is already archived, its loss can safely be ignored. Since all
the changes in the DB are now archived and the online log file is only waiting for
its turn to be re-written by LGWR (redo log files are written circularly) the loss
of the redo log file doesnt matter much. It may be re-created using the command
SQL> STARTUP MOUNT;
SQL> ALTER DATABASE CLEAR LOGFILE GROUP ;
This will re-create all groups and no transactions are lost. The database can be
opened normally after this.
What is FRA ?When do you use this ?
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
What is Channel? How do you 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;
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
How do you enable the encryption for RMAN backups?
If you wish to modify your existing backup environment so that all RMAN backups are
158 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
What is the difference between restoring and recovering?
Restoring involves copying backup files from secondary storage (backup media) to
disk. This can be done to replace damaged files or to copy/move a database to a new
location.
Recovery is the process of applying redo logs to the database to roll it forward.
One can rollforward until a specific point-in-time (before the disaster occurred),
or roll-forward until the last transaction recorded in the log files.
SQL> connect SYS as SYSDBA SQL> RECOVER DATABASE UNTIL TIME �2001-03-06:16:00:00'
USING BACKUP CONTROLFILE;
RMAN> run {
set until time to_date(�04-Aug-2004 00:00:00�, �DD-MON-YYYY HH24:MI:SS�);
restore database; recover database;
}

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
/

COLUMN EVENT FORMAT a10


COLUMN SECONDS_IN_WAIT FORMAT 999
COLUMN STATE FORMAT a20
COLUMN CLIENT_INFO FORMAT a30

SELECT p.SPID, EVENT, SECONDS_IN_WAIT AS SEC_WAIT,


sw.STATE, CLIENT_INFO
FROM V$SESSION_WAIT sw, V$SESSION s, V$PROCESS p
WHERE sw.EVENT LIKE 'sbt%'
AND s.SID=sw.SID
AND s.PADDR=p.ADDR
;
Question 4
How did the list and report commands of RMAN get the data?
Answer
RMAN commands reports the data by querying v$ in case of nocatalog and recovery
catalog (RC) view in case of Catalog mode.
Example
V$DATAFILE_COPY in case of Control file
RC_DATAFILE_COPY in case of Recovery Catalog
Question 5
Will RMAN put the database/tablespace/datafile in backup mode? or What is the
difference between manual hot backup and RMAN backup?
Answer
RMAN does not put database/tablespace/datafile in backup mode like manual backup .
For hot backup, we have to put database in begin backup mode, then take backup. but
this is not the case with RMAN backup.
Mechanism Following by Oracle when we taking hot backup
Question 6
What is the RMAN Command to delete archive logs older than 1 days?
Answer
RMAN> delete archivelog all completed before sysdate-1;
Question 7
Name few tables and views in the Recovery catalog schema
Answer
Tables
________________________________________
NAME DESCRIPTION
________________________________________
AL contains archived logs. archived logs are uniquely identified by
dbinc_key, recid and stamp.
BCB contains corrupt block ranges in datafile backups.
BCF contains control file backups (in backup sets).
BDF contains all datafile backups (in backup sets).
BP contains all backup pieces of backup sets.
BRL contains backup redo logs (in backup sets).
BS contains all backup sets for all database incarnations.
CCB contains corrupt block ranges in datafile copies.
CCF contains control file copies.
CDF contains all datafile copies.
CKP records all recovery catalog checkpoints.
DB contains all target databases that have been registered in this
recovery catalog.
DBINC contains all incarnations of the target databases registered in this
recovery catalog.
DF contains all datafiles of all database incarnations.
Views:
NAME DESCRIPTION
________________________________________
RC_ARCHIVED_LOG information about all archivelogs.
RC_BACKUP_CONTROLFILE backup control files in backup sets.
RC_BACKUP_CORRUPTION corrupt blocks in datafile backups and copies.
RC_BACKUP_DATAFILE datafile backups (in backup sets).
RC_BACKUP_PIECE backup pieces.
RC_BACKUP_REDOLOG redo log backups (in backup sets).
RC_BACKUP_SET backup sets.
RC_CHECKPOINT rc_checkpoint is replaced by rc_resync, but is still
used by some tests.
RC_CONTROLFILE_COPY controlfile copies.
Question 8
Give us the broad level steps on how to create the recovery catalog schema?
Answer
How to create RMAN recovery catalog and register database in catalog
Question 11.What are the benefits of using RMAN?
Answer
Important Benefits of using RMAN are
a. Built-in reporting and listing commands.
b. Tablespaces or database are not put in backup mode unlike manual backup, So
there is no extra redo log generation during online backups.
c. Parallelization of I/O operations using channels
d. Automatic logging of all backup and recovery operations.
e. Incremental backups that only copy data blocks that have changed since the last
backup using change block tracking
f. Detection of corrupt blocks during backups.
Question 12
What is snapshot control file?
Answer
The snapshot control file is a copy of a database control file created in an
operating system-specific location by RMAN. RMAN creates the snapshot control file
so that it has a consistent version of a control file to use when either re
synchronizing the recovery catalog or backing up the control file.
Question 13
What is the difference between backup set and backup piece?
Answer
Backup set is logical and backup piece is physical.
Question 14
How do we create the standby database using RMAN ?
Answer
We can use RMAN backup to create the standby database or use Active database option
to directly create standby from Primary without taking backup
With backup
RMAN> duplicate target database to standby database
With Active database
RMAN >RUN
{
CONFIGURE DEVICE TYPE DISK PARALLELISM 6;
duplicate target database for standby from active database;
}
Question 15
How to do Database cloning by using RMAN?
Answer
We can use RMAN backup to create the database or use Active database option to
directory create standby from Primary without taking backup
With backup
RMAN> duplicate target database to TEST;

With Active database


RMAN >RUN
{
CONFIGURE DEVICE TYPE DISK PARALLELISM 6;
duplicate target database to TEST from active database;
}

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.

explain Mechanism Following by Oracle when we taking hot backup?


Mechanism Following by Oracle when we taking hot backup
Hot backup means the system is Up and running and Updates are going on as usual
I would here explain Mechanism Following by Oracle when we taking hot backup
Manual Hotbackup
Manual hotbackup start with below command for a tablespace
alter tablespace USERS begin backup;
Few things happens at that time
1)DBWn checkpoints the tablespace (writes out all dirty blocks as of a given SCN)
2)CKPT stops updating the Checkpoint SCN field in the datafile headers and begins
updating the Hot Backup Checkpoint SCN field instead
The datafile headers which contain the SCN of the last completed checkpoint are not
updated while a file is in hot backup mode. This lets the recovery process
understand what archive redo log files might be needed to fully recover this file.
3)LGWR begins logging full images of changed blocks the first time a block is
changed after being written by DBWn
The first time a block is changed in a datafile that is in hot backup mode, the
entire block is written to the redo log files, not just the changed bytes. Normally
only the changed bytes (a redo vector) is written. In hot backup mode, the entire
block is logged the first time. This is because you can get into a situation where
the process copying the datafile and DBWR are working on the same block
simultaneously.
Lets say they are and the OS blocking read factor is 2K . The backup program goes
to read an 8k Oracle block. The OS gives it 4k. Meanwhile � DBWR has asked to
rewrite this block. the OS schedules the DBWR write to occur right now. The entire
8k block is rewritten. The backup program starts running again (multi-tasking OS
here) and reads the last 4k of the block. The backup program has now gotten an
fractured block � the head and tail are from two points in time.
Oracle cannot deal with that during recovery. Hence, we log the entire block image
so that during recovery, this block is totally rewritten from redo and is
consistent with itself atleast. We can recover it from there.
Important point in Hot backup
1)To limit the effect of this additional logging, you should ensure you only place
one tablepspace at a time in backup mode and bring the tablespace out of backup
mode as soon as you have backed it up. This will reduce the number of blocks that
may have to be logged to the minimum possible.
2) If the tablespace is in hotbackup mode and database get aborted. And then you
try to start,it will complain about recovery as the datafile SCN of that tablespace
will be older, then to start the database, we need to first end the backup of that
tablespace. It simply updates the checkpoint SCN with the Hot Backup Checkpoint SCN
Recovery manager backup
We dont need to put the tablespace in hotbackup mode to take the backup using the
hotbackmode
Since RMAN is Oracle tool,they know how to handle the fractured block case,so it
doesn�t write block fragments or partial blocks to the backup, it writes the
complete consistent block image to the backup media. So recovery manager doesn�t
need to record the complete block to the redo log file.So it means huge saving in
redo logging from manual hotbackup case
Also rman doesn�t freeze the datafile header, it continues to checkpoint just as
regular, but it does perform a checkpoint to the tablespace.
RMAN backup notes down the starting SCN,Absolute Fuzzy SCN( which is same as
starting SCN in the begining) when the backup begins and as the blocks are backup
in the datafile, the block are checked for the SCN, if it is higher then starting
SCN, Absolute Fuzzy SCN is updated with that number. Same goes for all the
blocks,when the whole datafile is backup ,these both numbers are stored in backup
header.
So whenever RMAN restored these backup ,they know it knows from what begining SCN
to end SCN ,it has to recover datafile for sure

You might also like