Doing a repeated rman database time based recovery
RMAN>
run{
…
alter database mount;
…
set until time “to_date(‘27.10.2008 23:30:00′,’DD.MM.YYYY HH24:MI:SS’)”;
…
restore database;
recover database delete archivelog;
alter database open resetlogs;
}
without rman catalog repository can fail with error:
RMAN-20207: UNTIL TIME or RECOVERY WINDOW is before RESETLOGS time
To solve the issue
- list the incarnation id of the database
 
RMAN> list incarnation;
using target database control file instead of recovery catalog
List of Database Incarnations
Key Key
  1   1   ORAV10  76765624 PARENT  1         22.11.2007 16:44:40
2   2   ORAV10  76765624 PARENT  4921103   09.04.2008 11:38:07
3   3   ORAV10  76765624 ORPHAN  15854298  27.11.2008 11:43:33
4   4   ORAV10  76765624 CURRENT 15854298  27.11.2008 17:38:11
- set the database in mount status to incarnation id that is fitting to the selected restore time
 
 
RMAN> shutdown immediate;
RMAN> startup mount;
RMAN> reset database to incarnation 2;
- repeat the database time based recovery
 
Be careful: Do not restore controlfile. If you do so, incarnation is set the latest id and you run into same error.
RMAN> list incarnation;
List of Database Incarnations
Key Key
  1   1   ORAV10  76765624 PARENT  1         22.11.2007 16:44:40
2   2   ORAV10  76765624 PARENT  4921103   09.04.2008 11:38:07
5   5   ORAV10  76765624 CURRENT 15783824  10.12.2008 16:03:56
4   4   ORAV10  76765624 ORPHAN  15854298  27.11.2008 17:38:11
3   3   ORAV10  76765624 ORPHAN  15854298  27.11.2008 11:43:33
In some cases you get errors during recovery
ORA-00283: recovery session canceled due to errors
ORA-00081: address range [0x60000000000A7D70, 0x60000000000A7D74) is not readable
ORA-00600: internal error code, arguments: [kcvsor_current_inc_rdfail], [0], [], [], [], [], [], []
In this case you have to restore an adequate controlfile created in selected recovery time frame and that has the same incarnation as the datafiles (see also oracle support Note:378273.1)