This discussion is archived
13 Replies Latest reply: Dec 13, 2012 9:27 AM by DBA_1976 RSS

RMAN Duplicate

DBA_1976 Explorer
Currently Being Moderated
Hi,
I am trying to do an RMAN duplicate in remote host using different directory structure. My target instance is d_prod and my standby instance is TEST. We use RMAN catalog.

When I list backups in RMAN (in my target) I get the list of backups. I did a crosscheck to make sure they are in sync. But when I run the duplicate command I get

that "RMAN-06023: no backup or copy of datafile 96 found to restore"

But when I type
list backup of datafile 96;

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
2119233 Incr 0  6.04G      SBT_TAPE    00:05:20     05-JUL-11
        BP Key: 2119258   Status: AVAILABLE  Compressed: NO  Tag: PROD_HOT_RMAN
        Handle: bk_uf1mgn24p_s19937_p1_t755730585   Media: DW0135
  List of Datafiles in backup set 2119233
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  96   0  Incr 90408424904 05-JUL-11 /s11/oradata/prod/usr04.dbf
We use netbackup for media management and backup with simple RMAN scripts. I don't know what I am missing? please help
  • 1. Re: RMAN Duplicate
    864403 Explorer
    Currently Being Moderated
    Hope if this helps

    http://www.juhanak.cz/database/oracle/dba/rman/rman_duplicate.sql

    Duplication Fails with Multiple RMAN-06023 Errors: Diagnosis

    The DUPLICATE command recovers to archived redo logs, but cannot recover into
    online redo logs. Thus, if the restored backup cannot be made consistent without
    applying the online redo logs, then duplication fails
    with RMAN-06023 errors because RMAN is looking for backups created before the most recent archived log.

    Duplication Fails with Multiple RMAN-06023 Errors: Solution


    After backing up the source database, archive and back up the current redo log:
    RMAN> SQL 'ALTER SYSTEM ARCHIVE LOG CURRENT';
    RMAN> BACKUP ARCHIVELOG ALL;
  • 2. Re: RMAN Duplicate
    Hemant K Chitale Oracle ACE
    Currently Being Moderated
    Are you running the DUPLICATE with a SET UNTIL ? What SEQUENCE# or CHANGE# are you duplicating to ?

    This datafile backup is from 05-Jul and SCN 90408424904 so it should be usable for any DUPLICATE to a point in time after that SCN.


    Hemant K Chitale
  • 3. Re: RMAN Duplicate
    CKPT Guru
    Currently Being Moderated
    Are you running the DUPLICATE with a SET UNTIL ? What SEQUENCE# or CHANGE# are you duplicating to ?

    This datafile backup is from 05-Jul and SCN 90408424904 so it should be usable for any DUPLICATE to a point in time after that SCN.
    @hemant,
    I am trying to do an RMAN duplicate in remote host using different directory structure
    OP is trying to duplicate by placing backup pieces in different directory structure. It should be in same location as exist in primary/target database and then retry.
  • 4. Re: RMAN Duplicate
    Hemant K Chitale Oracle ACE
    Currently Being Moderated
    It should be in same location as exist in primary/target database and then retry.
    Not necessarily. You can DUPLICATE to a different directory structure.

    Also, the error he has doesn't relate to the directory structure.


    Hemant K Chitale

    Edited by: Hemant K Chitale on Jul 12, 2011 11:35 AM
  • 5. Re: RMAN Duplicate
    DBA_1976 Explorer
    Currently Being Moderated
    This is the code snippet from my backup script.
    export ORACLE_HOME
    ORACLE_SID=prod
    export ORACLE_SID
    $RMAN target $TARGET_CONNECT_STR catalog $CATALOG_CONNECT_STR msglog $RMAN_LOG_FILE append << EOF
    
    CONFIGURE DEVICE TYPE 'SBT_TAPE' PARALLELISM 2;
    
    RUN {
    
    ALLOCATE CHANNEL ch00 TYPE 'SBT_TAPE';
    ALLOCATE CHANNEL ch01 TYPE 'SBT_TAPE';
    
    SEND 'NB_ORA_POLICY=My_Policy_Name,NB_ORA_SCHED=Default-Application-Backup';
    
    BACKUP
         $BACKUP_TYPE
         FORMAT 'bk_u%u_s%s_p%p_t%t'
         FILESPERSET 4
         TAG 'prod_hot_rman'
        DATABASE;
    sql 'alter system archive log current';
    
    RELEASE CHANNEL ch00;
    RELEASE CHANNEL ch01;
    
    # backup all archive logs
    
     ALLOCATE CHANNEL ch00 TYPE 'SBT_TAPE';
     allocate channel ch01 TYPE 'SBT_TAPE';
    
     SEND 'NB_ORA_POLICY=My_Policy_Name,NB_ORA_SCHED=Default-Application-Backup';
    
     BACKUP
        FORMAT 'arch-s%s-p%p-t%t'
        ARCHIVELOG
           FROM logseq=24728
        DELETE INPUT;
    
    RELEASE CHANNEL ch00;
    RELEASE CHANNEL ch01;
    
    ALLOCATE CHANNEL ch00 TYPE 'SBT_TAPE';
    
    SEND 'NB_ORA_POLICY=My_Policy_Name,NB_ORA_SCHED=Default-Application-Backup';
    
    BACKUP
        FORMAT 'bk_u%u_s%s_p%p_t%t'
        CURRENT CONTROLFILE;
    RELEASE CHANNEL ch00;
    
    }
    EOF
    I do an alter system switch log file, which I think it will archive the current and then I backup the archive log files and then the control file also. But this has been my suspicion, that the backup is not consistent. The reason I am saying this is, whenever I open the log file to check, it always says there is a swp file aready open. So I have force open the log file.

    The log does seems to have a successful backup, so I was not concerned about the file not able to open in the begining. But now as part of my disaster recovery, when I started this duplicate process I am thinking I should have paid more attention to that.

    Any way I took a hot backup yesterday also. I get the same error today. But I am doing as you said. Archive the current log and then backup the archivelog files and I am going to try it again. I'll come back with the results.

    Thank you so much.
  • 6. Re: RMAN Duplicate
    DBA_1976 Explorer
    Currently Being Moderated
    No I am not using any options with duplicate command.

    Mine is
    duplicate target database to 'TEST';
    That's all. I just want it to do a complete restore upto the latest consistent archivelog that is in the backup. I think the rman catalog is capable of deciding that for itself.
    (please correct me if I am wrong).
  • 7. Re: RMAN Duplicate
    Hemant K Chitale Oracle ACE
    Currently Being Moderated
    Oracle expects the current redo to be available because you are connecting to the production database now -- so it expects to duplicate until the current_scn of the production database. In such a case, you have to copy the latest archivelog from production as well.


    Hemant K Chitale
  • 8. Re: RMAN Duplicate
    DBA_1976 Explorer
    Currently Being Moderated
    But in any duplicate situation you are connecting to the production database (or whichever your target is. It will be up and running and will have a current log/SCN all the time). Being said that, does every duplicate has to have a set until clause? I think it is not necessary as long as you have a consistent full (hot or cold) backup.

    Please correct me if I am wrong. I am just putting my thoughts.
  • 9. Re: RMAN Duplicate
    Hemant K Chitale Oracle ACE
    Currently Being Moderated
    Generally, RMAN DUPLICATE expects to perform recovery to the most recent point available from the backups and archivelogs.
    In my experience, SET UNTIL becomes necessary when the "most recent" archivelog isn't available.



    In any case ..... whether you want to use SET UNTIL or not, the error message you posted indicates a mismatch in the backups. Have you verified the backups ?


    Hemant K Chitale
  • 10. Re: RMAN Duplicate
    CKPT Guru
    Currently Being Moderated
    as per OP
    I am trying to do an RMAN duplicate in remote host using different directory structure
    that "RMAN-06023: no backup or copy of datafile 96 found to restore"
    DBA_1976, can you please calrify the backup locations are in different directory structure or datafiles or in different structure.


    @hemanth,

    Thanks for your information
    Not necessarily. You can DUPLICATE to a different directory structure.
    Are you talking about datafiles location? Then it can be in any location by setting DB_FILE_NAME_CONVERT

    But my assumption regarding error, OP placed the backup piece locations be in different locations in Target & Auxiliary
    This error we will face when the backup locations are different.

    Thanks.
  • 11. Re: RMAN Duplicate
    Hemant K Chitale Oracle ACE
    Currently Being Moderated
    OP placed the backup piece locations be in different locations in Target & Auxiliary
    This error we will face when the backup locations are different.
    He has presented :
    We use netbackup for media management and backup with simple RMAN scripts
    ALLOCATE CHANNEL ch00 TYPE 'SBT_TAPE';
    ALLOCATE CHANNEL ch01 TYPE 'SBT_TAPE';
    His is doing a Backup to tape direct and should be doing a restore from tape direct. There's no issue with "backup location".

    If there were issues, he should be reporting RMAN-06023 for all datafiles. He seems to be reporting this only for datafile 96 --- or maybe he is miscommunicating.

    Hemant K Chitale
  • 12. Re: RMAN Duplicate
    CKPT Guru
    Currently Being Moderated
    I have not seen that information, as OP trying to restore from tapes.

    Thanks for your explanation.
  • 13. Re: RMAN Duplicate
    DBA_1976 Explorer
    Currently Being Moderated
    Hi, I know it is very very late to respond to this thread. But Now only I understood, What the duplicate command does exactly. You are right, I have to issue the set until or to have the latest consistent backup.

    Thanks Hemant.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points