Databases Reference
In-Depth Information
For the majority of incomplete database recovery circumstances, you'll use the
restore database until
command to instruct RMAN to retrieve data files from the RMAN backup files. This type of incomplete database
recovery is the main focus of this chapter. The
until
portion of the
restore database
command instructs RMAN to
retrieve data files from a point in the past based on one of the following methods:
•
Time
•
Change (sometimes called system change number [SCN])
•
Log sequence number
•
Restore point
The RMAN
restore database until
command will retrieve all data files from the most recent backup set or
image copy. RMAN will automatically determine from the
until
clause which backup set contains the required
data files. If you omit the
until
clause of the
restore database
command, RMAN will retrieve data files from the
latest available backup set or image copy. In some situations, that may be the behavior you desire. We recommend
you use the
until
clause to ensure that RMAN restores from the correct backup set or image copy. When you
issue the
restore database until
command, RMAN will determine how to extract the data files from any of the
following:
•
Full database backup
•
Incremental level 0 backup
backup as copy
command
You cannot perform an incomplete database recovery on a subset of your database's online data files. When
performing incomplete database recovery, all of the checkpoint SCNs for all online data files must be synchronized
before you can open your database with the alter database
open resetlogs
command. You can view the data file
header SCNs and the status of each data file via this SQL query:
•
Image copy backup generated by the
select
file#
,status
,fuzzy
,error
,checkpoint_change#,
to_char(checkpoint_time,'dd-mon-rrrr hh24:mi:ss') as checkpoint_time
from v$datafile_header;
The
FUZZY
column of
V$DATAFILE_HEADER
refers to a data file that contains one or more blocks that have an SCN
greater than or equal to the checkpoint SCN in the data file header (meaning there have been writes to the data file
since the last checkpoint). During regular database operating conditions, the
FUZZY
column will normally be
YES
.
However, after you restore a data file, if a data file has a
FUZZY
value of
YES
, you cannot open the database normally
yet; in this situation more redo needs to be applied before the database can be opened. Table
12-1
summarizes these
scenarios.