Error:
RMAN-06004: ORACLE error from recovery catalog database
RMAN-20207: UNTIL TIME or RECOVERY WINDOW is before RESETLOGS time
Step-by-Step Recovery to a Previous Incarnation
Step 1: Check the list of current and previous incarnation of databases
RMAN> LIST INCARNATION OF DATABASE;
Step 2: Reset the Incarnation to the Target One
RMAN> RESET DATABASE TO INCARNATION 2;
Step 3: Shutdown and Mount the Database
RMAN> SHUTDOWN IMMEDIATE;
RMAN> STARTUP MOUNT;
Step 4: Restore the Control File (if needed)
RMAN> RESTORE CONTROLFILE FROM AUTOBACKUP;
RMAN> ALTER DATABASE MOUNT;
Step 5: Restore and Recover the Database
RMAN> RESTORE DATABASE;
RMAN> RECOVER DATABASE;
Step 6: Open the Database with RESETLOGS
RMAN> ALTER DATABASE OPEN RESETLOGS;