Oracle数据库rman备份计划及恢复(3)

List of Files Which Where Not Cataloged
=======================================
File Name: /u01/ora_bak/O1_MF_S_895896351_C4KSF2YN_.BKP
  RMAN-07518: Reason: Foreign database file DBID: 966107096  Database Name: RFDB
File Name: /u01/ora_bak/ora_bak/controlfile/o1_mf_c5fr9b6n_.ctl
  RMAN-07519: Reason: Error while cataloging. See alert.log.
File Name: /u01/ora_bak/ora_bak/onlinelog_f/o1_mf_2_c5fr9h1f_.log
  RMAN-07529: Reason: catalog is not supported for this file type
File Name: /u01/ora_bak/ora_bak/onlinelog_f/o1_mf_3_c5fr9kfo_.log
  RMAN-07529: Reason: catalog is not supported for this file type
File Name: /u01/ora_bak/ora_bak/onlinelog_f/o1_mf_1_c5fr9ds4_.log
  RMAN-07529: Reason: catalog is not supported for this file type
File Name: /u01/ora_bak/ora_bak/onlinelog/o1_mf_3_c5fr9k9d_.log
  RMAN-07529: Reason: catalog is not supported for this file type
File Name: /u01/ora_bak/ora_bak/onlinelog/o1_mf_2_c5fr9gy5_.log
  RMAN-07529: Reason: catalog is not supported for this file type
File Name: /u01/ora_bak/ora_bak/onlinelog/o1_mf_1_c5fr9dmk_.log
  RMAN-07529: Reason: catalog is not supported for this file type
File Name: /u01/ora_bak/O1_MF_S_895896118_C4KS5S1R_.BKP
  RMAN-07518: Reason: Foreign database file DBID: 966107096  Database Name: RFDB

i.开始restore数据文件:

RMAN> restore database;

Starting restore at 14-DEC-15
using channel ORA_DISK_1

channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00001 to /u01/app/oracle/oradata/ATEST/datafile/o1_mf_system_c5fr6s3v_.dbf
channel ORA_DISK_1: restoring datafile 00002 to /u01/app/oracle/oradata/ATEST/datafile/o1_mf_sysaux_c5fr6s6d_.dbf
channel ORA_DISK_1: restoring datafile 00003 to /u01/app/oracle/oradata/ATEST/datafile/o1_mf_undotbs1_c5fr6s7n_.dbf
channel ORA_DISK_1: restoring datafile 00004 to /u01/app/oracle/oradata/ATEST/datafile/o1_mf_users_c5fr6s88_.dbf
channel ORA_DISK_1: reading from backup piece /u01/app/oracle/fast_recovery_area/ATEST/backupset/2015_12_09/o1_mf_nnndf_TAG20151209T161546_c6hrslnq_.bkp
channel ORA_DISK_1: piece handle=/u01/app/oracle/fast_recovery_area/ATEST/backupset/2015_12_09/o1_mf_nnndf_TAG20151209T161546_c6hrslnq_.bkp tag=TAG20151209T161546
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:45
Finished restore at 14-DEC-15

j.开始recover数据(在此之前,需要先拷贝redolog到控制文件默认的路径下):

redolog默认路径:

SQL> select member from v$logfile;

MEMBER
--------------------------------------------------------------------------------
/u01/app/oracle/oradata/ATEST/onlinelog/o1_mf_3_c5fr9k9d_.log
/u01/app/oracle/fast_recovery_area/ATEST/onlinelog/o1_mf_3_c5fr9kfo_.log
/u01/app/oracle/oradata/ATEST/onlinelog/o1_mf_2_c5fr9gy5_.log
/u01/app/oracle/fast_recovery_area/ATEST/onlinelog/o1_mf_2_c5fr9h1f_.log
/u01/app/oracle/oradata/ATEST/onlinelog/o1_mf_1_c5fr9dmk_.log
/u01/app/oracle/fast_recovery_area/ATEST/onlinelog/o1_mf_1_c5fr9ds4_.log

6 rows selected.

开始recover数据库:

RMAN> recover database;

Starting recover at 14-DEC-15
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=1137 device type=DISK

starting media recovery

archived log for thread 1 with sequence 15 is already on disk as file /u01/ora_bak/ora_bak/arch/1_15_896812716.dbf
archived log for thread 1 with sequence 16 is already on disk as file /u01/ora_bak/ora_bak/arch/1_16_896812716.dbf
archived log for thread 1 with sequence 17 is already on disk as file /u01/ora_bak/ora_bak/arch/1_17_896812716.dbf
archived log for thread 1 with sequence 18 is already on disk as file /u01/ora_bak/ora_bak/arch/1_18_896812716.dbf
archived log for thread 1 with sequence 19 is already on disk as file /u01/ora_bak/ora_bak/arch/1_19_896812716.dbf
archived log for thread 1 with sequence 20 is already on disk as file /u01/ora_bak/ora_bak/arch/1_20_896812716.dbf
archived log for thread 1 with sequence 21 is already on disk as file /u01/ora_bak/ora_bak/arch/1_21_896812716.dbf
archived log for thread 1 with sequence 22 is already on disk as file /u01/ora_bak/ora_bak/arch/1_22_896812716.dbf
archived log for thread 1 with sequence 23 is already on disk as file /u01/ora_bak/ora_bak/arch/1_23_896812716.dbf
archived log for thread 1 with sequence 24 is already on disk as file /u01/ora_bak/ora_bak/arch/1_24_896812716.dbf
archived log for thread 1 with sequence 25 is already on disk as file /u01/ora_bak/ora_bak/arch/1_25_896812716.dbf
archived log for thread 1 with sequence 26 is already on disk as file /u01/ora_bak/ora_bak/arch/1_26_896812716.dbf
archived log for thread 1 with sequence 27 is already on disk as file /u01/ora_bak/ora_bak/arch/1_27_896812716.dbf
archived log for thread 1 with sequence 28 is already on disk as file /u01/ora_bak/ora_bak/arch/1_28_896812716.dbf
archived log for thread 1 with sequence 29 is already on disk as file /u01/ora_bak/ora_bak/arch/1_29_896812716.dbf
archived log for thread 1 with sequence 30 is already on disk as file /u01/ora_bak/ora_bak/arch/1_30_896812716.dbf
archived log for thread 1 with sequence 31 is already on disk as file /u01/ora_bak/ora_bak/arch/1_31_896812716.dbf
archived log for thread 1 with sequence 32 is already on disk as file /u01/app/oracle/oradata/ATEST/onlinelog/o1_mf_2_c5fr9gy5_.log
archived log for thread 1 with sequence 33 is already on disk as file /u01/app/oracle/oradata/ATEST/onlinelog/o1_mf_3_c5fr9k9d_.log
archived log for thread 1 with sequence 34 is already on disk as file /u01/app/oracle/oradata/ATEST/onlinelog/o1_mf_1_c5fr9dmk_.log
archived log file name=/u01/ora_bak/ora_bak/arch/1_15_896812716.dbf thread=1 sequence=15
archived log file name=/u01/ora_bak/ora_bak/arch/1_16_896812716.dbf thread=1 sequence=16
archived log file name=/u01/ora_bak/ora_bak/arch/1_17_896812716.dbf thread=1 sequence=17
archived log file name=/u01/ora_bak/ora_bak/arch/1_18_896812716.dbf thread=1 sequence=18
archived log file name=/u01/ora_bak/ora_bak/arch/1_19_896812716.dbf thread=1 sequence=19
archived log file name=/u01/ora_bak/ora_bak/arch/1_20_896812716.dbf thread=1 sequence=20
archived log file name=/u01/ora_bak/ora_bak/arch/1_21_896812716.dbf thread=1 sequence=21
archived log file name=/u01/ora_bak/ora_bak/arch/1_22_896812716.dbf thread=1 sequence=22
archived log file name=/u01/ora_bak/ora_bak/arch/1_23_896812716.dbf thread=1 sequence=23
archived log file name=/u01/ora_bak/ora_bak/arch/1_24_896812716.dbf thread=1 sequence=24
archived log file name=/u01/ora_bak/ora_bak/arch/1_25_896812716.dbf thread=1 sequence=25
archived log file name=/u01/ora_bak/ora_bak/arch/1_26_896812716.dbf thread=1 sequence=26
archived log file name=/u01/ora_bak/ora_bak/arch/1_27_896812716.dbf thread=1 sequence=27
archived log file name=/u01/ora_bak/ora_bak/arch/1_28_896812716.dbf thread=1 sequence=28
archived log file name=/u01/ora_bak/ora_bak/arch/1_29_896812716.dbf thread=1 sequence=29
archived log file name=/u01/ora_bak/ora_bak/arch/1_30_896812716.dbf thread=1 sequence=30
archived log file name=/u01/ora_bak/ora_bak/arch/1_31_896812716.dbf thread=1 sequence=31
archived log file name=/u01/app/oracle/oradata/ATEST/onlinelog/o1_mf_2_c5fr9gy5_.log thread=1 sequence=32
archived log file name=/u01/app/oracle/oradata/ATEST/onlinelog/o1_mf_3_c5fr9k9d_.log thread=1 sequence=33
archived log file name=/u01/app/oracle/oradata/ATEST/onlinelog/o1_mf_1_c5fr9dmk_.log thread=1 sequence=34
media recovery complete, elapsed time: 00:00:04
Finished recover at 14-DEC-15

k.以resetlogs打开数据库(在此之前,先删除原来的redolog,因为数据库会重新创建一组redolog):

删除原来的redo:

rm -rf /u01/app/oracle/oradata/ATEST/onlinelog/*

以resetlogs打开数据库:

RMAN> alter database open resetlogs;

using target database control file instead of recovery catalog
database opened

至此,数据库恢复全部完成!

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

转载注明出处:https://www.heiqu.com/1b2feab01f53b312d699fea974a72e25.html