Database Reference
In-Depth Information
with read-only tablespaces). Also, there are SCNs stored in the control file that have to jibe
with the SCNs in the data files. If the SCNs don't jibe, then some form of recovery is required.
Tablespace Point-in-Time Recovery
There is a concept of tablespace point-in-time recovery that allows you to restore just a
tablespace to a point in time different from that of the database. We will discuss tablespace
point-in-time recovery using RMAN in Chapter 7, “Performing Oracle Advanced Recovery.”
The OCP exam does not require that you know how to do tablespace point-in-time recovery
manually, so we are not covering that topic in this topic.
So, if the entire database is at SCN 12345 (see Figure 2.1) and you restore the USERS
tablespace to SCN 1234, that will be a problem. Oracle will detect the different SCNs
and require a complete recovery. Not quite what you hoped for.
FiGURe 2.1 Database with data files restored incorrectly for incomplete recovery
SCN the Same
SCN the Same
SCN the Same
SCN Different
Datafile #1
SYSTEM
Tablespace
SCN: 12345
Datafile #2
SYSAUX
Tablespace
SCN: 12345
Datafile #3
UNDO
Tablespace
SCN: 12345
Datafile #4
USERS
Tablespace
SCN: 1234
You want to recover to SCN 1234. Datafiles 1, 2, and 3 are at SCN 12345, which is after
SCN 1234. Incomplete recovery to SCN 1234 is not possible because recovery rolls
forward SCNs, not backward.
So, when you want to perform an incomplete database recovery, you have to restore
all the data files to a point in time at or before the point in time that you actually want to
recover to. In Figure 2.2, you can see that all the data files are recovered to SCN 1230 or
lower, so you can now begin an incomplete recovery to SCN 1234 as you wish.
Note that you do not need to restore the control file to a previous version for incomplete
recovery to work. Once you have finished the incomplete-recovery process, Oracle will reset
the control file so that it will correctly reflect the current state of the database.
You will also need to restore all archived redo logs that were generated from the time
of the backup image until the point that you want to restore to. You can determine which
archived redo log sequence numbers you want to restore by looking at the V$ARCHIVED_LOG
view (we provided a query using the V$ARCHIVED_LOG view in a note earlier in this chapter).
Keep in mind that you may also need redo contained in an online redo log that has not been
archived yet. Since you will not be restoring any online redo logs, this won't be a problem.
Search WWH ::




Custom Search