2 Replies Latest reply: Feb 5, 2013 12:02 AM by CKPT RSS

    The RMAN Duplicate Command Fails During The Recover.

    user7984097
      This exact script works fine in our lab. We are using Oracle 10.2.0.4.0.
      The hot backup for standby is also a script which runs without error in both the lab and
      the production machine.

      I am obviously missing something.
      Any help would be greatly appreciated.

      Thanks,

      Jeff


      =================
      RMAN BACKUP SCRIPT
      =================

      RMAN> run
      2> {
      3> allocate channel c1 device type disk format '/u03/oradata/apoint/DB_BACKUPS/1NETCMN1_3261_BK4STDBY_%U';
      4> backup current controlfile for standby format '/u03/oradata/apoint/DB_BACKUPS/1NETCMN1_3261_CNTRL4STDBY_%U';
      5> backup as compressed backupset check logical tag='1NETCMN1_3261_BK4STDBY' database include current controlfile for standby;
      6> backup archivelog from sequence 463 format '/u03/oradata/apoint/DB_BACKUPS/1NETCMN1_3261_LOGS4STDBY_%U';
      7> release channel c1;
      8> }
      released channel: ORA_DISK_1
      allocated channel: c1
      channel c1: sid=578 devtype=DISK

      Starting backup at 22-JAN-13
      channel c1: starting full datafile backupset
      channel c1: specifying datafile(s) in backupset
      including standby control file in backupset
      channel c1: starting piece 1 at 22-JAN-13
      channel c1: finished piece 1 at 22-JAN-13
      piece handle=/u03/oradata/apoint/DB_BACKUPS/1NETCMN1_3261_CNTRL4STDBY_05o02f01_1_1 tag=TAG20130122T144104 comment=NONE
      channel c1: backup set complete, elapsed time: 00:00:02
      Finished backup at 22-JAN-13

      Starting backup at 22-JAN-13
      channel c1: starting compressed full datafile backupset
      channel c1: specifying datafile(s) in backupset
      input datafile fno=00004 name=/u01/oradata/apoint/users01.dbf
      input datafile fno=00001 name=/u01/oradata/apoint/system01.dbf
      input datafile fno=00002 name=/u01/oradata/apoint/undotbs01.dbf
      input datafile fno=00003 name=/u01/oradata/apoint/sysaux01.dbf
      channel c1: starting piece 1 at 22-JAN-13
      channel c1: finished piece 1 at 22-JAN-13
      piece handle=/u03/oradata/apoint/DB_BACKUPS/1NETCMN1_3261_BK4STDBY_06o02f05_1_1 tag=1NETCMN1_3261_BK4STDBY comment=NONE
      channel c1: backup set complete, elapsed time: 00:22:35
      channel c1: starting compressed full datafile backupset
      channel c1: specifying datafile(s) in backupset
      including standby control file in backupset
      channel c1: starting piece 1 at 22-JAN-13
      channel c1: finished piece 1 at 22-JAN-13
      piece handle=/u03/oradata/apoint/DB_BACKUPS/1NETCMN1_3261_BK4STDBY_07o02gah_1_1 tag=1NETCMN1_3261_BK4STDBY comment=NONE
      channel c1: backup set complete, elapsed time: 00:00:07
      Finished backup at 22-JAN-13

      Starting backup at 22-JAN-13
      current log archived
      channel c1: starting archive log backupset
      channel c1: specifying archive log(s) in backup set
      input archive log thread=1 sequence=463 recid=5 stamp=805323439
      input archive log thread=1 sequence=464 recid=6 stamp=805331764
      input archive log thread=1 sequence=465 recid=7 stamp=805387242
      input archive log thread=1 sequence=466 recid=8 stamp=805387245
      input archive log thread=1 sequence=467 recid=9 stamp=805388633
      channel c1: starting piece 1 at 22-JAN-13
      channel c1: finished piece 1 at 22-JAN-13
      piece handle=/u03/oradata/apoint/DB_BACKUPS/1NETCMN1_3261_LOGS4STDBY_08o02gaq_1_1 tag=TAG20130122T150354 comment=NONE
      channel c1: backup set complete, elapsed time: 00:00:36
      Finished backup at 22-JAN-13

      released channel: c1


      RMAN> exit


      Recovery Manager complete.


      =====================
      RMAN DUPLICATE SCRIPT
      =====================

      RMAN> run
      2> {
      3> allocate auxiliary channel c1 device type disk;
      4>
      5> duplicate target database for standby dorecover nofilenamecheck;
      6> release channel c1;
      7> }
      allocated channel: c1
      channel c1: sid=299 devtype=DISK

      Starting Duplicate Db at 21-JAN-13

      contents of Memory Script:
      {
      set until scn 143395851;
      restore clone standby controlfile;
      sql clone 'alter database mount standby database';
      }
      executing Memory Script

      executing command: SET until clause

      Starting restore at 21-JAN-13

      channel c1: starting datafile backupset restore
      channel c1: restoring control file
      channel c1: reading from backup piece /u03/oradata/apoint/DB_BACKUPS/1NETCMN1_6874_BK4STDBY_03o008gn_1_1
      channel c1: restored backup piece 1
      piece handle=/u03/oradata/apoint/DB_BACKUPS/1NETCMN1_6874_BK4STDBY_03o008gn_1_1 tag=1NETCMN1_6874_BK4STDBY
      channel c1: restore complete, elapsed time: 00:00:04
      output filename=/u01/oradata/apoint/control01.ctl
      output filename=/u02/oradata/apoint/control02.ctl
      output filename=/u03/oradata/apoint/control03.ctl
      Finished restore at 21-JAN-13

      sql statement: alter database mount standby database

      contents of Memory Script:
      {
      set until scn 143395851;
      set newname for tempfile 1 to
      "/u01/oradata/apoint/temp01.dbf";
      switch clone tempfile all;
      set newname for datafile 1 to
      "/u01/oradata/apoint/system01.dbf";
      set newname for datafile 2 to
      "/u01/oradata/apoint/undotbs01.dbf";
      set newname for datafile 3 to
      "/u01/oradata/apoint/sysaux01.dbf";
      set newname for datafile 4 to
      "/u01/oradata/apoint/users01.dbf";
      restore
      check readonly
      clone database
      ;
      }
      executing Memory Script

      executing command: SET until clause

      executing command: SET NEWNAME

      renamed temporary file 1 to /u01/oradata/apoint/temp01.dbf in control file

      executing command: SET NEWNAME

      executing command: SET NEWNAME

      executing command: SET NEWNAME

      executing command: SET NEWNAME

      Starting restore at 21-JAN-13

      channel c1: starting datafile backupset restore
      channel c1: specifying datafile(s) to restore from backup set
      restoring datafile 00001 to /u01/oradata/apoint/system01.dbf
      restoring datafile 00002 to /u01/oradata/apoint/undotbs01.dbf
      restoring datafile 00003 to /u01/oradata/apoint/sysaux01.dbf
      restoring datafile 00004 to /u01/oradata/apoint/users01.dbf
      channel c1: reading from backup piece /u03/oradata/apoint/DB_BACKUPS/1NETCMN1_6874_BK4STDBY_02o0076b_1_1

      channel c1: restored backup piece 1
      piece handle=/u03/oradata/apoint/DB_BACKUPS/1NETCMN1_6874_BK4STDBY_02o0076b_1_1 tag=1NETCMN1_6874_BK4STDBY
      channel c1: restore complete, elapsed time: 00:21:32
      Finished restore at 21-JAN-13

      contents of Memory Script:
      {
      switch clone datafile all;
      }
      executing Memory Script

      datafile 1 switched to datafile copy
      input datafile copy recid=5 stamp=805323205 filename=/u01/oradata/apoint/system01.dbf
      datafile 2 switched to datafile copy
      input datafile copy recid=6 stamp=805323205 filename=/u01/oradata/apoint/undotbs01.dbf
      datafile 3 switched to datafile copy
      input datafile copy recid=7 stamp=805323206 filename=/u01/oradata/apoint/sysaux01.dbf
      datafile 4 switched to datafile copy
      input datafile copy recid=8 stamp=805323206 filename=/u01/oradata/apoint/users01.dbf

      contents of Memory Script:
      {
      set until scn 143395851;
      recover
      standby
      clone database
      delete archivelog
      ;
      }
      executing Memory Script

      executing command: SET until clause

      Starting recover at 21-JAN-13

      starting media recovery

      channel c1: starting archive log restore to default destination
      channel c1: restoring archive log
      archive log thread=1 sequence=462
      channel c1: reading from backup piece /u03/oradata/apoint/DB_BACKUPS/1NETCMN1_6874_LOGS4STDBY_04o008gu_1_1
      channel c1: restored backup piece 1
      piece handle=/u03/oradata/apoint/DB_BACKUPS/1NETCMN1_6874_LOGS4STDBY_04o008gu_1_1 tag=TAG20130121T183822
      channel c1: restore complete, elapsed time: 00:00:03
      archive log filename=/u03/oradata/apoint/DB_ARCHIVE_LOGS/apoint_1_688761648_462.arch thread=1 sequence=462
      Oracle Error:
      ORA-01547: warning: RECOVER succeeded but OPEN RESETLOGS would get error below
      ORA-01152: file 1 was not restored from a sufficiently old backup
      ORA-01110: data file 1: '/u01/oradata/apoint/system01.dbf'

      released channel: c1
      RMAN-00571: ===========================================================
      RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
      RMAN-00571: ===========================================================
      RMAN-03002: failure of Duplicate Db command at 01/21/2013 20:53:44
      RMAN-03015: error occurred in stored script Memory Script
      RMAN-11003: failure during parse/execution of SQL statement: alter database recover logfile '/u03/oradata/apoint/DB_ARCHIVE_LOGS/apoint_1_688761648_462.arch'
      ORA-16145: archival for thread# 1 sequence# 462 in progress


      RMAN> exit
        • 1. Re: The RMAN Duplicate Command Fails During The Recover.
          mseberg
          Jeff;

          I think the issue is in your backup. If you compare your command with mine, you may or may not see the issue, but this is how I got this to work.

          Yours
          RMAN run
           {
           allocate channel c1 device type disk format '/u03/oradata/apoint/DB_BACKUPS/1NETCMN1_3261_BK4STDBY_%U';
           backup current controlfile for standby format '/u03/oradata/apoint/DB_BACKUPS/1NETCMN1_3261_CNTRL4STDBY_%U';
           backup as compressed backupset check logical tag='1NETCMN1_3261_BK4STDBY' database include current controlfile for standby;
           backup archivelog from sequence 463 format '/u03/oradata/apoint/DB_BACKUPS/1NETCMN1_3261_LOGS4STDBY_%U';
           release channel c1;
           }
          Mine
          RMAN RUN {
          allocate channel d1 type disk;
          backup format '/u01/backups/PRIMARY/df_t%t_s%s_p%p' database;
          sql 'alter system archive log current';
          backup format '/u01/backups/PRIMARY/al_t%t_s%s_p%p' archivelog all;
          backup current controlfile for standby format '/u01/backups/PRIMARY/sb_t%t_s%s_p%p';
          release channel d1;
          }
          Your duplicate is very close to what I use :

          Yours
          RMAN> run
           {
           allocate auxiliary channel c1 device type disk;
          
           duplicate target database for standby dorecover nofilenamecheck;
           release channel c1;
           }
          Mine
          RMAN> run {
           allocate channel C1 device type disk;
           allocate auxiliary channel C2 device type disk;
           duplicate target database for standby nofilenamecheck;
          }
          Short notes :

          http://www.visi.com/~mseberg/duprman.html

          Best Regards

          mseberg
          • 2. Re: The RMAN Duplicate Command Fails During The Recover.
            CKPT
            >
            RMAN-11003: failure during parse/execution of SQL statement: alter database recover logfile '/u03/oradata/apoint/DB_ARCHIVE_LOGS/apoint_1_688761648_462.arch'
            ORA-16145: archival for thread# 1 sequence# 462 in progress
            >

            Can you check the below query from primary and standby database.
            SQL> select database_role, controlfile_type,resetlogs_change# from v$database;

            ensure on standby database, control file type is "standby"

            and then you can start the MRP on standby. Make sure you have the log sequence from 462 on standby. So that MRP will be applying them.
            SQL> alter database recover managed standby database disconnect from session;