使用RMAN异机恢复磁带库的备份文件至文件系统

本文档详细介绍了如何在不同节点和目录结构下,使用RMAN将磁带库备份的数据库文件恢复到文件系统。过程包括修改PFILE、设置Oracle环境变量、恢复控制文件、挂载数据库、目录备份件、识别归档日志序列、重命名redo log文件、恢复数据文件并重设日志序列,最后确认tempfiles的位置。
摘要由CSDN通过智能技术生成

描述:原生产环境为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)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值