Home > Backup and Restore, Database, Oracle, RMAN, Utilities > Oracle RMAN: Duplicate database fails with “RMAN-06457: UNTIL scn (4321) is ahead of last scn in archived logs (1234)” or provides an old image of the database

Oracle RMAN: Duplicate database fails with “RMAN-06457: UNTIL scn (4321) is ahead of last scn in archived logs (1234)” or provides an old image of the database

Problem description:

You are trying to duplicate a database and you are always ending up with the same old image or you are receiving the following error message during restore:

Starting Duplicate Db at 05-JUN-2011 22:50:27
released channel: stb1
released channel: stb2
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure OF Duplicate Db command at 06/05/2009 22:51:26
RMAN-06457: UNTIL scn (4321) IS ahead OF LAST scn IN archived logs (1234)

 
Cause:

You are duplicating a RAC database with more than one redo log threads. If one of the threads is in “CLOSED”-state you will either receive above mentioned error message or end up with an old duplicated image (because duplicate database will use an scn <= the latest changes from the closed thread).

Example output from v$log:

SQL> SELECT thread#, STATUS, instance FROM v$thread ORDER BY 1;
 
   THREAD# STATUS INSTANCE
---------- ------ --------------------
	 1 OPEN   rac1
	 2 CLOSED rac2
	 3 OPEN   rac3
	 4 OPEN   rac4
 
SQL>

 
Problem resolution:

Either

  1. drop the closed thread if it is no longer needed.

    Example:

    SQL> ALTER DATABASE disable thread 2;
     
    DATABASE altered.
     
    SQL>
    SQL> ALTER DATABASE DROP logfile GROUP 201;
     
    DATABASE altered.
     
    SQL> ALTER DATABASE DROP logfile GROUP 202;
     
    DATABASE altered.
     
    SQL> ALTER DATABASE DROP logfile GROUP 203;
     
    DATABASE altered.
     
    SQL>

     
    v$thread will now no longer list the thread:

    SQL> SELECT thread#, STATUS, instance FROM v$thread ORDER BY 1;
     
       THREAD# STATUS INSTANCE
    ---------- ------ --------------------
    	 1 OPEN   rac1
    	 3 OPEN   rac3
    	 4 OPEN   rac4
     
    SQL>

     

  2. open the thread by starting the currently stopped RAC database instance and perform a log switch

    Example:

    [oracle@rac1 ~]$ srvctl start instance -d rac -i rac2
    [oracle@rac1 ~]$

     
    v$thread will now list the thread as open:

    SQL> SELECT thread#, STATUS, instance FROM v$thread ORDER BY 1;
     
       THREAD# STATUS INSTANCE
    ---------- ------ --------------------
    	 1 OPEN   rac1
     	 2 OPEN   rac2
    	 3 OPEN   rac3
    	 4 OPEN   rac4
     
    SQL>

     
    After archiving the redo logs, reperform your duplicate database.

  1. Belkacem BOUHAFS
    June 17th, 2015 at 11:44 | #1

    You can also do on the open instance perform this (in case of you need to keep any instance in close status) :

    sys@rac1> alter system switch logfile;

    System altered.

    sys@rac1> alter system checkpoint;

    System altered.

    THEN reperform your duplicate database.

  1. No trackbacks yet.

Connect with Facebook