11.2.0.4 rman restore&recover 基于时间点恢复 ORA-19909

rman基于时间点的备份恢复,使用如下run block:

run{
allocate channel t1 device type disk;
allocate channel t2 device type disk;
allocate channel t3 device type disk;
set until time "to_date('2016-05-31 12:00:00','yyyy-mm-dd hh24:mi:ss')";
restore database;
recover database;
}

报错,信息类似如下(原版已经找不到)

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

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

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

RMAN-03002: failure of recover command at 06/03/2016 00:33:16

ORA-00283: recovery session canceled due to errors

RMAN-11003: failure during parse/execution of SQL statement: alter database rec

ver if needed

 start until time 'MAY 31 2016 12:00:00' using backup controlfile

ORA-00283: recovery session canceled due to errors

ORA-19909: datafile 2 belongs to an orphan incarnation

ORA-01110: data file 2: 'D:\ORADATA\CIMSDB\UNDOTBS01.DBF'  



后查看alert日志,发现如下恢复信息:

Thu Jun 02 23:17:03 2016
backup piece header validation failure for handle E:\ORA_BACKUP\CONTROLFILE\C-3053525504-20160528-02
backup piece header validation failure for handle E:\ORA_BACKUP\CONTROLFILE\C-3053525504-20160529-00
Thu Jun 02 23:23:26 2016
The input backup piece E:\ORA_BACKUP\DB\DB_BCK_CIMSDB_11299_913086248_1 is in compressed format.
Thu Jun 02 23:23:26 2016
The input backup piece E:\ORA_BACKUP\DB\DB_BCK_CIMSDB_11300_913088147_1 is in compressed format.
Thu Jun 02 23:23:26 2016
The input backup piece E:\ORA_BACKUP\DB\DB_BCK_CIMSDB_11301_913090267_1 is in compressed format.
Thu Jun 02 23:23:39 2016
Full restore complete of datafile 11 D:\ORADATA\CIMSDB\AUDIT_IDX01.DBF.  Elapsed time: 0:00:12 
  checkpoint is 94693691345
  last deallocation scn is 74484582354
Thu Jun 02 23:23:46 2016
Full restore complete of datafile 21 D:\ORADATA\CIMSDB\USERS03.DBF.  Elapsed time: 0:00:19 
  checkpoint is 94693937601
  last deallocation scn is 91013128418
Full restore complete of datafile 6 D:\ORADATA\CIMSDB\USERS01.DBF.  Elapsed time: 0:00:22 
  checkpoint is 94693937601
  last deallocation scn is 91013128559
Full restore complete of datafile 4 D:\ORADATA\CIMSDB\DMS01.DBF.  Elapsed time: 0:00:01 
  checkpoint is 94693937601
  last deallocation scn is 32308768
Full restore complete of datafile 8 D:\ORADATA\CIMSDB\USERS02.DBF.  Elapsed time: 0:00:06 
  checkpoint is 94693937601
  last deallocation scn is 91013128533
Thu Jun 02 23:24:10 2016
Full restore complete of datafile 10 D:\ORADATA\CIMSDB\AUDIT_TBS01.DBF.  Elapsed time: 0:00:43 
  checkpoint is 94693473145
Full restore complete of datafile 5 D:\ORADATA\CIMSDB\DMSINDEX01.DBF.  Elapsed time: 0:00:00 
  checkpoint is 94693473145
Thu Jun 02 23:27:50 2016
Full restore complete of datafile 3 D:\ORADATA\CIMSDB\SYSAUX01.DBF.  Elapsed time: 0:04:23 
  checkpoint is 94693691345
  last deallocation scn is 94685125506
Thu Jun 02 23:29:09 2016
Full restore complete of datafile 1 D:\ORADATA\CIMSDB\SYSTEM01.DBF.  Elapsed time: 0:05:43 
  checkpoint is 94693473145
  last deallocation scn is 87725466902
Thu Jun 02 23:43:27 2016
Full restore complete of datafile 17 D:\ORADATA\CIMSDB\UNDOTBS02.DBF.  Elapsed time: 0:20:00 
  checkpoint is 94693473145
  last deallocation scn is 94693415190
Thu Jun 02 23:50:30 2016
Full restore complete of datafile 20 D:\ORADATA\CIMSDB\NOVODATA04.DBF.  Elapsed time: 0:27:03 
  checkpoint is 94693473145
  last deallocation scn is 94686954964
Thu Jun 02 23:56:20 2016
Full restore complete of datafile 22 D:\ORADATA\CIMSDB\NOVODATA05.DBF.  Elapsed time: 0:32:53 
  checkpoint is 94693691345
  last deallocation scn is 94686954968
Thu Jun 02 23:59:09 2016
Full restore complete of datafile 12 D:\ORADATA\CIMSDB\NOVOBIDATA01.DBF.  Elapsed time: 0:35:43 
  checkpoint is 94693473145
  last deallocation scn is 94693473608
Fri Jun 03 00:06:43 2016
Full restore complete of datafile 19 D:\ORADATA\CIMSDB\USERSINDEX04.DBF.  Elapsed time: 0:43:16 
  checkpoint is 94693691345
  last deallocation scn is 94686964684
Fri Jun 03 00:10:50 2016
Full restore complete of datafile 25 D:\ORADATA\CIMSDB\NOVODATA06.DBF.  Elapsed time: 0:47:24 
  checkpoint is 94693473145
  last deallocation scn is 94686954964
Fri Jun 03 00:11:26 2016
Full restore complete of datafile 15 D:\ORADATA\CIMSDB\USERSINDEX02.DBF.  Elapsed time: 0:47:59 
  checkpoint is 94693691345
  last deallocation scn is 94686964684
Fri Jun 03 00:14:18 2016
Full restore complete of datafile 26 D:\ORADATA\CIMSDB\UNDOTBS03.DBF.  Elapsed time: 0:50:51 
  checkpoint is 94693691345
  last deallocation scn is 94693631233
Fri Jun 03 00:17:02 2016
Full restore complete of datafile 13 D:\ORADATA\CIMSDB\NOVOBIINDEX01.DBF.  Elapsed time: 0:53:36 
  checkpoint is 94693473145
  last deallocation scn is 94693473364
Fri Jun 03 00:24:49 2016
Full restore complete of datafile 7 D:\ORADATA\CIMSDB\USERSINDEX01.DBF.  Elapsed time: 1:01:23 
  checkpoint is 94693691345
  last deallocation scn is 94686964687
Fri Jun 03 00:26:44 2016
Full restore complete of datafile 23 D:\ORADATA\CIMSDB\NOVOARCDATA01.DBF.  Elapsed time: 1:03:18 
  checkpoint is 94693473145
  last deallocation scn is 94686968055
Fri Jun 03 00:29:39 2016
Full restore complete of datafile 16 D:\ORADATA\CIMSDB\NOVODATA03.DBF.  Elapsed time: 1:06:12 
  checkpoint is 94693691345
  last deallocation scn is 94686954964
Fri Jun 03 00:30:18 2016
Full restore complete of datafile 24 D:\ORADATA\CIMSDB\NOVOARCDATA02.DBF.  Elapsed time: 1:06:52 
  checkpoint is 94693937601
  last deallocation scn is 94686968058
Fri Jun 03 00:33:16 2016
alter database recover datafile list clear
Fri Jun 03 00:33:16 2016
Completed: alter database recover datafile list clear
Fri Jun 03 00:33:16 2016
alter database recover datafile list
 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 , 12 , 13 , 14 , 15 , 16 , 17 , 18 , 19 , 20


Completed: alter database recover datafile list
 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 , 12 , 13 , 14 , 15 , 16 , 17 , 18 , 19 , 20
Fri Jun 03 00:33:16 2016
alter database recover datafile list
 21 , 22 , 23 , 24 , 25 , 26 , 27


Completed: alter database recover datafile list
 21 , 22 , 23 , 24 , 25 , 26 , 27
Fri Jun 03 00:33:16 2016
alter database recover if needed
 start until time 'MAY 31 2016 12:00:00' using backup controlfile


Media Recovery Start
Fri Jun 03 00:33:16 2016
Media Recovery failed with error 19909
ORA-283 signalled during: alter database recover if needed
 start until time 'MAY 31 2016 12:00:00' using backup controlfile
...
Fri Jun 03 09:45:13 2016
alter database recover datafile list clear
Fri Jun 03 09:45:13 2016
Completed: alter database recover datafile list clear
Fri Jun 03 09:45:13 2016
alter database recover datafile list
 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 , 12 , 13 , 14 , 15 , 16 , 17 , 18 , 19 , 20


Completed: alter database recover datafile list
 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 , 12 , 13 , 14 , 15 , 16 , 17 , 18 , 19 , 20
Fri Jun 03 09:45:13 2016
alter database recover datafile list
 21 , 22 , 23 , 24 , 25 , 26 , 27


Completed: alter database recover datafile list
 21 , 22 , 23 , 24 , 25 , 26 , 27
Fri Jun 03 09:45:13 2016
alter database recover if needed
 start until time 'MAY 31 2016 12:00:00' using backup controlfile


Media Recovery Start
Fri Jun 03 09:45:13 2016
Media Recovery failed with error 19909
ORA-283 signalled during: alter database recover if needed
 start until time 'MAY 31 2016 12:00:00' using backup controlfile
...
Fri Jun 03 09:47:02 2016
alter database datafile 2 offline
Fri Jun 03 09:47:02 2016
Completed: alter database datafile 2 offline
Fri Jun 03 09:51:48 2016
alter database recover datafile list clear
Fri Jun 03 09:51:48 2016
Completed: alter database recover datafile list clear
Fri Jun 03 09:51:48 2016
alter database recover datafile list
 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 , 12 , 13 , 14 , 15 , 16 , 17 , 18 , 19 , 20


Completed: alter database recover datafile list
 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 , 12 , 13 , 14 , 15 , 16 , 17 , 18 , 19 , 20
Fri Jun 03 09:51:48 2016
alter database recover datafile list
 21 , 22 , 23 , 24 , 25 , 26 , 27


Completed: alter database recover datafile list
 21 , 22 , 23 , 24 , 25 , 26 , 27
Fri Jun 03 09:51:48 2016
alter database recover if needed
 start until time 'MAY 31 2016 12:00:00' using backup controlfile


Media Recovery Start
Fri Jun 03 09:51:48 2016
Media Recovery failed with error 19909
ORA-283 signalled during: alter database recover if needed
 start until time 'MAY 31 2016 12:00:00' using backup controlfile
...
Fri Jun 03 10:12:57 2016
The input backup piece E:\ORA_BACKUP\ARC\ARC_BCK_CIMSDB_11262_913021209_1 is in compressed format.
New incarnation branch detected in Backup, filename E:\ORA_BACKUP\ARC\ARC_BCK_CIMSDB_11262_913021209_1
Inspection of file changed rdi from 2 to 3
Setting recovery target incarnation to 3
Fri Jun 03 10:12:58 2016
Setting recovery target incarnation to 3
Fri Jun 03 10:12:58 2016
The input backup piece E:\ORA_BACKUP\ARC\ARC_BCK_CIMSDB_11264_913050006_1 is in compressed format.
The input backup piece E:\ORA_BACKUP\ARC\ARC_BCK_CIMSDB_11266_913078812_1 is in compressed format.
The input backup piece E:\ORA_BACKUP\ARC\ARC_BCK_CIMSDB_11268_913107609_1 is in compressed format.
The input backup piece E:\ORA_BACKUP\ARC\ARC_BCK_CIMSDB_11269_913108498_1 is in compressed format.
The input backup piece E:\ORA_BACKUP\ARC\ARC_BCK_CIMSDB_11270_913109287_1 is in compressed format.
The input backup piece E:\ORA_BACKUP\ARC\ARC_BCK_CIMSDB_11272_913136405_1 is in compressed format.
The input backup piece E:\ORA_BACKUP\ARC\ARC_BCK_CIMSDB_11274_913165340_1 is in compressed format.
The input backup piece E:\ORA_BACKUP\ARC\ARC_BCK_CIMSDB_11276_913194010_1 is in compressed format.
The input backup piece E:\ORA_BACKUP\ARC\ARC_BCK_CIMSDB_11277_913194889_1 is in compressed format.
The input backup piece E:\ORA_BACKUP\ARC\ARC_BCK_CIMSDB_11278_913195677_1 is in compressed format.
The input backup piece E:\ORA_BACKUP\ARC\ARC_BCK_CIMSDB_11280_913222806_1 is in compressed format.
The input backup piece E:\ORA_BACKUP\ARC\ARC_BCK_CIMSDB_11282_913251673_1 is in compressed format.
The input backup piece E:\ORA_BACKUP\ARC\ARC_BCK_CIMSDB_11286_912992411_1 is in compressed format.
The input backup piece E:\ORA_BACKUP\ARC\ARC_BCK_CIMSDB_11287_912993290_1 is in compressed format.
The input backup piece E:\ORA_BACKUP\ARC\ARC_BCK_CIMSDB_11288_912994159_1 is in compressed format.
The input backup piece E:\ORA_BACKUP\ARC\ARC_BCK_CIMSDB_11290_913021209_1 is in compressed format.
The input backup piece E:\ORA_BACKUP\ARC\ARC_BCK_CIMSDB_11291_913280406_1 is in compressed format.
The input backup piece E:\ORA_BACKUP\ARC\ARC_BCK_CIMSDB_11292_913050005_1 is in compressed format.
The input backup piece E:\ORA_BACKUP\ARC\ARC_BCK_CIMSDB_11293_913309206_1 is in compressed format.
The input backup piece E:\ORA_BACKUP\ARC\ARC_BCK_CIMSDB_11294_913078810_1 is in compressed format.
The input backup piece E:\ORA_BACKUP\ARC\ARC_BCK_CIMSDB_11295_913079770_1 is in compressed format.
The input backup piece E:\ORA_BACKUP\ARC\ARC_BCK_CIMSDB_11295_913338061_1 is in compressed format.
The input backup piece E:\ORA_BACKUP\ARC\ARC_BCK_CIMSDB_11296_913080759_1 is in compressed format.
The input backup piece E:\ORA_BACKUP\ARC\ARC_BCK_CIMSDB_11297_913366809_1 is in compressed format.
The input backup piece E:\ORA_BACKUP\ARC\ARC_BCK_CIMSDB_11298_913367698_1 is in compressed format.
The input backup piece E:\ORA_BACKUP\ARC\ARC_BCK_CIMSDB_11299_913368497_1 is in compressed format.
The input backup piece E:\ORA_BACKUP\ARC\ARC_BCK_CIMSDB_11301_913395606_1 is in compressed format.
The input backup piece E:\ORA_BACKUP\ARC\ARC_BCK_CIMSDB_11303_913425117_1 is in compressed format.
The input backup piece E:\ORA_BACKUP\ARC\ARC_BCK_CIMSDB_11304_913107609_1 is in compressed format.
The input backup piece E:\ORA_BACKUP\ARC\ARC_BCK_CIMSDB_11305_913453209_1 is in compressed format.
The input backup piece E:\ORA_BACKUP\ARC\ARC_BCK_CIMSDB_11306_913136407_1 is in compressed format.
The input backup piece E:\ORA_BACKUP\ARC\ARC_BCK_CIMSDB_11306_913454078_1 is in compressed format.
The input backup piece E:\ORA_BACKUP\ARC\ARC_BCK_CIMSDB_11307_913454866_1 is in compressed format.
The input backup piece E:\ORA_BACKUP\ARC\ARC_BCK_CIMSDB_11308_913165219_1 is in compressed format.
The input backup piece E:\ORA_BACKUP\ARC\ARC_BCK_CIMSDB_11309_913166038_1 is in compressed format.
The input backup piece E:\ORA_BACKUP\ARC\ARC_BCK_CIMSDB_11310_913166838_1 is in compressed format.
The input backup piece E:\ORA_BACKUP\ARC\ARC_BCK_CIMSDB_11312_913194007_1 is in compressed format.
The input backup piece E:\ORA_BACKUP\ARC\ARC_BCK_CIMSDB_11314_913222808_1 is in compressed format.
The input backup piece E:\ORA_BACKUP\ARC\ARC_BCK_CIMSDB_11316_913251610_1 is in compressed format.
The input backup piece E:\ORA_BACKUP\ARC\KEEP ONE MONTH\ARC_BCK_CIMSDB_9848_890096473_1 is in compressed format.
New incarnation branch detected in Backup, filename E:\ORA_BACKUP\ARC\KEEP ONE MONTH\ARC_BCK_CIMSDB_9848_890096473_1
The input backup piece E:\ORA_BACKUP\ARC\KEEP ONE MONTH\ARC_BCK_CIMSDB_9849_890096681_1 is in compressed format.
The input backup piece E:\ORA_BACKUP\ARC\KEEP ONE MONTH\ARC_BCK_CIMSDB_9850_890096882_1 is in compressed format.
The input backup piece E:\ORA_BACKUP\ARC\KEEP ONE MONTH\ARC_BCK_CIMSDB_9852_890125212_1 is in compressed format.
The input backup piece E:\ORA_BACKUP\ARC\KEEP ONE MONTH\ARC_BCK_CIMSDB_9853_890125411_1 is in compressed format.
The input backup piece E:\ORA_BACKUP\ARC\KEEP ONE MONTH\ARC_BCK_CIMSDB_9854_890125609_1 is in compressed format.
The input backup piece E:\ORA_BACKUP\ARC\KEEP ONE MONTH\ARC_BCK_CIMSDB_9855_890125828_1 is in compressed format.
The input backup piece E:\ORA_BACKUP\ARC\KEEP ONE MONTH\ARC_BCK_CIMSDB_9856_890126057_1 is in compressed format.
The input backup piece E:\ORA_BACKUP\ARC\KEEP ONE MONTH\ARC_BCK_CIMSDB_9857_890126276_1 is in compressed format.
The input backup piece E:\ORA_BACKUP\ARC\KEEP ONE MONTH\ARC_BCK_CIMSDB_9858_890126495_1 is in compressed format.
The input backup piece E:\ORA_BACKUP\ARC\KEEP ONE MONTH\ARC_BCK_CIMSDB_9859_890126714_1 is in compressed format.
The input backup piece E:\ORA_BACKUP\ARC\KEEP ONE MONTH\ARC_BCK_CIMSDB_9861_890154007_1 is in compressed format.
Fri Jun 03 10:17:15 2016
alter database recover datafile list clear
Fri Jun 03 10:17:15 2016
Completed: alter database recover datafile list clear
Fri Jun 03 10:17:15 2016
alter database recover datafile list
 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 , 12 , 13 , 14 , 15 , 16 , 17 , 18 , 19 , 20


Completed: alter database recover datafile list
 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 , 12 , 13 , 14 , 15 , 16 , 17 , 18 , 19 , 20
Fri Jun 03 10:17:15 2016
alter database recover datafile list
 21 , 22 , 23 , 24 , 25 , 26 , 27


Completed: alter database recover datafile list
 21 , 22 , 23 , 24 , 25 , 26 , 27
Fri Jun 03 10:17:15 2016
alter database recover if needed
 start until time 'MAY 31 2016 12:00:00' using backup controlfile


Media Recovery Start
Warning: Recovery target destination is in a sibling branch
of the controlfile checkpoint. Recovery will only recover
changes to datafiles.
Datafile 1 (ckpscn 94693473145) is orphaned on incarnation#=2
Fri Jun 03 10:17:15 2016
Media Recovery failed with error 19909
ORA-283 signalled during: alter database recover if needed
 start until time 'MAY 31 2016 12:00:00' using backup controlfile
...


报错原因:  不知道什么原因,总共27个数据文件,仅仅restore了22个。 还有5个数据文件没有恢复。 致使在recover的时候发现数据文件的incarnation不一致。

解决方式:
重新使用rman命令restore&recover。 分步操作,命令如下:

run {
allocate channel t1 device type disk;
allocate channel t2 device type disk;
allocate channel t3 device type disk;
restore  database until time "to_date('2016-05-31 12:00:00','yyyy-mm-dd hh24:mi:ss')";
}

run {
allocate channel t1 device type disk;
allocate channel t2 device type disk;
allocate channel t3 device type disk;
allocate channel t4 device type disk;
recover database until time "to_date('2016-05-31 12:00:00','yyyy-mm-dd hh24:mi:ss')";
}

recover成功之后 
alter database open resetlogs;


备注: recover的时候一定要注意归档空间的使用情况,rman将备份集中的归档日志先解压缩到数据库归档备份目录然后再进行recover。 

补充:  可以将RMAN的备份集注册到控制文件(或者目录数据库中), 类似的一系列命令有:
CATALOG ARCHIVELOG '?/oradata/archive1_30.dbf', '?/oradata/archive1_31.dbf', '?/oradata/archive1_32.dbf';

CATALOG DATAFILECOPY '?/oradata/users01.bak' LEVEL 0;

CATALOG START WITH '/tmp/arch_logs';

CATALOG RECOVERY AREA NOPROMPT;

CATALOG BACKUPPIECE '?/oradata/01dmsbj4_1_1.bcp';

参考文档:

使用Catalog命令注册RMAN备份集

http://www.eygle.com/archives/2008/06/10g_catalog_rman.html








来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/11780477/viewspace-2114209/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/11780477/viewspace-2114209/

你可能感兴趣的:(数据库)