Database Reference
In-Depth Information
RMAN Database-Recovery Basics
There is a common theme or pattern when recovering databases in RMAN that you will
want to be familiar with. This pattern for recovery is as follows:
Step 1: Put the database in the correct mode. Putting the database in the proper mode
is the first step to recovering it. The proper mode is dependent on the type of recovery you
want to be able to make. For example, in NOARCHIVELOG mode your database must
always be in MOUNT mode to perform a recovery. We will cover the modes the database
should be in for individual recovery in the later sections of this chapter.
RMAN provides commands that you can use to put the database in the
mode you want it to be in (you'll find a summary of the RMAN commands
in Chapter 3, “Configuring and Backing Up Using RMAN”). If you want the
database mounted, then you can use the RMAN STARTUP MOUNT command,
for example. RMAN recoveries will occur in almost any mode, NOMOUNT for
control-file or spfile recoveries, MOUNT for offline database recoveries, or
OPEN for ARCHIVELOG noncritical data file or tablespace recoveries. For the
OCP exam, it will be a very good idea if you learn which modes are required
for which recovery types.
The RMAN client is full-featured. There should be few times when any
recovery operation will require you to use anything other than RMAN.
If you do have to use something else, it probably means you have made
a mistake, you are having a really bad day, or you have run into a bug
(which in and of itself means you are having a really bad day).
Putting the database in the proper mode may also require restoring files required to put it in
that mode. For example, if the spfile is missing, you may need to restore it. Perhaps the con-
trol file will need to be restored. You will find more information on these kinds of recoveries
later in this chapter.
Step 2: Restore the database data files. After the database has been put in the correct mode
for the recovery chosen, you will use the RMAN RESTORE command to begin the database
recovery. The RESTORE command will determine which backup set pieces or image copies need
to be used to recover the database to the point in time that you direct. By default, RMAN will
restore the database to the point of failure if you are running in ARCHIVELOG mode. If you
are in NOARCHIVELOG mode, the restore will be to the point of the last backup. Once the
data files have been restored, you will be returned to the RMAN prompt so you can issue the
RECOVER DATABASE command.
The RESTORE command comes in different flavors, allowing you to restore the entire data-
base, data files, or tablespaces. We understand that a future version will also allow you to
restore your broken heart, but that's still in beta.
 
Search WWH ::




Custom Search