3 Replies Latest reply: Nov 8, 2012 7:27 PM by Patrik Haaparanta RSS

    Creating active standby database using RMAN Duplicate command

    Raj Kumar K
      Hello guys,

      I'm trying to created standby database using RMAN Duplicate command but here I got stuck.

      Please help me to overcome to this>

      RMAN> run {
      2> allocate channel prmy1 type disk;
      3> allocate channel prmy2 type disk;
      4> allocate channel prmy3 type disk;
      5> allocate channel prmy4 type disk;
      6> allocate auxiliary channel stby type disk;
      7> duplicate target database for standby from active database
      8> spfile
      9> parameter_value_convert 'orcl','orclstd'
      10> set db_unique_name='orclstd'
      11> set db_file_name_convert='/orcl/','/orclstd/'
      12> set log_file_name_convert='/orcl/','/orclstd/'
      13> set control_files="D:\app\employee3\oradata\ORCLSTD\control01.ctl", "D:\app\employee3\flash_recovery_area\ORCLSTD\control02.ctl"
      14> set log_archive_max_processes='5'
      15> set fal_client='orclstd'
      16> set fal_server='orcl'
      17> set diagnostic_dest='D:\app\employee3'
      18> set db_recovery_file_dest='D:\app\employee3\flash_recovery_area'
      19> set standby_file_management='AUTO'
      20> set log_archive_config='dg_config=(orcl,orclstd)'
      21> set log_archive_dest_2='service=orcl ASYNC valid_for=(ONLINE_LOGFILE,PRIMARY_ROLE) db_unique_name=orclstd';
      22> }

      allocated channel: prmy1
      channel prmy1: SID=70 device type=DISK

      allocated channel: prmy2
      channel prmy2: SID=135 device type=DISK

      allocated channel: prmy3
      channel prmy3: SID=191 device type=DISK

      allocated channel: prmy4
      channel prmy4: SID=7 device type=DISK

      allocated channel: stby
      channel stby: SID=129 device type=DISK

      Starting Duplicate Db at 07-NOV-12

      contents of Memory Script:
      {
      backup as copy reuse
      targetfile 'E:\app\RAJKUMAR\product\11.2.0\dbhome_1\DATABASE\PWDorcl.ORA' auxiliary format
      'D:\app\employee3\product\11gr2\DATABASE\PWDorclstd.ORA' targetfile
      'E:\APP\RAJKUMAR\PRODUCT\11.2.0\DBHOME_1\DATABASE\SPFILEORCL.ORA' auxiliary format
      'D:\APP\EMPLOYEE3\PRODUCT\11GR2\DATABASE\SPFILEORCLSTD.ORA' ;
      sql clone "alter system set spfile= ''D:\APP\EMPLOYEE3\PRODUCT\11GR2\DATABASE\SPFILEORCLSTD.ORA''";
      }
      executing Memory Script

      Starting backup at 07-NOV-12
      Finished backup at 07-NOV-12

      sql statement: alter system set spfile= ''D:\APP\EMPLOYEE3\PRODUCT\11GR2\DATABASE\SPFILEORCLSTD.ORA''

      contents of Memory Script:
      {
      sql clone "alter system set audit_file_dest =
      ''E:\app\RAJKUMAR\admin\orclstd\adump'' comment=
      '''' scope=spfile";
      sql clone "alter system set dispatchers =
      ''(PROTOCOL=TCP) (SERVICE=orclstdXDB)'' comment=
      '''' scope=spfile";
      sql clone "alter system set db_unique_name =
      ''orclstd'' comment=
      '''' scope=spfile";
      sql clone "alter system set db_file_name_convert =
      ''/orcl/'', ''/orclstd/'' comment=
      '''' scope=spfile";
      sql clone "alter system set log_file_name_convert =
      ''/orcl/'', ''/orclstd/'' comment=
      '''' scope=spfile";
      sql clone "alter system set control_files =
      ''D:\app\employee3\oradata\ORCLSTD\control01.ctl'', ''D:\app\employee3\flash_recovery_area\ORCLSTD\control02.ctl'' comment=
      '''' scope=spfile";
      sql clone "alter system set log_archive_max_processes =
      5 comment=
      '''' scope=spfile";
      sql clone "alter system set fal_client =
      ''orclstd'' comment=
      '''' scope=spfile";
      sql clone "alter system set fal_server =
      ''orcl'' comment=
      '''' scope=spfile";
      sql clone "alter system set diagnostic_dest =
      ''D:\app\employee3'' comment=
      '''' scope=spfile";
      sql clone "alter system set db_recovery_file_dest =
      ''D:\app\employee3\flash_recovery_area'' comment=
      '''' scope=spfile";
      sql clone "alter system set standby_file_management =
      ''AUTO'' comment=
      '''' scope=spfile";
      sql clone "alter system set log_archive_config =
      ''dg_config=(orcl,orclstd)'' comment=
      '''' scope=spfile";
      sql clone "alter system set log_archive_dest_2 =
      ''service=orcl ASYNC valid_for=(ONLINE_LOGFILE,PRIMARY_ROLE) db_unique_name=orclstd'' comment=
      '''' scope=spfile";
      shutdown clone immediate;
      startup clone nomount;
      }
      executing Memory Script

      sql statement: alter system set audit_file_dest = ''E:\app\RAJKUMAR\admin\orclstd\adump'' comment= '''' scope=spfile

      sql statement: alter system set dispatchers = ''(PROTOCOL=TCP) (SERVICE=orclstdXDB)'' comment= '''' scope=spfile

      sql statement: alter system set db_unique_name = ''orclstd'' comment= '''' scope=spfile

      sql statement: alter system set db_file_name_convert = ''/orcl/'', ''/orclstd/'' comment= '''' scope=spfile

      sql statement: alter system set log_file_name_convert = ''/orcl/'', ''/orclstd/'' comment= '''' scope=spfile

      sql statement: alter system set control_files = ''D:\app\employee3\oradata\ORCLSTD\control01.ctl'', ''D:\app\employee3\flash_recovery_area\ORCLSTD\control
      02.ctl'' comment= '''' scope=spfile

      sql statement: alter system set log_archive_max_processes = 5 comment= '''' scope=spfile

      sql statement: alter system set fal_client = ''orclstd'' comment= '''' scope=spfile

      sql statement: alter system set fal_server = ''orcl'' comment= '''' scope=spfile

      sql statement: alter system set diagnostic_dest = ''D:\app\employee3'' comment= '''' scope=spfile

      sql statement: alter system set db_recovery_file_dest = ''D:\app\employee3\flash_recovery_area'' comment= '''' scope=spfile

      sql statement: alter system set standby_file_management = ''AUTO'' comment= '''' scope=spfile

      sql statement: alter system set log_archive_config = ''dg_config=(orcl,orclstd)'' comment= '''' scope=spfile

      sql statement: alter system set log_archive_dest_2 = ''service=orcl ASYNC valid_for=(ONLINE_LOGFILE,PRIMARY_ROLE) db_unique_name=orclstd'' comment= '''' s
      cope=spfile

      Oracle instance shut down

      connected to auxiliary database (not started)
      Oracle instance started

      Total System Global Area 1071333376 bytes

      Fixed Size 1375792 bytes
      Variable Size 528482768 bytes
      Database Buffers 536870912 bytes
      Redo Buffers 4603904 bytes
      allocated channel: stby
      channel stby: SID=63 device type=DISK

      contents of Memory Script:
      {
      backup as copy current controlfile for standby auxiliary format 'D:\APP\EMPLOYEE3\ORADATA\ORCLSTD\CONTROL01.CTL';
      restore clone controlfile to 'D:\APP\EMPLOYEE3\FLASH_RECOVERY_AREA\ORCLSTD\CONTROL02.CTL' from
      'D:\APP\EMPLOYEE3\ORADATA\ORCLSTD\CONTROL01.CTL';
      }
      executing Memory Script

      Starting backup at 07-NOV-12
      channel prmy1: starting datafile copy
      copying standby control file
      output file name=E:\APP\RAJKUMAR\PRODUCT\11.2.0\DBHOME_1\DATABASE\SNCFORCL.ORA tag=TAG20121107T171229 RECID=1 STAMP=798743550
      channel prmy1: datafile copy complete, elapsed time: 00:00:03
      Finished backup at 07-NOV-12

      Starting restore at 07-NOV-12

      channel stby: copied control file copy
      Finished restore at 07-NOV-12

      contents of Memory Script:
      {
      sql clone 'alter database mount standby database';
      }
      executing Memory Script

      sql statement: alter database mount standby database
      released channel: prmy1
      released channel: prmy2
      released channel: prmy3
      released channel: prmy4
      released channel: stby
      RMAN-00571: ===========================================================
      RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
      RMAN-00571: ===========================================================
      RMAN-03002: failure of Duplicate Db command at 11/07/2012 17:12:40
      RMAN-05501: aborting duplication of target database
      RMAN-05001: auxiliary file name E:\APP\RAJKUMAR\ORADATA\ORCL\MIGRATION_DATA01.DBF conflicts with a file used by the target database
      RMAN-05001: auxiliary file name E:\APP\RAJKUMAR\ORADATA\ORCL\DEMO_INDX01.DBF conflicts with a file used by the target database
      RMAN-05001: auxiliary file name E:\APP\RAJKUMAR\ORADATA\ORCL\DEMO_DATA01.DBF conflicts with a file used by the target database
      RMAN-05001: auxiliary file name E:\APP\RAJKUMAR\ORADATA\ORCL\USERS01.DBF conflicts with a file used by the target database
      RMAN-05001: auxiliary file name E:\APP\RAJKUMAR\ORADATA\ORCL\UNDOTBS01.DBF conflicts with a file used by the target database
      RMAN-05001: auxiliary file name E:\APP\RAJKUMAR\ORADATA\ORCL\SYSAUX01.DBF conflicts with a file used by the target database
      RMAN-05001: auxiliary file name E:\APP\RAJKUMAR\ORADATA\ORCL\SYSTEM01.DBF conflicts with a file used by the target database

      RMAN>

      Thanks,
      RajKumar
        • 1. Re: Creating active standby database using RMAN Duplicate command
          Balazs Papp
          11> set db_file_name_convert='/orcl/','/orclstd/'
          12> set log_file_name_convert='/orcl/','/orclstd/'
          RMAN-05001: auxiliary file name E:\APP\RAJKUMAR\ORADATA\ORCL\MIGRATION_DATA01.DBF conflicts with a file used by the target database
          RMAN-05001: auxiliary file name E:\APP\RAJKUMAR\ORADATA\ORCL\DEMO_INDX01.DBF conflicts with a file used by the target database
          RMAN-05001: auxiliary file name E:\APP\RAJKUMAR\ORADATA\ORCL\DEMO_DATA01.DBF conflicts with a file used by the target database
          RMAN-05001: auxiliary file name E:\APP\RAJKUMAR\ORADATA\ORCL\USERS01.DBF conflicts with a file used by the target database
          RMAN-05001: auxiliary file name E:\APP\RAJKUMAR\ORADATA\ORCL\UNDOTBS01.DBF conflicts with a file used by the target database
          RMAN-05001: auxiliary file name E:\APP\RAJKUMAR\ORADATA\ORCL\SYSAUX01.DBF conflicts with a file used by the target database
          RMAN-05001: auxiliary file name E:\APP\RAJKUMAR\ORADATA\ORCL\SYSTEM01.DBF conflicts with a file used by the target database
          '/' doesnt equal '\'
          • 2. Re: Creating active standby database using RMAN Duplicate command
            mseberg
            Hello;

            Here are my notes :

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

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


            Best Regards

            mseberg
            • 3. Re: Creating active standby database using RMAN Duplicate command
              Patrik Haaparanta
              user9192565 wrote:
              11> set db_file_name_convert='/orcl/','/orclstd/'
              12> set log_file_name_convert='/orcl/','/orclstd/'
              RMAN-05001: auxiliary file name E:\APP\RAJKUMAR\ORADATA\ORCL\MIGRATION_DATA01.DBF conflicts with a file used by the target database
              RMAN-05001: auxiliary file name E:\APP\RAJKUMAR\ORADATA\ORCL\DEMO_INDX01.DBF conflicts with a file used by the target database
              RMAN-05001: auxiliary file name E:\APP\RAJKUMAR\ORADATA\ORCL\DEMO_DATA01.DBF conflicts with a file used by the target database
              RMAN-05001: auxiliary file name E:\APP\RAJKUMAR\ORADATA\ORCL\USERS01.DBF conflicts with a file used by the target database
              RMAN-05001: auxiliary file name E:\APP\RAJKUMAR\ORADATA\ORCL\UNDOTBS01.DBF conflicts with a file used by the target database
              RMAN-05001: auxiliary file name E:\APP\RAJKUMAR\ORADATA\ORCL\SYSAUX01.DBF conflicts with a file used by the target database
              RMAN-05001: auxiliary file name E:\APP\RAJKUMAR\ORADATA\ORCL\SYSTEM01.DBF conflicts with a file used by the target database
              The strings you entered in your file name convert parameters does not seem to match where your datafiles are actually located. If the string doesn't match the filenames, there's no filenames to convert. Seeing as you're on windows, how about something like this?
              set db_file_name_convert='\ORCL\','\ORCLSTD\'
              set log_file_name_convert='\ORCL\','\ORCLSTD\'
              Hope that helps...

              Patrik