Database Reference
In-Depth Information
NLS_DATE_FORMAT ). Here is an example of the use of the RECOVER DATABASE UNTIL TIME
command:
Recover database until time '2013-10-23:13:00:00'
In this example, the database will be recovered up to October 23, 2013 at 1:00 p.m. Any
transactions that are committed after that point will be rolled back.
Log Sequence-Based Recovery To perform log sequence-based recovery, use the RECOVER
DATABASE UNTIL SEQUENCE command. This example recovers to log sequence 34:
Recover database until sequence 34;
Change-Based Recovery To perform change-based recovery, use the RECOVER DATABASE
UNTIL CHANGE command followed by the SCN you wish to recover to. In this example, we
recover to SCN 1234:
Recover database until change 1234;
Once the recovery begins, you will be prompted for the appropriate archived redo logs to
apply just as with a complete database recovery. The main difference is that the application
of archived redo logs (and possibly online redo logs) will automatically cease once the point
in time, change, or SCN has been reached. Once the redo has been applied, the database is
ready to be opened.
Opening the Database
Having recovered the database, you will want to open it. A point-in-time recovery will
result in a new incarnation of the database. A new incarnation is a new logical version of
the database. The data remains the same, of course, but the redo stream essentially starts
over. The log sequence number is reset to 1 (the SCN is not reset) and a new life begins for
the database.
To indicate to Oracle that you are doing an incomplete recovery, you will open the data-
base in a slightly different way. You will still use the ALTER DATABASE OPEN command, but
you will also include the keyword RESETLOGS . The RESETLOGS command indicates to Oracle
that it should reset the control file and the redo log sequence number and open the database
as a brand-new incarnation. The entire command looks like this:
alter database open resetlogs;
Through Oracle Database 10 g , Oracle recommended that you back up the database any-
time you issue a RESETLOGS operation. This was because Oracle did not support recovering
a database through a RESETLOGS operation. Since Oracle Database 11 g , Oracle allows you
to perform a recovery through RESETLOGS . This is supported through the new %r format
string available in the LOG_ARCHIVE_FORMAT parameter (see Chapter 1 for more on this
parameter). This format string will include a RESETLOGS number in the naming of each
archived redo log. This will help Oracle keep the redo-log stream straight.
Search WWH ::




Custom Search