Case 1: Our database has been crashed, due to disk corruption. All Database files have been not accessible but RMAN backup set location is accessible. In this case we need to restore and recover database within new location.
Source Setup:
Database Mount Point is /DB/PROD
Archive Log location is /DB/arch/online
Backup set location is /DB/rman_bkp
Target Setup:
Database Mount Point is /DB/anup/datafile
Archive Log location is /DB/anup/archive
Backup set location is /DB/rman_bkp
Step 1 First we restore control file to new location and mount the database.
Change the control_files parameter in init file.
Example : control_files=’/DB/anup/datafile/control01.ctl’
Invoke RMAN utility and startup nomount database.
RMAN > set dbid <……………….>
RMAN> restore controlfile from autobackup;
RMAN>
Step 2 Restore Datafiles to new location.
run
{
set newname for datafile '/DB/PROD/system01.dbf' to '/DB/anup/datafile/system01.dbf';
set newname for datafile '/DB/PROD/undotbs01.dbf' to '/DB/anup/datafile/undotbs01.dbf';
set newname for datafile '/DB/PROD/sysaux01.dbf' to '/DB/anup/datafile/sysaux01.dbf';
set newname for datafile '/DB/PROD/users01.dbf' to '/DB/anup/datafile/users01.dbf';
restore database;
switch datafile all; # point control file to new filenames
}
Step 3 Restore Backup archive log file to new location.
run
{
set archivelog destination to '/DB/anup/archive';
restore archivelog all;
}
Step 4 Recover Database:
RMAN> recover database;
Step 5 Relocate Log file location.
SQL> alter database rename file '/DB/PROD/redo01.log' to '/DB/anup/datafile/redo01.log'
Database altered.
SQL> alter database rename file '/DB/PROD/redo02.log' to '/DB/anup/datafile/redo02.log';
Database altered.
SQL> alter database rename file '/DB/PROD/redo03.log' to '/DB/anup/datafile/redo03.log';
Step 6 Open database with reset options
RMAN> alter database open resetlogs;
Case 2: our database has been crashed, due to disk corruption. All Database files have been not accessible and RMAN backup set location is also not accessible. In this case we need to restore and recover database within new location.
Source Setup:
Datafile/Logfile/Controlfile Location is /DB/PROD
Archive Log location is /DB/arch/online
Backup set location /DB/rman_bkp
Target Setup:
Datafile/Logfile/Controlfile Location is /DB/anup/datafile
Archive Log location /DB/anup/archive
Backup set location /DB/anup/rman_bkp
Step 1 First we restore control file to new location and mount the database.
Change the control_files parameter in init file.
Example : control_files=’/DB/anup/datafile/control01.ctl’
Invoke RMAN utility and startup nomount database.
RMAN > set dbid <……………….>
RMAN> restore controlfile from ‘
RMAN> alter database mount;
Step 2 Catalog your backuppiece.
RMAN> catalog backuppiece '/DB/anup/rman_bkp/TAG20080506T150716_421c355f_.bkp';
cataloged backuppiece
backup piece handle=/oradata2/o1_mf_nnndf_TAG20080506T150716_421c355f_.bkp
recid=33 stamp=65398295
cataloged backuppiece
backup piece handle=/oradata2/o1_mf_nnndf_TAG20080506T150716_421c355f_.bkp
recid=33 stamp=65398295
RMAN> list backup;
Step 3 restore Datafiles to new location.
run
{
set newname for datafile '/DB/PROD/system01.dbf' to '/DB/anup/datafile/system01.dbf';
set newname for datafile '/DB/PROD/undotbs01.dbf' to '/DB/anup/datafile/undotbs01.dbf';
set newname for datafile '/DB/PROD/sysaux01.dbf' to '/DB/anup/datafile/sysaux01.dbf';
set newname for datafile '/DB/PROD/users01.dbf' to '/DB/anup/datafile/users01.dbf';
restore database;
switch datafile all; # point control file to new filenames
}
Step 4 Restore Backup archive log file to New location.
run
{
set archivelog destination to '/DB/anup/archive';
restore archivelog all;
}
Step 5 Recover Database:
RMAN> recover database;
Step 6 Relocate Log file location.
SQL> alter database rename file '/DB/PROD/redo01.log' to '/DB/anup/datafile/redo01.log';
Database altered.
SQL> alter database rename file '/DB/PROD/redo02.log' to '/DB/anup/datafile/redo02.log';
Database altered.
SQL> alter database rename file '/DB/PROD/redo03.log' to '/DB/anup/datafile/redo03.log';
Step 7 Open the database
RMAN> alter database open resetlogs;
Post a Comment