Search This Blog

Total Pageviews

Sunday, 23 July 2023

ORA-19906: recovery target incarnation changed during recovery



ORA-19906: recovery target incarnation changed during recovery


http://anuj-singh.blogspot.com/2021/10/rman-restore-database.html


RMAN>
run{
set until scn 2128193160;
restore database;
recover database;
alter database open resetlogs;
}

archived log for thread 1 with sequence 20 is already on disk as file +DATA/IBRAC/ARCHIVELOG/2023_07_23/thread_1_seq_20.3994.1142903177
archived log for thread 2 with sequence 10 is already on disk as file +DATA/IBRAC/ARCHIVELOG/2023_07_23/thread_2_seq_10.3993.1142903179
archived log file name=+DATA/IBRAC/ARCHIVELOG/2023_07_23/thread_1_seq_20.3994.1142903177 thread=1 sequence=20
archived log file name=+DATA/IBRAC/ARCHIVELOG/2023_07_23/thread_2_seq_10.3993.1142903179 thread=2 sequence=10
archived log file name=+DATA/IBRAC/ARCHIVELOG/2023_07_23/thread_1_seq_21.3978.1142919207 thread=1 sequence=21
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 07/23/2023 05:50:15
ORA-00283: recovery session canceled due to errors
RMAN-11003: failure during parse/execution of SQL statement: alter database recover logfile '+DATA/IBRAC/ARCHIVELOG/2023_07_23/thread_1_seq_21.3978.1142919207'
ORA-00283: recovery session canceled due to errors
ORA-19906: recovery target incarnation changed during recovery





select * from v$database_incarnation where RESETLOGS_CHANGE# in (select max(RESETLOGS_CHANGE#) from v$database_incarnation where RESETLOGS_CHANGE#< 2128193160 ) ;


INCARNATION# RESETLOGS_CHANGE# RESETLOGS_TIME   PRIOR_RESETLOGS_CHANGE#
------------ ----------------- ---------------- -----------------------
PRIOR_RESETLOGS_ STATUS  RESETLOGS_ID PRIOR_INCARNATION#
---------------- ------- ------------ ------------------
FLASHBACK_DATABASE_ALLOWED     CON_ID
-------------------------- ----------
           8        2111276714 23-07-2023 05:33              2103430857
21-07-2023 13:03 CURRENT   1142919207                  7
NO                                  0

-
RMAN>
reset database to incarnation 8;
RMAN>

database reset to incarnation 8



2128193159+1

run{
set until scn 2128193160;
restore database;
recover database;
alter database open resetlogs;
}



RMAN>
select * from v$database_incarnation where RESETLOGS_CHANGE# in (select max(RESETLOGS_CHANGE#) from v$database_incarnation where RESETLOGS_CHANGE#< 2128193160 ) ;
RMAN>

INCARNATION# RESETLOGS_CHANGE# RESETLOGS_TIME   PRIOR_RESETLOGS_CHANGE#
------------ ----------------- ---------------- -----------------------
PRIOR_RESETLOGS_ STATUS  RESETLOGS_ID PRIOR_INCARNATION#
---------------- ------- ------------ ------------------
FLASHBACK_DATABASE_ALLOWED     CON_ID
-------------------------- ----------
           8        2111276714 23-07-2023 05:33              2103430857
21-07-2023 13:03 CURRENT   1142919207                  7
NO                                  0

===================================================================================
Change incarnation based on scn no !!!!!
================================================================================
RMAN>
reset database to incarnation 8;
RMAN>

database reset to incarnation 8

RMAN>
run{
set until scn 2128193160;
restore database;
recover database;
alter database open resetlogs;
}

RMAN> 2> 3> 4> 5> 6>
executing command: SET until clause

Starting restore at 23-07-2023 06:00:33
using channel ORA_DISK_1

channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00001 to +DATA/ibrac/system01.dbf
channel ORA_DISK_1: restoring datafile 00002 to +DATA/ibrac/apex_data01.dbf
channel ORA_DISK_1: restoring datafile 00003 to +DATA/ibrac/sysaux01.dbf
channel ORA_DISK_1: restoring datafile 00004 to +DATA/ibrac/undotbs01.dbf
channel ORA_DISK_1: restoring datafile 00005 to +DATA/ibrac/undotbs02.dbf
channel ORA_DISK_1: restoring datafile 00007 to +DATA/ibrac/users01.dbf
channel ORA_DISK_1: restoring datafile 00008 to +DATA/ibrac/test_data01.dbf
channel ORA_DISK_1: restoring datafile 00009 to +DATA/ibrac/test_data_ind_01.dbf
channel ORA_DISK_1: restoring datafile 00010 to +DATA/IBRAC/DATAFILE/lobtest.4701.1142772675
channel ORA_DISK_1: restoring datafile 00011 to +DATA/IBRAC/DATAFILE/test_uniform.4019.1142772751
channel ORA_DISK_1: restoring datafile 00012 to +DATA/IBRAC/DATAFILE/test.4018.1142772743
channel ORA_DISK_1: restoring datafile 00013 to +DATA/IBRAC/DATAFILE/test1.4020.1142772751
channel ORA_DISK_1: restoring datafile 00014 to +DATA/IBRAC/DATAFILE/test1.4024.1142772751
channel ORA_DISK_1: restoring datafile 00015 to +DATA/IBRAC/DATAFILE/bigtabs.4014.1142772677
channel ORA_DISK_1: reading from backup piece /dumps/IBRAC/20230721_ibrac1_1734_1_1142746455

channel ORA_DISK_1: piece handle=/dumps/IBRAC/20230721_ibrac1_1734_1_1142746455 tag=TAG20230721T053414
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:07:06
Finished restore at 23-07-2023 06:07:40

Starting recover at 23-07-2023 06:07:40
using channel ORA_DISK_1

starting media recovery

archived log for thread 1 with sequence 1677 is already on disk as file +DATA/IBRAC/ARCHIVELOG/2023_07_23/thread_1_seq_1677.3988.1142919161
archived log for thread 2 with sequence 1701 is already on disk as file +DATA/IBRAC/ARCHIVELOG/2023_07_23/thread_2_seq_1701.3987.1142919161
archived log for thread 1 with sequence 1 is already on disk as file +DATA/IBRAC/ARCHIVELOG/2023_07_23/thread_1_seq_1.3981.1142919163
archived log for thread 1 with sequence 2 is already on disk as file +DATA/IBRAC/ARCHIVELOG/2023_07_23/thread_1_seq_2.3979.1142919163
archived log for thread 1 with sequence 3 is already on disk as file +DATA/IBRAC/ARCHIVELOG/2023_07_23/thread_1_seq_3.3986.1142919163
archived log for thread 1 with sequence 4 is already on disk as file +DATA/IBRAC/ARCHIVELOG/2023_07_23/thread_1_seq_4.3985.1142919163
archived log for thread 1 with sequence 5 is already on disk as file +DATA/IBRAC/ARCHIVELOG/2023_07_23/thread_1_seq_5.3983.1142919163
archived log for thread 1 with sequence 6 is already on disk as file +DATA/IBRAC/ARCHIVELOG/2023_07_22/thread_1_seq_6.4012.1142842377
archived log for thread 2 with sequence 1 is already on disk as file +DATA/IBRAC/ARCHIVELOG/2023_07_23/thread_2_seq_1.3980.1142919163
archived log for thread 2 with sequence 2 is already on disk as file +DATA/IBRAC/ARCHIVELOG/2023_07_23/thread_2_seq_2.3982.1142919163
archived log for thread 2 with sequence 3 is already on disk as file +DATA/IBRAC/ARCHIVELOG/2023_07_23/thread_2_seq_3.3984.1142919163
archived log for thread 2 with sequence 4 is already on disk as file +DATA/IBRAC/ARCHIVELOG/2023_07_22/thread_2_seq_4.4713.1142844169
archived log for thread 1 with sequence 1 is already on disk as file +DATA/IBRAC/ONLINELOG/group_1.273.1142773385
archived log for thread 2 with sequence 1 is already on disk as file +DATA/IBRAC/ONLINELOG/group_3.270.1142773383
archived log file name=+DATA/IBRAC/ARCHIVELOG/2023_07_23/thread_1_seq_1677.3988.1142919161 thread=1 sequence=1677
archived log file name=+DATA/IBRAC/ARCHIVELOG/2023_07_23/thread_2_seq_1701.3987.1142919161 thread=2 sequence=1701
archived log file name=+DATA/IBRAC/ARCHIVELOG/2023_07_23/thread_2_seq_1.3980.1142919163 thread=2 sequence=1
archived log file name=+DATA/IBRAC/ARCHIVELOG/2023_07_23/thread_1_seq_1.3981.1142919163 thread=1 sequence=1
archived log file name=+DATA/IBRAC/ARCHIVELOG/2023_07_23/thread_1_seq_2.3979.1142919163 thread=1 sequence=2
archived log file name=+DATA/IBRAC/ARCHIVELOG/2023_07_23/thread_2_seq_2.3982.1142919163 thread=2 sequence=2
archived log file name=+DATA/IBRAC/ARCHIVELOG/2023_07_23/thread_1_seq_3.3986.1142919163 thread=1 sequence=3
archived log file name=+DATA/IBRAC/ARCHIVELOG/2023_07_23/thread_1_seq_4.3985.1142919163 thread=1 sequence=4
archived log file name=+DATA/IBRAC/ARCHIVELOG/2023_07_23/thread_2_seq_3.3984.1142919163 thread=2 sequence=3
archived log file name=+DATA/IBRAC/ARCHIVELOG/2023_07_23/thread_1_seq_5.3983.1142919163 thread=1 sequence=5
archived log file name=+DATA/IBRAC/ARCHIVELOG/2023_07_22/thread_1_seq_6.4012.1142842377 thread=1 sequence=6
archived log file name=+DATA/IBRAC/ARCHIVELOG/2023_07_22/thread_2_seq_4.4713.1142844169 thread=2 sequence=4
archived log file name=+DATA/IBRAC/ONLINELOG/group_1.273.1142773385 thread=1 sequence=1
archived log file name=+DATA/IBRAC/ONLINELOG/group_3.270.1142773383 thread=2 sequence=1
Finished recover at 23-07-2023 06:07:53

Statement processed



SQL> startup pfile='/tmp/pfileIBRAC23.ora';
ORACLE instance started.

Total System Global Area 4294967296 bytes
Fixed Size                  8628936 bytes
Variable Size            1660945720 bytes
Database Buffers         2617245696 bytes
Redo Buffers                8146944 bytes
Database mounted.
Database opened.


col FILE_NAME for a30
select * from dba_temp_files where tablespace_name like 'TEMP%';SQL> SQL>

FILE_NAME                         FILE_ID TABLESPACE_NAME
------------------------------ ---------- ------------------------------
     BYTES     BLOCKS STATUS  RELATIVE_FNO AUT   MAXBYTES  MAXBLOCKS
---------- ---------- ------- ------------ --- ---------- ----------
INCREMENT_BY USER_BYTES USER_BLOCKS SHARED           INST_ID
------------ ---------- ----------- ------------- ----------
+DATA/ibrac/temp01.dbf                  1 TEMP
  30408704       3712 ONLINE             1 YES 3.4360E+10    4194302
          80   29360128        3584 SHARED



create spfile='+DATA/IBRAC/spfileIBRAC23.ora' from pfile='/tmp/pfileIBRAC23.ora';

srvctl modify database -d ibrac -spfile +DATA/IBRAC/spfileIBRAC23.ora


1018  07/23/23 07:26:28\ srvctl modify database -d ibrac -spfile +DATA/IBRAC/spfileIBRAC23.ora

[oracle@ibrac01:/tmp] $srvctl status database -d ibrac -v
Instance ibrac1 is not running on node ibrac01
Instance ibrac2 is not running on node ibrac02
[oracle@ibrac01:/tmp] $srvctl start database -d ibrac

[oracle@ibrac01:/tmp] $srvctl status database -d ibrac -v
Instance ibrac1 is running on node ibrac01. Instance status: Open.
Instance ibrac2 is running on node ibrac02. Instance status: Open.
[oracle@ibrac01:/tmp] $


No comments:

Oracle DBA

anuj blog Archive