In this tutorial we are going to learn about Database incarnation. I have mentioned below about incarnation and its different types of incarnation falls. Then follow below example for how was the incarnation is happening.

DESCRIPTION: 

The database Incarnation is a new version of the database that happens when you reset the online redo logs files using “alter database open resetlogs”.

The Database incarnation falls into following category “CurrentParentAncestor and Sibling”.

Current Incarnation the database incarnation in which the database is currently generating redo.

Parent Incarnation the database incarnation from which the current incarnation branched following an OPEN RESETLOGS operation.

Ancestor Incarnation the parent of the parent incarnation is an ancestor incarnation. Any parent of an ancestor incarnation is also an ancestor incarnation.

Sibling Incarnation two incarnations that share a common ancestor are sibling incarnations if neither one is an ancestor of the other.

we can view the status of our database incarnation using the command,

*SQL> select * from v$database_incarnation;

*list incarnation;

in this I have recovered a deleted table in the previous incarnation.

RMAN> backup database;
SQL> create table sample as select * from all_objects;
Table created.
SQL> select current_scn from v$database;
CURRENT_SCN
———–
547181
SQL> delete from sample;
49309 rows deleted.
SQL> commit;
Commit complete.
SQL> select current_scn from v$database;
CURRENT_SCN
———–
547891
SQL> drop table sample;
Table dropped.
SQL> select current_scn from v$database;
CURRENT_SCN
———–
547917
SQL> alter system switch logfile;
System altered.
SQL> select incarnation#, resetlogs_change# from v$database_incarnation;
INCARNATION# RESETLOGS_CHANGE#
———— —————–
1                 1

2            534907
SQL> shutdown immediate
SQL> startup mount
RMAN>
run2>{
3> set until scn=547891;
4> restore database;
5> recover database;
6> }
RMAN> alter database open resetlogs;
SQL> select incarnation#, resetlogs_change# from v$database_incarnation;
INCARNATION# RESETLOGS_CHANGE#
———— —————–
1                 1
2            534907
3            547896
SQL> select * from sample;
no rows selected
SQL>
RMAN> shutdown immediate
RMAN> startup mount
RMAN> reset database to incarnation 2;
database reset to incarnation 2
RMAN> run
2> {
3> set until scn=547181;
4> restore database;
5> recover database;
6> }
RMAN> alter database open resetlogs;
database opened
SQL> select count(1) from sample;
COUNT(1)
———-
49309
SQL>

Recent Posts

Start typing and press Enter to search