databaseoracle-databasedataguard

Incarnation error in Oracle dataguard standby


I'm migrating production databases to new servers.

-S027 is Primary in server 00a.

-S029 is DG secondary in server 00b.

I took a backup from both the databases and restored them in target server as the first step. The migration is scheduled for next week, which means the source DBs are still live. Now what happened is , When I restored the primary to the new server yesterday, it also tried shipping logs to the source standby, since I have not changed the connection parameters. Now the standby is having incarnation error.

Managed Standby Recovery starting Real Time Apply

Warning: Recovery target destination is in a sibling branch

of the controlfile checkpoint. Recovery will only recover

changes to datafiles.

Datafile 1 (ckpscn 12523547998407) is orphaned on incarnation#=1

MRP0: Detected orphaned datafiles!

Recovery will possibly be retried after flashback...

Tue Apr 02 02:01:11 2019

Errors in file /c00_STBY/u001/app/oracle/diag/rdbms/dg_S029/S029/trace/S029_pr00_42265.trc:

ORA-19909: datafile 1 belongs to an orphan incarnation

ORA-01110: data file 1: '/c00_STBY/u001/oradata/S029/system01.dbf'

Managed Standby Recovery not using Real Time Apply

Tue Apr 02 02:01:11 2019

Recovery Slave PR00 previously exited with exception 19909

Tue Apr 02 02:01:11 2019

Errors in file /c00_STBY/u001/app/oracle/diag/rdbms/dg_S029/S029/trace/S029_mrp0_42232.trc:

ORA-19909: datafile 1 belongs to an orphan incarnation

ORA-01110: data file 1: '/c00_STBY/u001/oradata/S029/system01.dbf'

Tue Apr 02 02:01:31 2019```

Solution

  • I have a very similar problem some time back (year+ ago). I made a copy of the primary side and did a resetlogs, however I didn't change the fal_target/client and dg settings (and didn't run NID to change the DBID) so two primaries were shipping to the standby. I believe the only action to take here is to rebuild the standby again from the appropriate backup (ensure the dg parameters in the new primary don't point to the old standby before you start it up or you'll be back where you are right now).

    :(

    -Jim