4 Replies Latest reply: Jul 11, 2012 1:47 PM by user2464919 RSS

    Duplicate target database from tag

    715484
      Hi guys,

      Wonder if someone has tried something like 'DUPLICATE TARGET DATABASE TO ... FROM TAG ...'?

      10.2.0.4 database, in today's duplication RMAN tried to find monthly cold backup instead of hotbackup that it usually takes. Monthly cold backup was taken after the hotbackup, and duplication starts some time after that. I know, controllfile tried to find the last backup, but after failing to find it (it is unaccessible from the host that performs duplication) it did not try to find the hotbackup (which is accessible by the new host), instead it was searching for previous monthly cold backups. This seems TAG related (these 2 backups have different tags) and I just wonder if I could explicitly set tag from which I could perform duplication, so I can avoid this happening again?

      Thanks
        • 1. Re: Duplicate target database from tag
          tychos
          Hi user2552261,
          Wonder if someone has tried something like 'DUPLICATE TARGET DATABASE TO ... FROM TAG ...'?
          Yes I did but is does not work.
          21> DUPLICATE TARGET DATABASE TO xxxx
          22> FROM
          RMAN-00571: ===========================================================
          RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
          RMAN-00571: ===========================================================
          RMAN-00558: error encountered while parsing input commands
          RMAN-01009: syntax error: found "from": expecting one of: "device, db_file_name_convert, high, logfile, nofilenamecheck, open, pfile, ;, skip, until"
          RMAN-01007: at line 36 column 1 file: xxx.xxx

          For the syntax off the duplicate command you can check the following link
          http://download.oracle.com/docs/cd/B19306_01/backup.102/b14194/rcmsynta028.htm#i81724

          It seems you can only use the <until clause> in 10g.

          Regards,

          Tycho
          • 2. Re: Duplicate target database from tag
            Kamran Agayev A.
            user2552261 wrote:
            Hi guys,

            Wonder if someone has tried something like 'DUPLICATE TARGET DATABASE TO ... FROM TAG ...'?

            10.2.0.4 database, in today's duplication RMAN tried to find monthly cold backup instead of hotbackup that it usually takes. Monthly cold backup was taken after the hotbackup, and duplication starts some time after that. I know, controllfile tried to find the last backup, but after failing to find it (it is unaccessible from the host that performs duplication) it did not try to find the hotbackup (which is accessible by the new host), instead it was searching for previous monthly cold backups. This seems TAG related (these 2 backups have different tags) and I just wonder if I could explicitly set tag from which I could perform duplication, so I can avoid this happening again?

            Thanks
            Yes, there's no such syntax, but in RMAN Recipes books, there's a way of how to do it
            Check this link: http://tinyurl.com/yax7k4m
            • 3. Re: Duplicate target database from tag
              715484
              Hi guys,

              Thanks for the replies. Have seen the recipe you pointed, however, this is not the way that I want to avoid my problem of happening again. It seems that I have to schedule mu duplication to run after the hotbackup and before the monthly starts, though I wish RMAN had an elegant "from tag" solution for this (that is - my solution :-) ).

              Thanks again.
              • 4. Re: Duplicate target database from tag
                user2464919
                You should be able to do something similar using restore points.

                In the target database:

                backup database plus archivelog;

                create restore point r1;

                backup archivelog all;


                Then you connect to the target, catalog, and auxiliary database using RMAN:

                duplicate target database to <SID> until restore point r1;