环境: OEL 5.7 + Oracle 11.2.0.4
1.直接restore到想要恢复的时间点报错:RMAN> sql "alter session set nls_date_format=''yyyy-mm-dd hh24:mi:ss''";RMAN> restore database until time '2018-06-26 09:00:00';Starting restore at 2018-06-27 07:30:04using channel ORA_DISK_1using channel ORA_DISK_2using channel ORA_DISK_3using channel ORA_DISK_4using channel ORA_DISK_5using channel ORA_DISK_6RMAN-00571: ===========================================================RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============RMAN-00571: ===========================================================RMAN-03002: failure of restore command at 06/27/2018 07:30:04RMAN-20207: UNTIL TIME or RECOVERY WINDOW is before RESETLOGS time
2.查看incarnation,尝试RESET DATABASE TO INCARNATION也不行:
RMAN> list incarnation;List of Database IncarnationsDB Key Inc Key DB Name DB ID STATUS Reset SCN Reset Time------- ------- -------- ---------------- --- ---------- ----------1 1 ORCL 1507617844 PARENT 1 2013-08-24 11:37:302 2 ORCL 1507617844 CURRENT 925702 2018-06-26 16:58:31RMAN> RESET DATABASE TO INCARNATION 1;database reset to incarnation 1RMAN> restore database until time '2018-06-26 09:00:00';Starting restore at 2018-06-27 07:30:40using channel ORA_DISK_1using channel ORA_DISK_2using channel ORA_DISK_3using channel ORA_DISK_4using channel ORA_DISK_5using channel ORA_DISK_6RMAN-00571: ===========================================================RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============RMAN-00571: ===========================================================RMAN-03002: failure of restore command at 06/27/2018 07:30:40RMAN-06026: some targets not found - aborting restoreRMAN-06023: no backup or copy of datafile 4 found to restoreRMAN-06023: no backup or copy of datafile 3 found to restoreRMAN-06023: no backup or copy of datafile 2 found to restoreRMAN-06023: no backup or copy of datafile 1 found to restoreRMAN> list backup of database;specification does not match any backup in the repository
此时catalog start with 之前的全备也不认。
思考一下。。3.恢复一个incarnation之前的控制文件来尝试恢复:[ora11204@OEL-ASM orabak]$ ls -lrth |grep CTL-rw-r----- 1 ora11204 oinstall 12M Jun 26 15:00 ORCL.656.1.20180626.CTL-rw-r----- 1 ora11204 oinstall 12M Jun 26 16:00 ORCL.660.1.20180626.CTL-rw-r----- 1 ora11204 oinstall 9.4M Jun 26 17:00 ORCL.1.1.20180626.CTL-rw-r----- 1 ora11204 oinstall 9.4M Jun 26 18:00 ORCL.3.1.20180626.CTL-rw-r----- 1 ora11204 oinstall 9.4M Jun 26 19:00 ORCL.5.1.20180626.CTL-rw-r----- 1 ora11204 oinstall 9.4M Jun 26 20:00 ORCL.7.1.20180626.CTL-rw-r----- 1 ora11204 oinstall 9.4M Jun 26 21:00 ORCL.9.1.20180626.CTL-rw-r----- 1 ora11204 oinstall 9.4M Jun 26 22:00 ORCL.11.1.20180626.CTL-rw-r----- 1 ora11204 oinstall 9.4M Jun 26 23:00 ORCL.13.1.20180626.CTL-rw-r----- 1 ora11204 oinstall 9.4M Jun 27 00:00 ORCL.15.1.20180627.CTL-rw-r----- 1 ora11204 oinstall 9.4M Jun 27 01:00 ORCL.17.1.20180627.CTL-rw-r----- 1 ora11204 oinstall 9.4M Jun 27 02:00 ORCL.25.1.20180627.CTL-rw-r----- 1 ora11204 oinstall 9.4M Jun 27 03:00 ORCL.27.1.20180627.CTL-rw-r----- 1 ora11204 oinstall 9.4M Jun 27 04:00 ORCL.29.1.20180627.CTL-rw-r----- 1 ora11204 oinstall 9.4M Jun 27 05:00 ORCL.31.1.20180627.CTL-rw-r----- 1 ora11204 oinstall 9.4M Jun 27 06:00 ORCL.33.1.20180627.CTL-rw-r----- 1 ora11204 oinstall 9.4M Jun 27 07:00 ORCL.35.1.20180627.CTLRMAN> restore controlfile from '/u01/orabak/ORCL.656.1.20180626.CTL';Starting restore at 2018-06-27 07:38:03using target database control file instead of recovery catalogallocated channel: ORA_DISK_1channel ORA_DISK_1: SID=19 device type=DISKchannel ORA_DISK_1: restoring control filechannel ORA_DISK_1: restore complete, elapsed time: 00:00:03output file name=/u01/oradata/orcl/control01.ctloutput file name=/u01/oradata/orcl/control02.ctlFinished restore at 2018-06-27 07:38:07RMAN> alter database mount;database mountedreleased channel: ORA_DISK_1RMAN> list incarnation;List of Database IncarnationsDB Key Inc Key DB Name DB ID STATUS Reset SCN Reset Time------- ------- -------- ---------------- --- ---------- ----------1 1 ORCL 1506513914 PARENT 1 2013-08-24 11:37:302 2 ORCL 1506513914 CURRENT 925702 2018-06-13 22:19:40RMAN> RMAN> sql "alter session set nls_date_format=''yyyy-mm-dd hh24:mi:ss''";RMAN> restore database until time '2018-06-26 09:00:00';直接可以成功转储。RMAN> recover database until time '2018-06-26 09:00:00';直接可以成功恢复。RMAN> alter database open resetlogs;
可以成功恢复。