3 Replies Latest reply on Jun 26, 2011 7:26 PM by 203141

    Duplicate Database - RMAN - 10.2.0.4

    DanceRat
      This is my first time posting, so thanks all for this venue!

      My cohort has been working on a script to duplicate a 10.2. oracle database using rman from target prod(different host) to auxiliary test using rman and NetBackup. (all aix) The directory structure is different on both so we use the convert commands in the run script:

      clone/staging/rman_commands.lst
      connect target 'sys/targetpw@hostP'
      connect catalog 'rmanprod/rmanpw@rmanP'
      connect auxiliary 'sys/auxpw@hostT'
      run {
      allocate auxiliary channel 'aux_01' type sbt;
      allocate auxiliary channel 'aux_02' type sbt;

      send 'NB_ORA_CLIENT=hostP.corp.dom';
      set until time "to_date('24-Jun-11 10:22:00','DD-MON-YY HH24:MI:SS')";
      duplicate target database to auxT nofilenamecheck;
      set db_file_name_convert =
      '/instP_oradata/oradata/','/instT_oradata/oradata/'
      set log_file_name_convert =
      '/instP_oradata/oradata/','/instT_oradata/oradata/'
      release channel aux_01;
      release channel aux_02;
      }

      but we are getting this error message:

      RMAN> connect target *
      2> connect catalog *
      3> connect auxiliary *
      4> run {
      5> allocate auxiliary channel 'aux_01' type sbt;
      6> allocate auxiliary channel 'aux_02' type sbt;
      7>
      8> send 'NB_ORA_CLIENT=hostP.corp.dom';
      9> set until time "to_date('24-Jun-11 10:22:00','DD-MON-YY HH24:MI:SS')";
      10> duplicate target database to auxT nofilenamecheck;
      11> set db_file_name_convert
      RMAN-00571: ===========================================================
      RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
      RMAN-00571: ===========================================================
      RMAN-00558: error encountered while parsing input commands
      RMAN-01009: syntax error: found "db_file_name_convert": expecting one of: "archivelog, auxiliary, auxname, autolocate, autobackup, backup, command, controlfile, clonename, decryption, dbid, duplex, echo, encryption, high, limit, maxcorrupt, maxseq, newname, nocfau, parallelmediarestore, rpc, snapshot, until"

      I have a couple of questions:

      1) these are two different hosts, but the file system names are different, should we be using nofilenamecheck?
      2) when doing a cat of the spfile, even though we put the convert commands in the pfile and then created the spfile from the pfile, it doesn't show the convert commands.
      3) can you use set commands in a run block for convert or should they just be in the pfile?

      The basic path of what we are doing is:

      create pfile with the last two commands of db_file_name_convert and log_file_name_convert

      verify the password file

      stop the listener (aux db)

      shutdown immediate (aux db)

      startup nomount with new pfile (aux db)

      create spfile from new pfile (aux db)

      shutdown abort (aux db)

      startup (aux db)

      start listener

      run rman{ run block command  - see above} --THIS IS WHERE WE ARE STUCK

      duplicate duplicate -- duplicate ---
      success!

      stop the listener (aux db)

      shutdown immediate (aux db)

      startup nomount with new pfile (aux db)

      create spfile from new pfile (aux db)

      shutdown abort (aux db)

      startup (aux db)

      start listener (aux db)

      * The names and passwords have been changed to protect the innocent*
        • 1. Re: Duplicate Database - RMAN - 10.2.0.4
          203141
          Please use without db_file_name_convert in both spfile and in command. it should work.
          • 2. Re: Duplicate Database - RMAN - 10.2.0.4
            DanceRat
            To be clear, use the convert command ONLY in the pfile?
            And also, since the fqfn are different on the target and auxiliary, should we be using the nofilenamecheck? I am not sure about my understanding on that even though I have read through all the docs.
            • 3. Re: Duplicate Database - RMAN - 10.2.0.4
              203141
              Yes, you can either use convert commands in your pfile or spfile (which is being used).

              the correct case would be, you might have missed the starting and ending parenthesis.
              db_file_name_convert = ('/instP_oradata/oradata/','/instT_oradata/oradata/')
              log_file_name_convert = ('/instP_oradata/oradata/','/instT_oradata/oradata/')
              otherwise if you don't want to use these parameters in pfile/spfile, the correct syntax for renaming files in script would be to to get the file#,name as below:
              select file#,file_name from dba_data_files;
              and then use set newname command in your run block:
              clone/staging/rman_commands.lst
              connect target 'sys/targetpw@hostP'
              connect catalog 'rmanprod/rmanpw@rmanP'
              connect auxiliary 'sys/auxpw@hostT'
              run {
              allocate auxiliary channel 'aux_01' type sbt;
              allocate auxiliary channel 'aux_02' type sbt;
              
              send 'NB_ORA_CLIENT=hostP.corp.dom';
              set until time "to_date('24-Jun-11 10:22:00','DD-MON-YY HH24:MI:SS')";
              set newname for datafile 1 to 'D:\oracle\oradata\TEST\system01.dbf’;
              set newname for datafile 2 to 'D:\oracle\oradata\TEST\undo01.dbf’;
              set newname for datafile 5 to 'D:\oracle\oradata\TEST\example01.dbf’;
              set newname for datafile 6 to 'D:\oracle\oradata\TEST\indx01.dbf’;
              ......................
              duplicate target database to auxT nofilenamecheck;
              release channel aux_01;
              release channel aux_02;
              }
              Yes, please use nofilenamecheck as shown above.

              Edited by: RANA on Jun 27, 2011 12:26 AM