In this scenario, you restore the database files to
an alternative location because the original location is damaged by a media
failure.
To restore the most recent whole
database backup to a new location:
If the database is open, then
shut it down. For example, enter:
SHUTDOWN IMMEDIATE
Restore all of the datafiles and
control files of the whole database backup, not just the damaged files. If the
hardware problem has not been corrected and some or all of the database files
must be restored to alternative locations, then restore the whole database
backup to a new location. For example, enter:
% cp /backup/*.dbf
/new_disk/oradata/trgt/
If necessary, edit the restored
parameter file to indicate the new location of the control files. For example:
CONTROL_FILES =
"/new_disk/oradata/trgt/control01.dbf"
Start an instance using the restored and edited parameter file and mount, but do not open, the database. For example:
STARTUP MOUNT
If the restored datafile
filenames will be different (as will be the case when you restore to a
different file system or directory, on the same node or a different node), then
update the control file to reflect the new datafile locations. For example, to
rename datafile 1 you
might enter:
ALTER DATABASE RENAME FILE
'?/oradata/trgt/system01.dbf' TO
'/new_disk/oradata/system01.dbf';
If the online redo logs were
located on a damaged disk, and the hardware problem is not corrected, then
specify a new location for each affected online log. For example, enter:
ALTER DATABASE RENAME FILE
'?/oradata/trgt/redo01.log' TO
'/new_disk/oradata/redo_01.log';
ALTER DATABASE RENAME FILE
'?/oradata/trgt/redo02.log' TO
'/new_disk/oradata/redo_02.log';
Because online redo logs are not
backed up, you cannot restore them with the datafiles and control files. In
order to allow the database to reset the online redo logs, you must first mimic
incomplete recovery:
RECOVER DATABASE UNTIL CANCEL;
CANCEL;
Open the database in RESETLOGS mode. This command clears the
online redo logs and resets the log sequence to 1:
ALTER DATABASE OPEN RESETLOGS;
Note that restoring a NOARCHIVELOG database backup and then
resetting the log discards all changes to the database made from the time the
backup was taken to the time of the failure.
No comments:
Post a Comment