Database Reference
In-Depth Information
SWITCH
command
Use the
SWITCH
command to cause RMAN to instantly start using the
image copy of the data file in its current location. This will cause the database control file
to be changed with the old database datafile locations being changed to the locations of the
new database data files.
Other Basic Recovery Topics
There are other recovery-related topics you will need to be aware of. In the following sections,
we will cover some of those, and in Chapter 7 we will cover other, more advanced recovery
topics. In this section, we will discuss block media recovery and recovering from lost control
files and lost spfiles with RMAN.
Block Media Recovery
Sometimes one or a few blocks will become corrupt. It's rare, but it happens. RMAN pro-
vides the ability to do online block media recovery. With
block media recovery
, RMAN
will recover the corrupted blocks online. The only user impact will be to those users who
want to access the corrupt blocks, and they will have been impacted anyway.
In Oracle Database 12
c
, you use the
RECOVER
command with the
DATAFILE ... BLOCK
option to perform block media recovery. To use the
RECOVER BLOCK
command, the following
requirements must be met:
■
The database must be in ARCHIVELOG mode.
■
The database must be mounted or open.
■
There must be a current database control file in place.
■
All redo logs must be accessible.
■
Only blocks marked as
MEDIA_CORRUPT
can be recovered.
For example, sometimes you will issue a DML or DDL statement and get an error such
as the one found here:
ORA-01578: ORACLE data block corrupted (file # 6, block # 55)
ORA-01110: data file 6: '/oracle/oradata/trgt/users01.dbf'
In this case, you could issue the
RECOVER DATAFILE
command using the
BLOCK
parameter,
as shown in this example:
Recover datafile 6 block 55;
In some cases, you may want to repair a range of blocks, as shown here:
Recover datafile 6 block 55 to 105;
Search WWH ::
Custom Search