Oracle 利用RMAN 完成数据迁移(2)

[oracle@ENMOEDU dbs]$ ls                  #恢复的参数文件在$ORACLE_HOME/dbs  下
hc_ENMOEDU2.dat    lkDUMMY   orapwENMOEDU    spfileENMOEDU2.ora

RMAN> shutdown immediate                           #关伪实例

 

Oracle instance shut down

2.然后再起真正的实例,恢复控制文件(要注意,他原来就有,你这样起,把B机的所有文件包括  数据文件 ,控制文件,参数文件,日志文件都删掉

SQL> startup

ORACLE instance started.

 

Total System Global Area 422670336 bytes

Fixed Size 1345380 bytes

Variable Size 260049052 bytes

Database Buffers 155189248 bytes

Redo Buffers 6086656 bytes

ORA-00205: error in identifying control file, check alert log for more info

RMAN> restore controlfile from '/u01/app/oracle/ENMOEDU/backupset/2014_08_14/o1_mf_ncsnf_TAG20140814T203309_9ysc8x14_.bkp';

 

Starting restore at 15-AUG-14

using target database control file instead of recovery catalog

allocated channel: ORA_DISK_1

channel ORA_DISK_1: SID=18 device type=DISK

 

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/ENMOEDU/control01.ctl

output file name=/u01/app/oracle/fast_recovery_area/ENMOEDU/control02.ctl

Finished restore at 15-AUG-14

3.把数据库开到mount状态,以便修复数据文件。

RMAN> alter database mount;

 

database mounted

released channel: ORA_DISK_1

RMAN> restore database;                    #恢复数据文件   发现报错,很可能是备份已经过期已经,

 

Starting restore at 15-AUG-14

using target database control file instead of recovery catalog

allocated channel: ORA_DISK_1

channel ORA_DISK_1: SID=1 device type=DISK

 

creating datafile file number=1 name=/u01/app/oracle/oradata/ENMOEDU/system01.dbf

RMAN-00571: ===========================================================

RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============

RMAN-00571: ===========================================================

RMAN-03002: failure of restore command at 08/15/2014 23:21:00

ORA-01180: can not create datafile 1

ORA-01110: data file 1: '/u01/app/oracle/oradata/ENMOEDU/system01.dbf'

RMAN> list backup;          #查看备份信息    发现确实过期

10 13.85M DISK 00:00:02 14-AUG-14

        BP Key: 14 Status: EXPIRED Compressed: NO Tag: TAG20140814T203306

        Piece Name: /u01/app/oracle/arch_50pfv1g2_1_1.rmn

然后再去A机  再来一个整体备份  再传给B机  不在赘述,再恢复控制文件,然后再恢复数据文件,  

再启动到open即可。

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/669930839f435d2ace56bbd2f2e859af.html