reset database to incarnation 过多的archivelog 导致incarnation 改变

Summary

  • Attempting to restore a database/datafile using the following backup (BackupSet Key# 3):

RMAN> list backup of database;

using target database control file instead of recovery catalog

List of Backup Sets

===================

BS Key Type LV Size Device Type Elapsed Time Completion Time


3 Full 347.09M DISK 00:00:41 07-SEP-2007 19:38:55

BP Key: 3 Status: AVAILABLE Compressed: NO Tag: TAG20070907T193814

Piece Name: D:\ORACLE\ORADATA\BACKUP\03IRC6P6_1_1

List of Datafiles in backup set 3

File LV Type Ckp SCN Ckp Time Name


1 Full 360352 07-SEP-2007 19:38:14 D:\ORACLE\ORADATA\(dbname)\SYSTEM01.DBF

2 Full 360352 07-SEP-2007 19:38:14 D:\ORACLE\ORADATA\(dbname)\UNDOTBS01.DBF

3 Full 360352 07-SEP-2007 19:38:14 D:\ORACLE\ORADATA\(dbname)\SYSAUX01.DBF

  • However the restore fails with following error:

RMAN> restore datafile 1;

Starting restore at 07-SEP-2007 20:38:21

allocated channel: ORA_DISK_1

channel ORA_DISK_1: sid=46 devtype=DISK

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

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

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

RMAN-03002: failure of restore command at 09/07/2007 20:38:22

RMAN-06026: some targets not found - aborting restore

RMAN-06023: no backup or copy of datafile 1 found to restore

OR, with following errors when looking for other backups:

(In case other previous backups exist for this database but we are interested in restoring from the latest backup with BackupSet Key# 3)

ORA-19870: error reading backup piece D:\ORACLE\ORADATA\BACKUP\01IRC6C4_1_1

ORA-19505: failed to identify file "D:\ORACLE\ORADATA\BACKUP\01IRC6C4_1_1"

ORA-27041: unable to open file

OSD-04002: unable to open file

OR

RMAN-06026: some targets not found - aborting restore

RMAN-06100: no channel to restore a backup or copy of datafile 1

Or, with below errors after no backup is found and RMAN tries to create the datafile:

creating datafile fno=1 name=+DATA/<dbname>/datafile/system.288.585590761

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

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

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

RMAN-03002: failure of restore command at 03/21/2006 21:41:34

ORA-01180: can not create datafile 1

ORA-01110: data file 1: '+DATA/<dbname>/datafile/system.288.585590761'

  • We have verified that the backupset 3 is available and accessible:

RMAN> crosscheck backupset 3;

using channel ORA_DISK_1

crosschecked backup piece: found to be 'AVAILABLE'

backup piece handle=D:\ORACLE\ORADATA\BACKUP\03IRC6P6_1_1 recid=3 stamp=632691494

Crosschecked 1 objects

  • Also the backup exists on DISK and the allocated default channel is of type DISK so there is no mismatch of allocated and required channel type.

  • The checkpoint SCN of datafile 1 in backupset 3 i.e. 360352, seems to belong to the current incarnation (Reset SCN=360002) so there is no mismatch in the incarnation as well:

RMAN> list incarnation of database;

List of Database Incarnations

DB Key Inc Key DB Name DB ID STATUS Reset SCN Reset Time


1 1 (dbname) 3944965565 PARENT 289857 19-AUG-2007 22:31:27

2 2 (dbname) 3944965565 CURRENT 360002 07-SEP-2007 19:44:56

Solution

Restore a control file from the previous incarnation in which the changes represented in the orphan backup has not been abandoned

OR

Reset the database incarnation in current controlfile to the previous one and perform the restore:

RMAN> list incarnation of database;

List of Database Incarnations

DB Key Inc Key DB Name DB ID STATUS Reset SCN Reset Time


1 1 (dbname) 3944965565 PARENT 289857 19-AUG-2007 22:31:27

2 2 (dbname) 3944965565 CURRENT 360002 07-SEP-2007 19:44:56

RMAN> reset database to incarnation 1;

database reset to incarnation 1

RMAN> restore datafile 1;

Starting restore at 07-SEP-2007 21:23:55

allocated channel: ORA_DISK_1

channel ORA_DISK_1: sid=46 devtype=DISK

channel ORA_DISK_1: starting datafile backupset restore

channel ORA_DISK_1: specifying datafile(s) to restore from backup set

restoring datafile 00001 to D:\ORACLE\ORADATA\(dbname)\SYSTEM01.DBF

channel ORA_DISK_1: reading from backup piece D:\ORACLE\ORADATA\BACKUP\03IRC6P6_1_1

channel ORA_DISK_1: restored backup piece 1

piece handle=D:\ORACLE\ORADATA\BACKUP\03IRC6P6_1_1 tag=TAG20070907T193814

channel ORA_DISK_1: restore complete, elapsed time: 00:00:36

Finished restore at 07-SEP-2007 21:24:32


Attachments :

Cause

Run the restore session with debug enabled by using:

C:\>rman target / log=rmanLog.txt trace=rmanTrace.txt

RMAN> debug on;

RMAN> restore datafile 1;

RMAN> debug off;

RMAN> exit;

rmanLog.txt

===========

RMAN-03090: Starting restore at 07-SEP-2007 21:07:14

RMAN-06009: using target database control file instead of recovery catalog

RMAN-08030: allocated channel: ORA_DISK_1

RMAN-08500: channel ORA_DISK_1: sid=49 devtype=DISK

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

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

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

RMAN-03002: failure of restore command at 09/07/2007 21:08:34

RMAN-06026: some targets not found - aborting restore

RMAN-06023: no backup or copy of datafile 1 found to restore

Search the debug trace file for Checkpoint SCN: "360352" of datafile #1 in backupset #3 and/or

search for "orphan branch":

rmanTrace.txt

=============

...

DBGRCVMAN: CheckRecAction called 08/19/07 22:31:27; rlgscn=289857

DBGRCVMAN: CheckRecAction: inc=1,toscn=360352exceeds 360002

DBGRCVMAN: CheckRecAction:belongs to orphan branch of this incarnation:

The debug trace reveals that the backupset 3 belongs to an ORPHAN branch of previous incarnation. Please refer the documentation for more information on Orphan backups and incarnations:

Oracle Database Backup and Recovery Basics 10g Release 2 (10.2)
7.6.2.3 Database Incarnations and Orphaned Backups

This problem usually occurs when restoring on a new instance with FRA configured. When restoring database using a backup controlfile, RMAN automatically catalogs all archives inside the FRA. If there are left over archives, they can add incarnation branches to the restored controlfile causing this issue.

If this is the case, you may consider cleaning up the FRA before starting restore/recover process.

相关推荐
spider_xcxc12 小时前
Redis 数据库高质量实践指南(一)
运维·数据库·redis·oracle·云计算
落叶-IT14 小时前
Java异常处理深度实战教程:异常传播的失败场景分析
数据库·oracle
水木流年追梦20 小时前
agent面试必备31- AI Agent 核心进阶:工具路由(Tool Routing)
数据库·人工智能·oracle·面试·职场和发展·embedding
weixin_397574091 天前
框架v5多数据源让AI查遍企业数据
数据库·人工智能·oracle
澈2072 天前
【无标题】QT入门第十二天:数据库编程(下)模型视图与数据展示 | 零基础学QT
数据库·qt·oracle
在路上~~~~2 天前
EBS 启用系统标准的debug
运维·oracle
落叶-IT2 天前
Java异常处理深度实战教程:彻底掌握异常传播机制,规避线上隐性故障
java·数据库·oracle
杨运交3 天前
[042][数据模块]Mybatis Plus 数据库级租户:基于多数据源路由的动态隔离实现
数据库·oracle·mybatis
ClouGence12 天前
Oracle 数据同步为什么会出现数据不一致?长事务是常被忽略的原因
数据库·后端·oracle
ClouGence18 天前
Oracle CDC 架构优化:从主库直连到 DataGuard 备库同步
数据库·后端·oracle