Databases Reference
In-Depth Information
If you're using Oracle Database 11 g or lower, you need to use the sql command to run the alter database datafile
command and carefully enclose the entire statement in double quotes and use two single quotes to enclose file names:
RMAN> run{
sql "alter database datafile ''/u01/dbfile/o12c/users01.dbf'' offline";
set newname for datafile '/u01/dbfile/o12c/users01.dbf'
to '/u02/dbfile/o12c/users01.dbf';
restore datafile '/u01/dbfile/o12c/users01.dbf';
switch datafile all; # Update control file with new file names.
recover datafile '/u02/dbfile/o12c/users01.dbf';
sql "alter database datafile ''/u02/dbfile/o12c/users01.dbf'' online";
}
At this point, it doesn't hurt to run an RMAN report schema command to ensure that the data files are restored
in the correct locations.
Performing Block-Level Recovery
Problem
When performing daily backups, you notice that RMAN is reporting in your target database alert.log file that there
is a corrupt block in a large data file. It could take a significant amount of time to perform the traditional restore and
recover of a large data file. You wonder whether there is a method for just recovering the corrupt block and not the
entire data file.
Note
Block-level recovery requires the oracle enterprise edition of the database.
Solution
Use the recover corruption list command to resolve this issue. When RMAN backs up a data file, it will check each
used block for physical corruption. You'll be notified of corruption in the output, such as:
ORA-19566: exceeded limit of 0 corrupt blocks for file
/u01/dbfile/o12c/tools01.dbf
When RMAN detects corrupt blocks, it writes an error to the alert.log file and also populates the
V$DATABASE_BLOCK_CORRUPTION view. You can instruct RMAN to recover the blocks listed as corrupt in that
view as follows:
RMAN> recover corruption list;
Here's a partial listing of the expected output:
starting media recovery
media recovery complete, elapsed time: 00:00:07
Tip
you can verify the block corruption with the rman backup validate or validate command.
 
 
Search WWH ::




Custom Search