3.恢复控制文件
登陆到rman,控制文件还原的时候将还原到参数文件指定的位置,所以参数文件指定的控制文件目录必须存在,否则报错,例如下面一开始我没有创建就报错,后来创建完成就不报错了,如果你想还原到其他地方,可以修改参数文件指定到相应地址。
RMAN> restore controlfile from '/home/oracle/04pggb87_1_1.bak'; Starting restore at 21-AUG-2014 10:26:14 using channel ORA_DISK_1 channel ORA_DISK_1: restoring control file RMAN-00571: =========================================================== RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS =============== RMAN-00571: =========================================================== RMAN-03002: failure of restore command at 08/21/2014 10:26:15 ORA-19870: error while restoring backup piece /home/oracle/04pggb87_1_1.bak ORA-19504: failed to create file "/u01/app/oracle/oradata/bre1/control01.ctl" ORA-27040: file create error, unable to create file Linux-x86_64 Error: 2: No such file or directory Additional information: 1 RMAN> restore controlfile from '/home/oracle/04pggb87_1_1.bak'; Starting restore at 21-AUG-2014 10:26:50 using channel ORA_DISK_1 channel ORA_DISK_1: restoring control file RMAN-00571: =========================================================== RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS =============== RMAN-00571: =========================================================== RMAN-03002: failure of restore command at 08/21/2014 10:26:51 ORA-19504: failed to create file "/u01/app/oracle/fast_recovery_area/bre1/control02.ctl" ORA-27040: file create error, unable to create file Linux-x86_64 Error: 2: No such file or directory Additional information: 1 ORA-19600: input file is control file (/u01/app/oracle/oradata/bre1/control01.ctl) ORA-19601: output file is control file (/u01/app/oracle/fast_recovery_area/bre1/control02.ctl) RMAN> restore controlfile from '/home/oracle/04pggb87_1_1.bak'; Starting restore at 21-AUG-2014 10:27:24 using channel ORA_DISK_1 channel ORA_DISK_1: restoring control file channel ORA_DISK_1: restore complete, elapsed time: 00:00:01 output file name=/u01/app/oracle/oradata/bre1/control01.ctl output file name=/u01/app/oracle/fast_recovery_area/bre1/control02.ctl Finished restore at 21-AUG-2014 10:27:25
4.mount数据库,注册备份集
重启数据库,直接就可以启动到mount
SQL> startup mount; ORACLE instance started. Total System Global Area 835104768 bytes Fixed Size 2257840 bytes Variable Size 503319632 bytes Database Buffers 322961408 bytes Redo Buffers 6565888 bytes Database mounted. SQL>如果此时备份集所在文件目录改变,需要手工catalog注册备份集,这里我们将拷过来的备份文件复制到/home/oracle/backup下,演示一下手工catalog备份集
[oracle@bre2 ~]$ ls