ORA-19909: datafile 1 belongs to an orphan incarnation
Error: On starting the MRP service on the standby database, it does not work. I got the following error in the alert log file:
The managed recovery process (MRP) will maintain and apply the archive redo logs information to the standby database.
ORA-19909: datafile 1 belongs to an orphan incarnation
ORA-01110: data file 1: '/u02/oradata/ORCL/system01.dbf'
Completed: alter database recover managed standby database disconnect from session
Mon Oct 19 10:43:51 2023
MRP0: Background Media Recovery process shutdown (ORCL)
Cause: Standby and primary database using different incarnation
Solution: We need to reset the incarnation of Standby so that it will match with the primary and our MRP service will start.
Check the primary incarnation value
--Check the incarnation value on Primary
rman target /@PRIM
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 ORCL 2980942556 PARENT 1 30-JAN-2023 11:31:04
2 2 ORCL 2980942556 CURRENT 2344346 11-AUG-2023 03:02:53
Check the Standby incarnation values
--Check the incarnation value on Primary
rman target /@Standby
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 ORCL 2980942556 PARENT 1 30-JAN-2023 11:31:44
2 2 ORCL 2980942556 PARENT 2344346 11-AUG-2023 03:32:23
3 3 ORCL 2980942556 CURRENT 4635321 15-AUG-2023 06:14:33
As shown incarnation is not the same for both databases, you can change the current incarnation to 2 for standby so that it will match with the primary database.
Reset the incarnation on standby database
RMAN>reset database to incarnation 2;
database reset to incarnation 2
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 ORCL 2980942556 PARENT 1 30-JAN-2023 11:31:44
2 2 ORCL 2980942556 CURRENT 2344346 11-AUG-2023 03:32:23
3 3 ORCL 2980942556 ORPHAN 4635321 15-AUG-2023 06:14:33
Start the MRP service on the standby database hopefully, it will fix the issue.
sqlplus sys@standby as sysdba
SQL> alter database recover managed standby database disconnect from session;