Database Reference
In-Depth Information
RMAN> alter database open resetlogs;
Statement processed
When you use the
RESTORE CONTROLFILE FROM AUTOBACKUP
command, Oracle will start
searching for the most current control-file autobackup by default. If you have used the
SET
UNTIL
command to perform a point-in-time recovery, RMAN will start searching for the
most current control file starting with that day/time and moving backward.
The
RESTORE CONTROLFILE
command also comes with the
MAXSEQ
and
MAXDAYS
parameters
to further control how much effort is used to search for a backup control file.
The
MAXSEQ
Parameter
Each control-file backup on a given day is assigned a sequence
number. That number increments by one for each additional control-file autobackup, until
the next day when the sequence resets itself. The maximum sequence number is 256 and the
minimum number is 0. RMAN will always search for the highest sequence number (or the
most current file) first. The
MAXSEQ
parameter indicates to RMAN which sequence number
it should start with when looking for the correct control-file autobackup. This allows you to
skip certain sequence numbers if you know you do not want to use them. Here is an example
of using
MAXSEQ
:
Restore controlfile from autobackup maxseq 200;
The
MAXDAYS
Parameter
By default, RMAN will look back 7 days (from the current date
or the
set until
date) to find the correct control-file autobackup. If you want to change
this default setting, use the
MAXDAYS
parameter when calling the
RESTORE CONTROLFILE
FROM AUTOBACKUP
command. You can search from 0 to 366 days for the current control-file
autobackup. Here is an example of using
MAXDAYS
where we will go back 30 days to find the
correct control-file autobackup:
Restore controlfile from autobackup maxdays 30;
The
MAXDAYS
and
MAXSEQ
parameters also apply to spfile autobackup
restore operations, and both parameters can be used in one command.
Control-File Backups Not Using the FRA
If you are not using the FRA but have enabled control-file autobackups, you will need
to determine the database ID (DBID) of the database. Each database has a DBID, which
uniquely identifies it. You should maintain a list of DBIDs for each of your databases if you
are not using the FRA but want to use control-file autobackups. You can find the DBID in
the
DBID
column of the
V$DATABASE
view, as seen in this query:
SQL> select dbid from v$database;
DBID
----------
437680418
Search WWH ::
Custom Search