异机恢复perform restores

Restoring and Recovering the database on a new host
第一台机器上mount模式下做全备
 
new host:
 
1.配置oracle_sid和之前一致
2.start rman and connect to the target instance in NOCATALOG mode. (rman target / nocatalog)
rman target /
<=>
rman target / nocatalog
3.set then database identifier(DBID).
4.start the instance in NOMOUNT mode.
5.restore the server parameter file from the backup sets.(pfile 传到new host 恢复出spfile)
6.shutdown the instance.
7.edit the restored initialization parameter file.
8.start the instance in NOMOUNT mode.
9.create a RUN block to :
     - Restore the control file
     - Mount the database
10.create the rman recovery script to restore and recover the database.
11.execute the rman script.
12.open the database with the resetlogs option.
 
backups 传到new host
还原spfile
FRA
catalog recover area;
非FRA
catalog start with '/oradata';
 
RMAN> run {
2> restore spfile from autobackup
3> recovery area = '<flash recovery area destination>'
4> db_name = '<db_name>';
5> }
 
offline的恢复(冷备)
startup force nomount;
restore controlfile;
alter database mount;
restore database;
recover database noredo;
alter database open resetlogs;
 
 

异机恢复(option)
从NODE2恢复到NODE1:
0、环境清理
登陆NODE1
shutdown immediate;
startup mount restrict;
drop database;
1、准备三样内容:
rman target / 获得DBID:758457693
全库的完整备份(含控制文件、SP文件、归档文件)
run {
allocate channel c1 device type disk format '/u01/oradata/newhost/%U';
backup as compressed backupset database include current controlfile plus archivelog;
}
cd /u01/oradata/newhost/
scp * node4:/u01/oradata/newhost/
单独将autobackup的spfile&controlfile复制过来。
2、在node1上完成实例的启动
关闭ASM实例,释放内存。
创建目录
cd /u01/oradata
mkdir sales arch backup newhost
mkdir -p /u01/app/oracle/fast_recovery_area/sales
rman target /
set dbid 758457693
startup nomount;
restore spfile to '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/spfilesales.ora' from '/u01/oradata/newhost/o1_mf_s_886008933_bv6p3553_.bkp';
startup nomount force;
3、完成控制文件的启动
restore controlfile from '/u01/oradata/newhost/o1_mf_s_886008933_bv6p3553_.bkp';
alter database mount;
4、恢复数据库
catalog start with '/u01/oradata/newhost/';
restore database;
SQL > recover database using backup controlfile until cancel;
SQL > alter database open resetlogs;
原文地址:https://www.cnblogs.com/willsun8023/p/5071132.html