ORA-19909 datafile 1 belongs to an orphan incarnation

在激活并重新切换回备用数据库后,遇到了ORA-19909错误,导致介质恢复在备用数据库上终止。解决方案是通过RMAN将备用数据库的化身重置为与主数据库匹配。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

ORA-19909 datafile 1 belongs to an orphan incarnation

Contributed by Martin

Friday, 22 May 2009

Last Updated Friday, 22 May 2009

Managed recovery aborts on a standby database. Messages in the alert log of a standby database such as:Fri May 22

08:00:32 2009

Warning: Recovery target destination is in a sibling branch

of the controlfile checkpoint. Recovery will only recover

changes to datafiles.

Datafile 1 (ckpscn 150505647373) is orphaned on incarnation#=2

MRP0: Background Media Recovery terminated with error 19909

Fri May 22 08:00:32 2009

Errors in file /u01/app/oracle/admin/prod/bdump/prod_mrp0_25696.trc:

ORA-19909: datafile 1 belongs to an orphan incarnation

ORA-01110: data file 1: '+DATA/proddr/datafile/system.322.687442153'

Fri May 22 08:00:32 2009

SUCCESS: diskgroup DATA was dismounted

Fri May 22 08:00:32 2009

Errors in file /u01/app/oracle/admin/prod/bdump/prod_mrp0_25696.trc:

ORA-19909: datafile 1 belongs to an orphan incarnation

ORA-01110: data file 1: '+DATA/proddr/datafile/system.322.687442153'

Fri May 22 08:00:32 2009

MRP0: Background Media Recovery process shutdown (prod)

Media Recovery is aborted, the database won't accept any more archived logs.

Cause & Background information

The standby database has been activated previously but since then reverted back into its standby role. Prior to the

RMAN duplicate operation the "alter system reset control_files scope=spfile sid='*';" has not been executed (i.e. the

control files have not been overwritten).

Analysis

Primary and standby have different incarnations:

Standby:[oracle ~]$ echo $ORACLE_SID

prod

[oracle ~]$ rman target /

Recovery Manager: Release 10.2.0.4.0 - Production on Fri May 22 08:31:51 2009

Copyright (c) 1982, 2007, Oracle. All rights reserved.

connected to target database: prod (DBID=3925170746, not open)

RMAN> list incarnation of database;

using target database control file instead of recovery catalog

List of Database Incarnations

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

------- ------- -------- ---------------- --- ---------- ----------

1 1 prod 3925170746 PARENT 1 12-MAR-08

2 2 prod 3925170746 PARENT 602821 08-OCT-08

3 3 prod 3925170746 ORPHAN 81184152798 30-APR-09

4 4 prod 3925170746 CURRENT 136113061223 18-MAY-09

RMAN> exit

Primary[oracle ~]$ rman target /

Recovery Manager: Release 10.2.0.4.0 - Production on Fri May 22 09:03:32 2009

Copyright (c) 1982, 2007, Oracle. All rights reserved.

connected to target database: prod (DBID=3925170746)

RMAN> list incarnation of database;

using target database control file instead of recovery catalog

List of Database Incarnations

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

------- ------- -------- ---------------- --- ---------- ----------

1 1 prod 3925170746 PARENT 1 12-MAR-08

2 2 prod 3925170746 CURRENT 602821 08-OCT-08

RMAN> exit

Recovery Manager complete.

SolutionYou need to reset the standby database's incarnation to match the primary's:

[oracle ~]$ rman target /

Recovery Manager: Release 10.2.0.4.0 - Production on Fri May 22 08:35:57 2009

Copyright (c) 1982, 2007, Oracle. All rights reserved.

connected to target database: prod (DBID=3925170746, not open)

RMAN> list incarnation of database;

using target database control file instead of recovery catalog

List of Database Incarnations

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

------- ------- -------- ---------------- --- ---------- ----------

1 1 prod 3925170746 PARENT 1 12-MAR-08

2 2 prod 3925170746 PARENT 602821 08-OCT-08

3 3 prod 3925170746 ORPHAN 81184152798 30-APR-09

4 4 prod 3925170746 CURRENT 136113061223 18-MAY-09

RMAN> reset database to incarnation 2;

database reset to incarnation 2

RMAN> exit

Recovery Manager complete.

Now, apply a few logs the old fashioned way:

[oracle ~]$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.4.0 - Production on Fri May 22 08:36:26 2009

Copyright (c) 1982, 2007, Oracle. All Rights Reserved.

Connected to:

Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> recover standby database

...

When satisfied that this works (compare the alert log) after 3-4 archived logs, re-enable managed recovery. Switch logs

on the primary and make sure they get applied on the standby.ReferenceMetalink Note 554358.1 - MRP Recovery Failed

With ORA-19909

 

<think>好的,用户遇到了ORA-19723错误,需要重新创建插入的只读数据文件5。首先,我得回忆一下这个错误的具体原因。根据Oracle文档,ORA-19723通常发生在尝试重新创建只读数据文件时,特别是当数据文件被插入(pluggedin)的情况下。可能的原因包括数据文件处于只读状态、文件头信息不一致,或者文件属于只读表空间。接下来,我需要分步骤考虑解决方案。首先,检查数据文件的状态和表空间属性。用户可能需要将表空间设置为读写模式,或者更新文件头信息。然后,处理SCN(系统变更号)问题,因为只读文件可能SCN过低,导致无法正确打开。这可能需要使用恢复命令来调整SCN。如果这些步骤无效,可能需要使用备份恢复数据文件,或者手动重建数据文件。另外,用户可能需要确认数据文件的来源是否兼容当前数据库版本,避免跨版本问题。预防措施方面,建议在操作前备份,避免直接插入只读文件,而是先改为读写模式再插入。需要注意的细节包括:确保在修改表空间状态时数据库处于打开或挂载状态,具体取决于操作类型;使用RECOVER DATAFILE命令时的正确语法;以及在重建数据文件后验证其状态。同时,引用相关文档或案例作为参考,比如提到的ORA-00600[25012]可能与LOB操作相关,但这里主要关注ORA-19723的处理。最后,生成相关问题时要围绕ORA错误的解决、只读文件管理、表空间维护和备份策略等方面,帮助用户全面了解可能涉及的后续问题。</think>### ORA-19723错误解决方案 #### 错误分析 ORA-19723错误表示无法重新创建已插入的只读数据文件。常见原因包括: 1. 数据文件处于只读模式且表空间未被正确修改 2. 文件头SCN(系统变更号)与当前数据库不一致 3. 跨平台迁移时未正确处理字节顺序[^1] #### 解决步骤 1. **检查数据文件状态** ```sql SELECT file#, name, status FROM v$datafile WHERE file# = 5; ``` 确认数据文件5的当前状态是否为`READ ONLY` 2. **修改表空间模式** ```sql ALTER TABLESPACE <tablespace_name> READ WRITE; ``` 如果表空间原本为只读模式,需先改为读写模式 3. **更新文件头信息** ```sql ALTER DATABASE CREATE DATAFILE '<datafile_path>' AS '<new_datafile_path>'; ``` 重建数据文件头信息时需指定完整路径 4. **处理SCN不一致** ```sql RECOVER DATAFILE 5; ``` 使用恢复命令同步SCN值,可能需要应用归档日志 5. **验证文件状态** ```sql ALTER DATABASE DATAFILE '<datafile_path>' ONLINE; ``` 重建完成后将文件联机 #### 注意事项 - 如果数据文件来自其他数据库,需确保使用`TRANSPORT_TABLESPACE`正确导入 -12c及以上版本中,建议使用`DBMS_FILE_TRANSFER`处理跨平台文件传输 - 操作前必须备份当前数据库状态,避免数据丢失[^1]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值