RMAN如何实现完全恢复错误
这篇文章主要为大家展示了"RMAN如何实现完全恢复错误",内容简而易懂,条理清晰,希望能够帮助大家解决疑惑,下面让小编带领大家一起研究并学习一下"RMAN如何实现完全恢复错误"这篇文章吧。
RMAN恢复案例:
用户在做rman的恢复时遇到以下错误:
RMAN> restore database from tag='TAG20140923T160003';
Starting restore at 24-SEP-14allocated channel: ORA_DISK_1channel ORA_DISK_1: sid=156 devtype=DISKallocated channel: ORA_DISK_2channel ORA_DISK_2: sid=147 devtype=DISKchannel ORA_DISK_2: starting datafile backupset restorechannel ORA_DISK_2: specifying datafile(s) to restore from backup setrestoring datafile 00001 to /u01/app/oracle/oradata/prod/system01.dbfrestoring datafile 00004 to /u01/app/oracle/oradata/prod/users01.dbfchannel ORA_DISK_2: reading from backup piece /backup/rman_bak/lv0_PROD_111_859046404.bakchannel ORA_DISK_1: starting datafile backupset restorechannel ORA_DISK_1: specifying datafile(s) to restore from backup setrestoring datafile 00002 to /u01/app/oracle/oradata/prod/undotbs01.dbfrestoring datafile 00003 to /u01/app/oracle/oradata/prod/sysaux01.dbfrestoring datafile 00005 to /u01/app/oracle/oradata/prod/example01.dbfchannel ORA_DISK_1: reading from backup piece /backup/rman_bak/lv0_PROD_112_859046404.bakchannel ORA_DISK_1: restored backup piece 1piece handle=/backup/rman_bak/lv0_PROD_112_859046404.bak tag=TAG20140923T160003channel ORA_DISK_1: restore complete, elapsed time: 00:00:35channel ORA_DISK_2: restored backup piece 1piece handle=/backup/rman_bak/lv0_PROD_111_859046404.bak tag=TAG20140923T160003channel ORA_DISK_2: restore complete, elapsed time: 00:00:35Finished restore at 24-SEP-14
RMAN> recover database;
Starting recover at 24-SEP-14using channel ORA_DISK_1using channel ORA_DISK_2channel ORA_DISK_1: starting incremental datafile backupset restorechannel ORA_DISK_1: specifying datafile(s) to restore from backup setdestination for restore of datafile 00001: /u01/app/oracle/oradata/prod/system01.dbfdestination for restore of datafile 00004: /u01/app/oracle/oradata/prod/users01.dbfchannel ORA_DISK_1: reading from backup piece /backup/rman_bak/lvl1_PROD_118_859047306.bakchannel ORA_DISK_2: starting incremental datafile backupset restorechannel ORA_DISK_2: specifying datafile(s) to restore from backup setdestination for restore of datafile 00002: /u01/app/oracle/oradata/prod/undotbs01.dbfdestination for restore of datafile 00003: /u01/app/oracle/oradata/prod/sysaux01.dbfdestination for restore of datafile 00005: /u01/app/oracle/oradata/prod/example01.dbfchannel ORA_DISK_2: reading from backup piece /backup/rman_bak/lvl1_PROD_119_859047306.bakchannel ORA_DISK_1: restored backup piece 1piece handle=/backup/rman_bak/lvl1_PROD_118_859047306.bak tag=TAG20140923T161506channel ORA_DISK_1: restore complete, elapsed time: 00:00:01channel ORA_DISK_1: starting incremental datafile backupset restorechannel ORA_DISK_1: specifying datafile(s) to restore from backup setdestination for restore of datafile 00001: /u01/app/oracle/oradata/prod/system01.dbfdestination for restore of datafile 00004: /u01/app/oracle/oradata/prod/users01.dbfchannel ORA_DISK_1: reading from backup piece /backup/rman_bak/lvl1_PROD_125_859048203.bakchannel ORA_DISK_1: restored backup piece 1piece handle=/backup/rman_bak/lvl1_PROD_125_859048203.bak tag=TAG20140923T163003channel ORA_DISK_1: restore complete, elapsed time: 00:00:01channel ORA_DISK_2: restored backup piece 1piece handle=/backup/rman_bak/lvl1_PROD_119_859047306.bak tag=TAG20140923T161506channel ORA_DISK_2: restore complete, elapsed time: 00:00:03channel ORA_DISK_1: starting incremental datafile backupset restorechannel ORA_DISK_1: specifying datafile(s) to restore from backup setdestination for restore of datafile 00001: /u01/app/oracle/oradata/prod/system01.dbfdestination for restore of datafile 00004: /u01/app/oracle/oradata/prod/users01.dbfchannel ORA_DISK_1: reading from backup piece /backup/rman_bak/lvl1_PROD_132_859049103.bakchannel ORA_DISK_2: starting incremental datafile backupset restorechannel ORA_DISK_2: specifying datafile(s) to restore from backup setdestination for restore of datafile 00002: /u01/app/oracle/oradata/prod/undotbs01.dbfdestination for restore of datafile 00003: /u01/app/oracle/oradata/prod/sysaux01.dbfdestination for restore of datafile 00005: /u01/app/oracle/oradata/prod/example01.dbfchannel ORA_DISK_2: reading from backup piece /backup/rman_bak/lvl1_PROD_126_859048203.bakchannel ORA_DISK_1: restored backup piece 1piece handle=/backup/rman_bak/lvl1_PROD_132_859049103.bak tag=TAG20140923T164503channel ORA_DISK_1: restore complete, elapsed time: 00:00:01channel ORA_DISK_2: restored backup piece 1piece handle=/backup/rman_bak/lvl1_PROD_126_859048203.bak tag=TAG20140923T163003channel ORA_DISK_2: restore complete, elapsed time: 00:00:01channel ORA_DISK_1: starting incremental datafile backupset restorechannel ORA_DISK_1: specifying datafile(s) to restore from backup setdestination for restore of datafile 00002: /u01/app/oracle/oradata/prod/undotbs01.dbfdestination for restore of datafile 00003: /u01/app/oracle/oradata/prod/sysaux01.dbfdestination for restore of datafile 00005: /u01/app/oracle/oradata/prod/example01.dbfchannel ORA_DISK_1: reading from backup piece /backup/rman_bak/lvl1_PROD_133_859049103.bakchannel ORA_DISK_1: restored backup piece 1piece handle=/backup/rman_bak/lvl1_PROD_133_859049103.bak tag=TAG20140923T164503channel ORA_DISK_1: restore complete, elapsed time: 00:00:01starting media recoveryarchive log thread 1 sequence 90 is already on disk as file /arch/1_90_858969934.dbfarchive log thread 1 sequence 91 is already on disk as file /arch/1_91_858969934.dbfarchive log thread 1 sequence 92 is already on disk as file /disk1/prod/redo01.logarchive log thread 1 sequence 93 is already on disk as file /disk1/prod/redo02.logOracle Error: ORA-01547: warning: RECOVER succeeded but OPEN RESETLOGS would get error belowORA-01152: file 2 was not restored from a sufficiently old backup ORA-01110: data file 2: '/u01/app/oracle/oradata/prod/undotbs01.dbf'RMAN-00571: ===========================================================RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============RMAN-00571: ===========================================================RMAN-03002: failure of recover command at 09/24/2014 17:34:18RMAN-06053: unable to perform media recovery because of missing logRMAN-06025: no backup of log thread 1 seq 89 lowscn 647354 found to restoreRMAN-06025: no backup of log thread 1 seq 88 lowscn 647258 found to restoreRMAN-06025: no backup of log thread 1 seq 87 lowscn 647242 found to restoreRMAN-06025: no backup of log thread 1 seq 86 lowscn 646972 found to restoreRMAN-06025: no backup of log thread 1 seq 85 lowscn 646637 found to restoreRMAN-06025: no backup of log thread 1 seq 84 lowscn 646623 found to restoreRMAN-06025: no backup of log thread 1 seq 83 lowscn 646593 found to restoreRMAN-06025: no backup of log thread 1 seq 82 lowscn 645884 found to restoreRMAN-06025: no backup of log thread 1 seq 81 lowscn 645864 found to restoreRMAN-06025: no backup of log thread 1 seq 80 lowscn 645835 found to restoreRMAN-06025: no backup of log thread 1 seq 79 lowscn 645431 found to restoreRMAN-06025: no backup of log thread 1 seq 78 lowscn 645415 found to restore
恢复失败,提示undo tablespace recover failure!
查看告警日志:
The input backup piece /backup/rman_bak/lv0_PROD_111_859046404.bak is in compressed format.Wed Sep 24 17:32:41 2014The input backup piece /backup/rman_bak/lv0_PROD_112_859046404.bak is in compressed format.Wed Sep 24 17:32:42 2014Full restore complete of datafile 4 /u01/app/oracle/oradata/prod/users01.dbf. Elapsed time: 0:00:01 checkpoint is 642397Wed Sep 24 17:32:48 2014Full restore complete of datafile 2 /u01/app/oracle/oradata/prod/undotbs01.dbf. Elapsed time: 0:00:07 checkpoint is 642399Wed Sep 24 17:33:02 2014Full restore complete of datafile 5 /u01/app/oracle/oradata/prod/example01.dbf. Elapsed time: 0:00:20 checkpoint is 642399Full restore complete of datafile 3 /u01/app/oracle/oradata/prod/sysaux01.dbf. Elapsed time: 0:00:25 checkpoint is 642399Wed Sep 24 17:33:14 2014Full restore complete of datafile 1 /u01/app/oracle/oradata/prod/system01.dbf. Elapsed time: 0:00:33 checkpoint is 642397Wed Sep 24 17:34:12 2014The input backup piece /backup/rman_bak/lvl1_PROD_118_859047306.bak is in compressed format.Wed Sep 24 17:34:12 2014The input backup piece /backup/rman_bak/lvl1_PROD_119_859047306.bak is in compressed format.Wed Sep 24 17:34:13 2014Incremental restore complete of datafile 4 /u01/app/oracle/oradata/prod/users01.dbf checkpoint is 642881Wed Sep 24 17:34:13 2014Incremental restore complete of datafile 5 /u01/app/oracle/oradata/prod/example01.dbf checkpoint is 642883Wed Sep 24 17:34:13 2014Incremental restore complete of datafile 1 /u01/app/oracle/oradata/prod/system01.dbf checkpoint is 642881Wed Sep 24 17:34:13 2014Incremental restore complete of datafile 2 /u01/app/oracle/oradata/prod/undotbs01.dbf checkpoint is 642883Wed Sep 24 17:34:14 2014The input backup piece /backup/rman_bak/lvl1_PROD_125_859048203.bak is in compressed format.Incremental restore complete of datafile 4 /u01/app/oracle/oradata/prod/users01.dbf checkpoint is 643340Wed Sep 24 17:34:14 2014Incremental restore complete of datafile 3 /u01/app/oracle/oradata/prod/sysaux01.dbf checkpoint is 642883Wed Sep 24 17:34:14 2014Incremental restore complete of datafile 1 /u01/app/oracle/oradata/prod/system01.dbf checkpoint is 643340The input backup piece /backup/rman_bak/lvl1_PROD_132_859049103.bak is in compressed format.Wed Sep 24 17:34:15 2014The input backup piece /backup/rman_bak/lvl1_PROD_126_859048203.bak is in compressed format.Wed Sep 24 17:34:15 2014Incremental restore complete of datafile 4 /u01/app/oracle/oradata/prod/users01.dbf checkpoint is 643737Wed Sep 24 17:34:15 2014Incremental restore complete of datafile 5 /u01/app/oracle/oradata/prod/example01.dbf checkpoint is 643342Wed Sep 24 17:34:15 2014Incremental restore complete of datafile 1 /u01/app/oracle/oradata/prod/system01.dbf checkpoint is 643737Wed Sep 24 17:34:15 2014Incremental restore complete of datafile 3 /u01/app/oracle/oradata/prod/sysaux01.dbf checkpoint is 643342Incremental restore complete of datafile 2 /u01/app/oracle/oradata/prod/undotbs01.dbf checkpoint is 643342Wed Sep 24 17:34:16 2014The input backup piece /backup/rman_bak/lvl1_PROD_133_859049103.bak is in compressed format.Incremental restore complete of datafile 5 /u01/app/oracle/oradata/prod/example01.dbf checkpoint is 643739Incremental restore complete of datafile 3 /u01/app/oracle/oradata/prod/sysaux01.dbf checkpoint is 643739Incremental restore complete of datafile 2 /u01/app/oracle/oradata/prod/undotbs01.dbf checkpoint is 643739Wed Sep 24 17:34:17 2014alter database recover datafile list clearWed Sep 24 17:34:17 2014Completed: alter database recover datafile list clearWed Sep 24 17:34:17 2014alter database recover datafile list 1 , 2 , 3 , 4 , 5Completed: alter database recover datafile list 1 , 2 , 3 , 4 , 5Wed Sep 24 17:34:17 2014alter database recover if needed start until cancel using backup controlfileMedia Recovery Start parallel recovery started with 3 processesORA-279 signalled during: alter database recover if needed start until cancel using backup controlfile...Wed Sep 24 17:34:18 2014alter database recover cancelSignalling error 1152 for datafile 2!ORA-1547 signalled during: alter database recover cancel...Wed Sep 24 17:34:56 2014control file header validation failure for file /backup/rman_bak/ctl1_166.bakWed Sep 24 17:35:53 2014The input backup piece /backup/rman_bak/ctl1_166.bak is in compressed format.
解决方法:
通过备份的controlfile进行恢复
RMAN> list backup of controlfile;
但是通过rman查看备份的controlfile信息时,却没有!
还好,在磁盘上找到一个控制文件的backup piece!
加载到rman metadata中:
RMAN> catalog backuppiece '/backup/rman_bak/ctl1_166.bak';
cataloged backuppiecebackup piece handle=/backup/rman_bak/ctl1_166.bak recid=191 stamp=859138553
RMAN> list backup of controlfile;
List of Backup Sets===================BS Key Type LV Size Device Type Elapsed Time Completion Time------- ---- -- ---------- ----------- ------------ ---------------162 Full 1.06M DISK 00:00:01 23-SEP-14 BP Key: 191 Status: AVAILABLE Compressed: YES Tag: TAG20140923T174510 Piece Name: /backup/rman_bak/ctl1_166.bak Control File Included: Ckp SCN: 645423 Ckp time: 23-SEP-14
查看备份信息:
RMAN> list backup of database ;
List of Backup Sets===================BS Key Type LV Size Device Type Elapsed Time Completion Time------- ---- -- ---------- ----------- ------------ ---------------107 Incr 0 36.22M DISK 00:06:19 23-SEP-14 BP Key: 107 Status: AVAILABLE Compressed: YES Tag: TAG20140923T160003 Piece Name: /backup/rman_bak/lv0_PROD_112_859046404.bak List of Datafiles in backup set 107 File LV Type Ckp SCN Ckp Time Name ---- -- ---- ---------- --------- ---- 2 0 Incr 642399 23-SEP-14 /u01/app/oracle/oradata/prod/undotbs01.dbf 3 0 Incr 642399 23-SEP-14 /u01/app/oracle/oradata/prod/sysaux01.dbf 5 0 Incr 642399 23-SEP-14 /u01/app/oracle/oradata/prod/example01.dbfBS Key Type LV Size Device Type Elapsed Time Completion Time------- ---- -- ---------- ----------- ------------ ---------------108 Incr 0 81.68M DISK 00:06:30 23-SEP-14 BP Key: 108 Status: AVAILABLE Compressed: YES Tag: TAG20140923T160003 Piece Name: /backup/rman_bak/lv0_PROD_111_859046404.bak List of Datafiles in backup set 108 File LV Type Ckp SCN Ckp Time Name ---- -- ---- ---------- --------- ---- 1 0 Incr 642397 23-SEP-14 /u01/app/oracle/oradata/prod/system01.dbf 4 0 Incr 642397 23-SEP-14 /u01/app/oracle/oradata/prod/users01.dbfBS Key Type LV Size Device Type Elapsed Time Completion Time------- ---- -- ---------- ----------- ------------ ---------------114 Incr 1 216.00K DISK 00:00:01 23-SEP-14 BP Key: 114 Status: AVAILABLE Compressed: YES Tag: TAG20140923T161506 Piece Name: /backup/rman_bak/lvl1_PROD_118_859047306.bak List of Datafiles in backup set 114 File LV Type Ckp SCN Ckp Time Name ---- -- ---- ---------- --------- ---- 1 1 Incr 642881 23-SEP-14 /u01/app/oracle/oradata/prod/system01.dbf 4 1 Incr 642881 23-SEP-14 /u01/app/oracle/oradata/prod/users01.dbfBS Key Type LV Size Device Type Elapsed Time Completion Time------- ---- -- ---------- ----------- ------------ ---------------115 Incr 1 1.09M DISK 00:00:05 23-SEP-14 BP Key: 115 Status: AVAILABLE Compressed: YES Tag: TAG20140923T161506 Piece Name: /backup/rman_bak/lvl1_PROD_119_859047306.bak List of Datafiles in backup set 115 File LV Type Ckp SCN Ckp Time Name ---- -- ---- ---------- --------- ---- 2 1 Incr 642883 23-SEP-14 /u01/app/oracle/oradata/prod/undotbs01.dbf 3 1 Incr 642883 23-SEP-14 /u01/app/oracle/oradata/prod/sysaux01.dbf 5 1 Incr 642883 23-SEP-14 /u01/app/oracle/oradata/prod/example01.dbfBS Key Type LV Size Device Type Elapsed Time Completion Time------- ---- -- ---------- ----------- ------------ ---------------121 Incr 1 168.00K DISK 00:00:01 23-SEP-14 BP Key: 121 Status: AVAILABLE Compressed: YES Tag: TAG20140923T163003 Piece Name: /backup/rman_bak/lvl1_PROD_125_859048203.bak List of Datafiles in backup set 121 File LV Type Ckp SCN Ckp Time Name ---- -- ---- ---------- --------- ---- 1 1 Incr 643340 23-SEP-14 /u01/app/oracle/oradata/prod/system01.dbf 4 1 Incr 643340 23-SEP-14 /u01/app/oracle/oradata/prod/users01.dbfBS Key Type LV Size Device Type Elapsed Time Completion Time------- ---- -- ---------- ----------- ------------ ---------------122 Incr 1 240.00K DISK 00:00:01 23-SEP-14 BP Key: 122 Status: AVAILABLE Compressed: YES Tag: TAG20140923T163003 Piece Name: /backup/rman_bak/lvl1_PROD_126_859048203.bak List of Datafiles in backup set 122 File LV Type Ckp SCN Ckp Time Name ---- -- ---- ---------- --------- ---- 2 1 Incr 643342 23-SEP-14 /u01/app/oracle/oradata/prod/undotbs01.dbf 3 1 Incr 643342 23-SEP-14 /u01/app/oracle/oradata/prod/sysaux01.dbf 5 1 Incr 643342 23-SEP-14 /u01/app/oracle/oradata/prod/example01.dbfBS Key Type LV Size Device Type Elapsed Time Completion Time------- ---- -- ---------- ----------- ------------ ---------------128 Incr 1 192.00K DISK 00:00:01 23-SEP-14 BP Key: 128 Status: AVAILABLE Compressed: YES Tag: TAG20140923T164503 Piece Name: /backup/rman_bak/lvl1_PROD_132_859049103.bak List of Datafiles in backup set 128 File LV Type Ckp SCN Ckp Time Name ---- -- ---- ---------- --------- ---- 1 1 Incr 643737 23-SEP-14 /u01/app/oracle/oradata/prod/system01.dbf 4 1 Incr 643737 23-SEP-14 /u01/app/oracle/oradata/prod/users01.dbfBS Key Type LV Size Device Type Elapsed Time Completion Time------- ---- -- ---------- ----------- ------------ ---------------129 Incr 1 240.00K DISK 00:00:01 23-SEP-14 BP Key: 129 Status: AVAILABLE Compressed: YES Tag: TAG20140923T164503 Piece Name: /backup/rman_bak/lvl1_PROD_133_859049103.bak List of Datafiles in backup set 129 File LV Type Ckp SCN Ckp Time Name ---- -- ---- ---------- --------- ---- 2 1 Incr 643739 23-SEP-14 /u01/app/oracle/oradata/prod/undotbs01.dbf 3 1 Incr 643739 23-SEP-14 /u01/app/oracle/oradata/prod/sysaux01.dbf 5 1 Incr 643739 23-SEP-14 /u01/app/oracle/oradata/prod/example01.dbfBS Key Type LV Size Device Type Elapsed Time Completion Time------- ---- -- ---------- ----------- ------------ ---------------135 Incr 0 36.26M DISK 00:01:40 23-SEP-14 BP Key: 135 Status: AVAILABLE Compressed: YES Tag: TAG20140923T170004 Piece Name: /backup/rman_bak/lv0_PROD_140_859050004.bak List of Datafiles in backup set 135 File LV Type Ckp SCN Ckp Time Name ---- -- ---- ---------- --------- ---- 2 0 Incr 644121 23-SEP-14 /u01/app/oracle/oradata/prod/undotbs01.dbf 3 0 Incr 644121 23-SEP-14 /u01/app/oracle/oradata/prod/sysaux01.dbf 5 0 Incr 644121 23-SEP-14 /u01/app/oracle/oradata/prod/example01.dbfBS Key Type LV Size Device Type Elapsed Time Completion Time------- ---- -- ---------- ----------- ------------ ---------------138 Incr 0 81.69M DISK 00:02:18 23-SEP-14 BP Key: 138 Status: AVAILABLE Compressed: YES Tag: TAG20140923T170004 Piece Name: /backup/rman_bak/lv0_PROD_139_859050004.bak List of Datafiles in backup set 138 File LV Type Ckp SCN Ckp Time Name ---- -- ---- ---------- --------- ---- 1 0 Incr 644119 23-SEP-14 /u01/app/oracle/oradata/prod/system01.dbf 4 0 Incr 644119 23-SEP-14 /u01/app/oracle/oradata/prod/users01.dbfBS Key Type LV Size Device Type Elapsed Time Completion Time------- ---- -- ---------- ----------- ------------ ---------------142 Incr 1 112.00K DISK 00:00:01 23-SEP-14 BP Key: 142 Status: AVAILABLE Compressed: YES Tag: TAG20140923T171504 Piece Name: /backup/rman_bak/lvl1_PROD_146_859050904.bak List of Datafiles in backup set 142 File LV Type Ckp SCN Ckp Time Name ---- -- ---- ---------- --------- ---- 1 1 Incr 644562 23-SEP-14 /u01/app/oracle/oradata/prod/system01.dbf 4 1 Incr 644562 23-SEP-14 /u01/app/oracle/oradata/prod/users01.dbfBS Key Type LV Size Device Type Elapsed Time Completion Time------- ---- -- ---------- ----------- ------------ ---------------143 Incr 1 1.09M DISK 00:00:02 23-SEP-14 BP Key: 143 Status: AVAILABLE Compressed: YES Tag: TAG20140923T171504 Piece Name: /backup/rman_bak/lvl1_PROD_147_859050904.bak List of Datafiles in backup set 143 File LV Type Ckp SCN Ckp Time Name ---- -- ---- ---------- --------- ---- 2 1 Incr 644564 23-SEP-14 /u01/app/oracle/oradata/prod/undotbs01.dbf 3 1 Incr 644564 23-SEP-14 /u01/app/oracle/oradata/prod/sysaux01.dbf 5 1 Incr 644564 23-SEP-14 /u01/app/oracle/oradata/prod/example01.dbfBS Key Type LV Size Device Type Elapsed Time Completion Time------- ---- -- ---------- ----------- ------------ ---------------149 Incr 1 152.00K DISK 00:00:01 23-SEP-14 BP Key: 149 Status: AVAILABLE Compressed: YES Tag: TAG20140923T173003 Piece Name: /backup/rman_bak/lvl1_PROD_153_859051804.bak List of Datafiles in backup set 149 File LV Type Ckp SCN Ckp Time Name ---- -- ---- ---------- --------- ---- 1 1 Incr 645007 23-SEP-14 /u01/app/oracle/oradata/prod/system01.dbf 4 1 Incr 645007 23-SEP-14 /u01/app/oracle/oradata/prod/users01.dbfBS Key Type LV Size Device Type Elapsed Time Completion Time------- ---- -- ---------- ----------- ------------ ---------------150 Incr 1 240.00K DISK 00:00:01 23-SEP-14 BP Key: 150 Status: AVAILABLE Compressed: YES Tag: TAG20140923T173003 Piece Name: /backup/rman_bak/lvl1_PROD_154_859051804.bak List of Datafiles in backup set 150 File LV Type Ckp SCN Ckp Time Name ---- -- ---- ---------- --------- ---- 2 1 Incr 645009 23-SEP-14 /u01/app/oracle/oradata/prod/undotbs01.dbf 3 1 Incr 645009 23-SEP-14 /u01/app/oracle/oradata/prod/sysaux01.dbf 5 1 Incr 645009 23-SEP-14 /u01/app/oracle/oradata/prod/example01.dbfBS Key Type LV Size Device Type Elapsed Time Completion Time------- ---- -- ---------- ----------- ------------ ---------------156 Incr 1 232.00K DISK 00:00:01 23-SEP-14 BP Key: 156 Status: AVAILABLE Compressed: YES Tag: TAG20140923T174503 Piece Name: /backup/rman_bak/lvl1_PROD_161_859052703.bak List of Datafiles in backup set 156 File LV Type Ckp SCN Ckp Time Name ---- -- ---- ---------- --------- ---- 2 1 Incr 645407 23-SEP-14 /u01/app/oracle/oradata/prod/undotbs01.dbf 3 1 Incr 645407 23-SEP-14 /u01/app/oracle/oradata/prod/sysaux01.dbf 5 1 Incr 645407 23-SEP-14 /u01/app/oracle/oradata/prod/example01.dbfBS Key Type LV Size Device Type Elapsed Time Completion Time------- ---- -- ---------- ----------- ------------ ---------------157 Incr 1 128.00K DISK 00:00:01 23-SEP-14 BP Key: 157 Status: AVAILABLE Compressed: YES Tag: TAG20140923T174503 Piece Name: /backup/rman_bak/lvl1_PROD_160_859052703.bak List of Datafiles in backup set 157 File LV Type Ckp SCN Ckp Time Name ---- -- ---- ---------- --------- ---- 1 1 Incr 645405 23-SEP-14 /u01/app/oracle/oradata/prod/system01.dbf 4 1 Incr 645405 23-SEP-14 /u01/app/oracle/oradata/prod/users01.dbf
控制文件的备份是在9月23日,17:45分,选择9月23日17:00的0级数据文件备份进行数据文件的转储!
转储控制文件:
RMAN> shutdown abort;Oracle instance shut downRMAN> startup nomount;connected to target database (not started)Oracle instance startedTotal System Global Area 570425344 bytesFixed Size 2022480 bytesVariable Size 184550320 bytesDatabase Buffers 377487360 bytesRedo Buffers 6365184 bytesRMAN> restore controlfile from '/backup/rman_bak/ctl1_166.bak';Starting restore at 24-SEP-14allocated channel: ORA_DISK_1channel ORA_DISK_1: sid=156 devtype=DISKallocated channel: ORA_DISK_2channel ORA_DISK_2: sid=155 devtype=DISKchannel ORA_DISK_2: skipped, autobackup already foundchannel ORA_DISK_1: restoring control filechannel ORA_DISK_1: restore complete, elapsed time: 00:00:11output filename=/u01/app/oracle/oradata/prod/control01.ctloutput filename=/disk1/prod/control02.ctloutput filename=/disk2/prod/control03.ctlFinished restore at 24-SEP-14
转储数据文件:
RMAN> alter database mount;
database mountedreleased channel: ORA_DISK_1released channel: ORA_DISK_2
RMAN> restore database from tag='TAG20140923T170004';
Starting restore at 24-SEP-14allocated channel: ORA_DISK_1channel ORA_DISK_1: sid=155 devtype=DISKallocated channel: ORA_DISK_2channel ORA_DISK_2: sid=156 devtype=DISKchannel ORA_DISK_2: starting datafile backupset restorechannel ORA_DISK_2: specifying datafile(s) to restore from backup setrestoring datafile 00001 to /u01/app/oracle/oradata/prod/system01.dbfrestoring datafile 00004 to /u01/app/oracle/oradata/prod/users01.dbfchannel ORA_DISK_2: reading from backup piece /backup/rman_bak/lv0_PROD_139_859050004.bakchannel ORA_DISK_1: starting datafile backupset restorechannel ORA_DISK_1: specifying datafile(s) to restore from backup setrestoring datafile 00002 to /u01/app/oracle/oradata/prod/undotbs01.dbfrestoring datafile 00003 to /u01/app/oracle/oradata/prod/sysaux01.dbfrestoring datafile 00005 to /u01/app/oracle/oradata/prod/example01.dbfchannel ORA_DISK_1: reading from backup piece /backup/rman_bak/lv0_PROD_140_859050004.bakchannel ORA_DISK_1: restored backup piece 1piece handle=/backup/rman_bak/lv0_PROD_140_859050004.bak tag=TAG20140923T170004channel ORA_DISK_1: restore complete, elapsed time: 00:00:35channel ORA_DISK_2: restored backup piece 1piece handle=/backup/rman_bak/lv0_PROD_139_859050004.bak tag=TAG20140923T170004channel ORA_DISK_2: restore complete, elapsed time: 00:00:35Finished restore at 24-SEP-14
查看转储后的数据文件和控制文件的checkpoint:
SQL> col name for a50SQL> r 1* select name ,checkpoint_change# from v$datafileNAME CHECKPOINT_CHANGE#-------------------------------------------------- ------------------/u01/app/oracle/oradata/prod/system01.dbf 645405/u01/app/oracle/oradata/prod/undotbs01.dbf 645407/u01/app/oracle/oradata/prod/sysaux01.dbf 645407/u01/app/oracle/oradata/prod/users01.dbf 645405/u01/app/oracle/oradata/prod/example01.dbf 645407SQL> select name ,checkpoint_change# from v$datafile_header;NAME CHECKPOINT_CHANGE#-------------------------------------------------- ------------------/u01/app/oracle/oradata/prod/system01.dbf 644119/u01/app/oracle/oradata/prod/undotbs01.dbf 644121/u01/app/oracle/oradata/prod/sysaux01.dbf 644121/u01/app/oracle/oradata/prod/users01.dbf 644119/u01/app/oracle/oradata/prod/example01.dbf 644121
对database做recover:
RMAN> recover database;
Starting recover at 24-SEP-14using channel ORA_DISK_1using channel ORA_DISK_2channel ORA_DISK_1: starting incremental datafile backupset restorechannel ORA_DISK_1: specifying datafile(s) to restore from backup setdestination for restore of datafile 00001: /u01/app/oracle/oradata/prod/system01.dbfdestination for restore of datafile 00004: /u01/app/oracle/oradata/prod/users01.dbfchannel ORA_DISK_1: reading from backup piece /backup/rman_bak/lvl1_PROD_146_859050904.bakchannel ORA_DISK_2: starting incremental datafile backupset restorechannel ORA_DISK_2: specifying datafile(s) to restore from backup setdestination for restore of datafile 00002: /u01/app/oracle/oradata/prod/undotbs01.dbfdestination for restore of datafile 00003: /u01/app/oracle/oradata/prod/sysaux01.dbfdestination for restore of datafile 00005: /u01/app/oracle/oradata/prod/example01.dbfchannel ORA_DISK_2: reading from backup piece /backup/rman_bak/lvl1_PROD_147_859050904.bakchannel ORA_DISK_1: restored backup piece 1piece handle=/backup/rman_bak/lvl1_PROD_146_859050904.bak tag=TAG20140923T171504channel ORA_DISK_1: restore complete, elapsed time: 00:00:01channel ORA_DISK_1: starting incremental datafile backupset restorechannel ORA_DISK_1: specifying datafile(s) to restore from backup setdestination for restore of datafile 00001: /u01/app/oracle/oradata/prod/system01.dbfdestination for restore of datafile 00004: /u01/app/oracle/oradata/prod/users01.dbfchannel ORA_DISK_1: reading from backup piece /backup/rman_bak/lvl1_PROD_153_859051804.bakchannel ORA_DISK_2: restored backup piece 1piece handle=/backup/rman_bak/lvl1_PROD_147_859050904.bak tag=TAG20140923T171504channel ORA_DISK_2: restore complete, elapsed time: 00:00:02channel ORA_DISK_2: starting incremental datafile backupset restorechannel ORA_DISK_2: specifying datafile(s) to restore from backup setdestination for restore of datafile 00002: /u01/app/oracle/oradata/prod/undotbs01.dbfdestination for restore of datafile 00003: /u01/app/oracle/oradata/prod/sysaux01.dbfdestination for restore of datafile 00005: /u01/app/oracle/oradata/prod/example01.dbfchannel ORA_DISK_2: reading from backup piece /backup/rman_bak/lvl1_PROD_154_859051804.bakchannel ORA_DISK_1: restored backup piece 1piece handle=/backup/rman_bak/lvl1_PROD_153_859051804.bak tag=TAG20140923T173003channel ORA_DISK_1: restore complete, elapsed time: 00:00:02channel ORA_DISK_2: restored backup piece 1piece handle=/backup/rman_bak/lvl1_PROD_154_859051804.bak tag=TAG20140923T173003channel ORA_DISK_2: restore complete, elapsed time: 00:00:02channel ORA_DISK_1: starting incremental datafile backupset restorechannel ORA_DISK_1: specifying datafile(s) to restore from backup setdestination for restore of datafile 00001: /u01/app/oracle/oradata/prod/system01.dbfdestination for restore of datafile 00004: /u01/app/oracle/oradata/prod/users01.dbfchannel ORA_DISK_1: reading from backup piece /backup/rman_bak/lvl1_PROD_160_859052703.bakchannel ORA_DISK_2: starting incremental datafile backupset restorechannel ORA_DISK_2: specifying datafile(s) to restore from backup setdestination for restore of datafile 00002: /u01/app/oracle/oradata/prod/undotbs01.dbfdestination for restore of datafile 00003: /u01/app/oracle/oradata/prod/sysaux01.dbfdestination for restore of datafile 00005: /u01/app/oracle/oradata/prod/example01.dbfchannel ORA_DISK_2: reading from backup piece /backup/rman_bak/lvl1_PROD_161_859052703.bakchannel ORA_DISK_1: restored backup piece 1piece handle=/backup/rman_bak/lvl1_PROD_160_859052703.bak tag=TAG20140923T174503channel ORA_DISK_1: restore complete, elapsed time: 00:00:01channel ORA_DISK_2: restored backup piece 1piece handle=/backup/rman_bak/lvl1_PROD_161_859052703.bak tag=TAG20140923T174503channel ORA_DISK_2: restore complete, elapsed time: 00:00:01starting media recoveryarchive log thread 1 sequence 92 is already on disk as file /disk1/prod/redo01.logarchive log thread 1 sequence 93 is already on disk as file /disk1/prod/redo02.logchannel ORA_DISK_1: starting archive log restore to default destinationchannel ORA_DISK_1: restoring archive logarchive log thread=1 sequence=77channel ORA_DISK_1: reading from backup piece /backup/rman_bak/arch2_165.bakchannel ORA_DISK_1: restored backup piece 1piece handle=/backup/rman_bak/arch2_165.bak tag=TAG20140923T174507channel ORA_DISK_1: restore complete, elapsed time: 00:00:02archive log filename=/arch/1_77_858969934.dbf thread=1 sequence=77unable to find archive logarchive log thread=1 sequence=78RMAN-00571: ===========================================================RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============RMAN-00571: ===========================================================RMAN-03002: failure of recover command at 09/24/2014 17:44:48RMAN-06054: media recovery requesting unknown log: thread 1 seq 78 lowscn 645415
recover failure,提示缺少archivelog ,做不完全恢复!
RMAN> run {2> set until sequence 78;3> recover database;4> }executing command: SET until clauseStarting recover at 24-SEP-14using channel ORA_DISK_1using channel ORA_DISK_2starting media recoverymedia recovery complete, elapsed time: 00:00:01Finished recover at 24-SEP-14
recover完成!
查看恢复后的database checkpoint:
SQL> select name ,checkpoint_change# from v$datafile;NAME CHECKPOINT_CHANGE#-------------------------------------------------- ------------------/u01/app/oracle/oradata/prod/system01.dbf 645415/u01/app/oracle/oradata/prod/undotbs01.dbf 645415/u01/app/oracle/oradata/prod/sysaux01.dbf 645415/u01/app/oracle/oradata/prod/users01.dbf 645415/u01/app/oracle/oradata/prod/example01.dbf 645415SQL> select name ,checkpoint_change# from v$datafile_header;NAME CHECKPOINT_CHANGE#-------------------------------------------------- ------------------/u01/app/oracle/oradata/prod/system01.dbf 645415/u01/app/oracle/oradata/prod/undotbs01.dbf 645415/u01/app/oracle/oradata/prod/sysaux01.dbf 645415/u01/app/oracle/oradata/prod/users01.dbf 645415/u01/app/oracle/oradata/prod/example01.dbf 645415
打开数据库:
RMAN> alter database open resetlogs;
database opened
@数据库open成功,至此,数据库恢复完成!
以上是"RMAN如何实现完全恢复错误"这篇文章的所有内容,感谢各位的阅读!相信大家都有了一定的了解,希望分享的内容对大家有所帮助,如果还想学习更多知识,欢迎关注行业资讯频道!