描述:原生产环境为Linux RAC+ASM+10.2.0.4,因存储故障,数据库无法启动;需使用第三方磁带库备份软件备份的文件进行数据库恢复。
恢复控制文件:
SET DBID 2240547690;run {
allocate channel ch1 type 'sbt_tape' PARMS="SBT_LIBRARY=/opt/simpana/Base/libobk.so";
restore controlfile to '/home/oracle/control01.ctl' from autobackup ;
release channel ch1;
}
启动数据库至mount状态:
alter database mount;
restore database:
run {
allocate channel ch1 type 'sbt_tape' PARMS="SBT_LIBRARY=/opt/simpana/Base/libobk.so";
set newname for datafile 1 to '/oradata/orcl/system.256.769887829 ';
set newname for datafile 2 to '/oradata/orcl/undotbs1.258.769887829 ';
set newname for datafile 3 to '/oradata/orcl/sysaux.257.769887829 ';
set newname for datafile 4 to '/oradata/orcl/users.259.769887829 ';
set newname for datafile 5 to '/oradata/orcl/undotbs2.264.769887929 ';
set newname for datafile 6 to '/oradata/orcl/undotbs3.265.769887929 ';
set newname for datafile 7 to '/oradata/orcl/user01 ';
set newname for datafile 8 to '/oradata/orcl/user02 ';
restore database;
switch datafile all ;
release channel ch1;
}
recover database:
run {
allocate channel ch1 type 'sbt_tape' PARMS="SBT_LIBRARY=/opt/simpana/Base/libobk.so";
recover database;
release channel ch1;
}
更改redolog文件目录:
ALTER DATABASE RENAME FILE '+DATA01/orcl/onlinelog/group_2.262.769887895' TO '/oradata/orcl/group_2.262.769887895';
ALTER DATABASE RENAME FILE '+DATA01/orcl/onlinelog/group_1.261.769887889' TO '/oradata/orcl/group_1.261.769887889';
ALTER DATABASE RENAME FILE '+DATA01/orcl/onlinelog/group_5.266.769887971' TO '/oradata/orcl/group_5.266.769887971';
ALTER DATABASE RENAME FILE '+DATA01/orcl/onlinelog/group_6.267.769887977' TO '/oradata/orcl/group_6.267.769887977';
ALTER DATABASE RENAME FILE '+DATA01/orcl/onlinelog/group_3.268.769887983' TO '/oradata/orcl/group_3.268.769887983';
ALTER DATABASE RENAME FILE '+DATA01/orcl/onlinelog/group_4.269.769887989' TO '/oradata/orcl/group_4.269.769887989';
启动数据库至OPEN状态:
SQL> alter database open resetlogs;
Database altered.
删除原有的临时表空间文件:
alter database tempfile '+DATA01/orcl/tempfile/temp.263.769887907' offline;
alter database tempfile '+DATA01/orcl/tempfile/temp.263.769887907' drop;
添加新的临时表空间文件:
alter tablespace TEMP add tempfile '/oradata/orcl/temp02' size 7636M autoextend on maxsize unlimited ;
参考MOS文章如下:
How To Restore Rman Backups On A Different Node When The Directory Structures Are Different (文档 ID 419137.1)