ORA-19909: datafile 1 belongs to an orphan incarnation 一例

来源:互联网 发布:淘宝直播间怎么进入 编辑:程序博客网 时间:2024/06/05 15:31

ORA-19909: datafile 1 belongs to an orphan incarnation

 

SQL> startup mount;

ORACLE instance started.

 

Total System Global Area 6847938560 bytes

Fixed Size                  2219808 bytes

Variable Size            3539992800 bytes

Database Buffers         3288334336 bytes

Redo Buffers               17391616 bytes

Database mounted.

 

SQL> recover database using backup controlfile;

ORA-00283: recovery session canceled due to errors

ORA-19909: datafile 1 belongs to an orphan incarnation

ORA-01110: data file 1: '/u01/app/oracle/oradata/orcl/system01.dbf'

 

 

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: 

 

在我的实验中,实验数据库是利用RMAN duplicate 生成的,猜想可能是这个原因造成的。

$ rman target /

 

Recovery Manager: Release 11.2.0.1.0 - Production on Wed Apr 13 15:33:18 2011

 

Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

 

connected to target database: ORCL (DBID=1276064171, not open)

 

RMAN> list incarnation of database;

 

 

List of Database Incarnations

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

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

2       2       ORCL     1276064171       CURRENT 979911     12-APR-11

1       1       ORCL     1276064171       ORPHAN  1094407    12-APR-11

 

RMAN> reset database to incarnation 1;

 

database reset to incarnation 1

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

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

2       2       ORCL     1276064171       PARENT  979911     12-APR-11

1       1       ORCL     1276064171       CURRENT 1094407    12-APR-11

 

RMAN> exit

 

 

Recovery Manager complete.

 

SQL> recover database using backup controlfile;  --再次执行,问题已经解决

ORA-00279: change 1181302 generated at 04/13/2011 02:13:32 needed for thread 1

ORA-00289: suggestion :

/u01/app/oracle/flash_recovery_area/ORCL/archivelog/2011_04_13/o1_mf_1_7_%u_.arc

ORA-00280: change 1181302 for thread 1 is in sequence #7

 

 

Specify log: {<RET>=suggested | filename | AUTO | CANCEL}

/u01/app/oracle/oradata/orcl/redo01.log

ORA-00283: recovery session canceled due to errors

ORA-01244: unnamed datafile(s) added to control file by media recovery

ORA-01110: data file 6: '/u01/app/oracle/oradata/orcl/app01.dbf'

 

 

ORA-01112: media recovery not started

 

SQL> col error for a18

SQL> select * from v$recover_file;

 

     FILE# ONLINE  ONLINE_ ERROR                 CHANGE# TIME

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

         6 ONLINE  ONLINE  FILE MISSING                0

 

SQL> col name for a50

SQL> select file#,name from v$datafile;

 

     FILE# NAME

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

         1 /u01/app/oracle/oradata/orcl/system01.dbf

         2 /u01/app/oracle/oradata/orcl/sysaux01.dbf

         3 /u01/app/oracle/oradata/orcl/undotbs01.dbf

         4 /u01/app/oracle/oradata/orcl/users01.dbf

         5 /u01/app/oracle/oradata/orcl/example01.dbf

         6 /u01/app/oracle/product/11.2.0/db_1/dbs/UNNAMED000

           06

 

6 rows selected.

 

SQL> alter database rename file '/u01/app/oracle/product/11.2.0/db_1/dbs/UNNAMED00006' to '/u01/app/oracle/oradata/orcl/app01.dbf';

 

Database altered.

 

SQL> select file#,name from v$datafile;

 

     FILE# NAME

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

         1 /u01/app/oracle/oradata/orcl/system01.dbf

         2 /u01/app/oracle/oradata/orcl/sysaux01.dbf

         3 /u01/app/oracle/oradata/orcl/undotbs01.dbf

         4 /u01/app/oracle/oradata/orcl/users01.dbf

         5 /u01/app/oracle/oradata/orcl/example01.dbf

         6 /u01/app/oracle/oradata/orcl/app01.dbf

 

6 rows selected.

 

SQL> recover database using backup controlfile;

ORA-00279: change 1181454 generated at 04/13/2011 02:14:58 needed for thread 1

ORA-00289: suggestion :

/u01/app/oracle/flash_recovery_area/ORCL/archivelog/2011_04_13/o1_mf_1_7_%u_.arc

ORA-00280: change 1181454 for thread 1 is in sequence #7

 

 

Specify log: {<RET>=suggested | filename | AUTO | CANCEL}

/u01/app/oracle/oradata/orcl/redo01.log

Log applied.

Media recovery complete.

SQL> alter database open resetlogs;

 

Database altered.

到此成功恢复。

 

ORA-19909 参考:

http://blog.csdn.net/leishifei/archive/2011/04/13/6320926.aspx

0 0
原创粉丝点击