1. Get rid of all advertisements and get unlimited access to documents by upgrading to Premium Membership. Upgrade to Premium Now and also get a Premium Badge!

How to duplicate oracle database in multiple channels?

Discussion in 'Security, Backup and Recovery' started by kalenko, Jan 10, 2018.

  1. kalenko

    kalenko Starter

    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    10
    Location:
    Vietnam
    I saw on the internet, some oracle duplication commands used multi channels. Their log looks like:

    ...
    using channel ORA_AUX_DISK_1
    using channel ORA_AUX_DISK_2
    using channel ORA_AUX_DISK_3
    using channel ORA_AUX_DISK_4...

    However, when I perform duplication, the rman uses only one channel ORA_AUX_DISK_1. And the performance is very bad. Please tell me how to configure rman when backup to use multi channels to improve duplication performance when duplication. (I duplicate oracle database without target connection.)

    Thanks.
     
    Last edited: Jan 10, 2018
  2. zargon

    zargon Community Moderator Forum Guru

    Messages:
    2,564
    Likes Received:
    362
    Trophy Points:
    1,430
    Location:
    Aurora, CO
    You need to allocate multiple channels before the actual backup begins:

    RUN {
    ALLOCATE CHANNEL CH1 TYPE DISK;
    ALLOCATE CHANNEL CH2 TYPE DISK;
    ALLOCATE CHANNEL CH3 TYPE DISK;
    ALLOCATE CHANNEL CH4 TYPE DISK;

    BACKUP
    ...

    You can't use channels you haven't allocated.
     
  3. kalenko

    kalenko Starter

    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    10
    Location:
    Vietnam
    I follow your instruction, the backup runs in multi channels. But the duplication runs in only one channel. Please tell me how to persist configuration from backup to duplication.

    Thanks.
     
    Last edited: Jan 11, 2018
  4. zargon

    zargon Community Moderator Forum Guru

    Messages:
    2,564
    Likes Received:
    362
    Trophy Points:
    1,430
    Location:
    Aurora, CO
    You need to post the script you're using for duplication. When someone can SEE what you're doing then maybe suggestions can be offered.
     
  5. kalenko

    kalenko Starter

    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    10
    Location:
    Vietnam
    Here is the script I use:
    Code (Text):
    SQL> startup nomount pfile='/opt/app/temp/initvbtest.ora';
    $ rman auxiliary /
    RMAN> duplicate database to vbtest nofilenamecheck backup location '/opt/app/backup/';
     
    And here is the duplication log:
    Code (Text):
    Starting Duplicate Db at 11-JAN-18

    contents of Memory Script:
    {
       sql clone "create spfile from memory";
    }
    executing Memory Script

    sql statement: create spfile from memory

    contents of Memory Script:
    {
       shutdown clone immediate;
       startup clone nomount;
    }
    executing Memory Script

    Oracle instance shut down

    connected to auxiliary database (not started)
    Oracle instance started

    Total System Global Area     246349824 bytes

    Fixed Size                     2212288 bytes
    Variable Size                213913152 bytes
    Database Buffers              25165824 bytes
    Redo Buffers                   5058560 bytes

    contents of Memory Script:
    {
       sql clone "alter system set  db_name =
    ''VBCMS'' comment=
    ''Modified by RMAN duplicate'' scope=spfile";
       sql clone "alter system set  db_unique_name =
    ''VBTEST'' comment=
    ''Modified by RMAN duplicate'' scope=spfile";
       shutdown clone immediate;
       startup clone force nomount
       restore clone primary controlfile from  '/opt/app/backup/ctl_vbcms_LVL0_2018_Jan_10_20180110_c-3202654855-20180110-03';
       alter clone database mount;
    }
    executing Memory Script

    sql statement: alter system set  db_name =  ''VBCMS'' comment= ''Modified by RMAN duplicate'' scope=spfile

    sql statement: alter system set  db_unique_name =  ''VBTEST'' comment= ''Modified by RMAN duplicate'' scope=spfile

    Oracle instance shut down

    Oracle instance started

    Total System Global Area     246349824 bytes

    Fixed Size                     2212288 bytes
    Variable Size                213913152 bytes
    Database Buffers              25165824 bytes
    Redo Buffers                   5058560 bytes

    Starting restore at 11-JAN-18
    allocated channel: ORA_AUX_DISK_1
    channel ORA_AUX_DISK_1: SID=762 device type=DISK

    channel ORA_AUX_DISK_1: restoring control file
    channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:04
    output file name=/opt/app/database/vbtest/controlfile/control01.ctl
    output file name=/opt/app/database/flash_recovery_area/vbtest/controlfile/control02.ctl
    Finished restore at 11-JAN-18

    database mounted
    released channel: ORA_AUX_DISK_1
    allocated channel: ORA_AUX_DISK_1
    channel ORA_AUX_DISK_1: SID=762 device type=DISK

    contents of Memory Script:
    {
       set until scn  3061984;
       set newname for datafile  1 to
    "/opt/app/database/vbtest/datafile/system01.dbf";
       set newname for datafile  2 to
    "/opt/app/database/vbtest/datafile/sysaux01.dbf";
       set newname for datafile  3 to
    "/opt/app/database/vbtest/datafile/undotbs01.dbf";
       set newname for datafile  4 to
    "/opt/app/database/vbtest/datafile/users01.dbf";
       restore
       clone database
       ;
    }
    executing Memory Script

    executing command: SET until clause

    executing command: SET NEWNAME

    executing command: SET NEWNAME

    executing command: SET NEWNAME

    executing command: SET NEWNAME

    Starting restore at 11-JAN-18
    using channel ORA_AUX_DISK_1

    channel ORA_AUX_DISK_1: starting datafile backup set restore
    channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
    channel ORA_AUX_DISK_1: restoring datafile 00003 to /opt/app/database/vbtest/datafile/undotbs01.dbf
    channel ORA_AUX_DISK_1: reading from backup piece /opt/app/backup/DB_VBCMS_LVL0_2018_Jan_10_20180110_9bsoc2b8_s299_p1
    channel ORA_AUX_DISK_1: piece handle=/opt/app/backup/DB_VBCMS_LVL0_2018_Jan_10_20180110_9bsoc2b8_s299_p1 tag=TAG20180110T231904
    channel ORA_AUX_DISK_1: restored backup piece 1
    channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:07
    channel ORA_AUX_DISK_1: starting datafile backup set restore
    channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
    channel ORA_AUX_DISK_1: restoring datafile 00001 to /opt/app/database/vbtest/datafile/system01.dbf
    channel ORA_AUX_DISK_1: reading from backup piece /opt/app/backup/DB_VBCMS_LVL0_2018_Jan_10_20180110_99soc2b8_s297_p1
    channel ORA_AUX_DISK_1: piece handle=/opt/app/backup/DB_VBCMS_LVL0_2018_Jan_10_20180110_99soc2b8_s297_p1 tag=TAG20180110T231904
    channel ORA_AUX_DISK_1: restored backup piece 1
    channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:01:05
    channel ORA_AUX_DISK_1: starting datafile backup set restore
    channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
    channel ORA_AUX_DISK_1: restoring datafile 00004 to /opt/app/database/vbtest/datafile/users01.dbf
    channel ORA_AUX_DISK_1: reading from backup piece /opt/app/backup/DB_VBCMS_LVL0_2018_Jan_10_20180110_9csoc2b8_s300_p1
    channel ORA_AUX_DISK_1: piece handle=/opt/app/backup/DB_VBCMS_LVL0_2018_Jan_10_20180110_9csoc2b8_s300_p1 tag=TAG20180110T231904
    channel ORA_AUX_DISK_1: restored backup piece 1
    channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
    channel ORA_AUX_DISK_1: starting datafile backup set restore
    channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
    channel ORA_AUX_DISK_1: restoring datafile 00002 to /opt/app/database/vbtest/datafile/sysaux01.dbf
    channel ORA_AUX_DISK_1: reading from backup piece /opt/app/backup/DB_VBCMS_LVL0_2018_Jan_10_20180110_9asoc2b8_s298_p1
    channel ORA_AUX_DISK_1: piece handle=/opt/app/backup/DB_VBCMS_LVL0_2018_Jan_10_20180110_9asoc2b8_s298_p1 tag=TAG20180110T231904
    channel ORA_AUX_DISK_1: restored backup piece 1
    channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:35
    Finished restore at 11-JAN-18

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

    datafile 1 switched to datafile copy
    input datafile copy RECID=5 STAMP=965152984 file name=/opt/app/database/vbtest/datafile/system01.dbf
    datafile 2 switched to datafile copy
    input datafile copy RECID=6 STAMP=965152984 file name=/opt/app/database/vbtest/datafile/sysaux01.dbf
    datafile 3 switched to datafile copy
    input datafile copy RECID=7 STAMP=965152984 file name=/opt/app/database/vbtest/datafile/undotbs01.dbf
    datafile 4 switched to datafile copy
    input datafile copy RECID=8 STAMP=965152984 file name=/opt/app/database/vbtest/datafile/users01.dbf

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

    executing command: SET until clause

    Starting recover at 11-JAN-18
    using channel ORA_AUX_DISK_1

    starting media recovery

    channel ORA_AUX_DISK_1: starting archived log restore to default destination
    channel ORA_AUX_DISK_1: restoring archived log
    archived log thread=1 sequence=271
    channel ORA_AUX_DISK_1: reading from backup piece /opt/app/backup/AL_VBCMS_LVL0_2018_Jan_10_20180110_9dsoc2d0_s301_p1
    channel ORA_AUX_DISK_1: piece handle=/opt/app/backup/AL_VBCMS_LVL0_2018_Jan_10_20180110_9dsoc2d0_s301_p1 tag=TAG20180110T232000
    channel ORA_AUX_DISK_1: restored backup piece 1
    channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
    archived log file name=/opt/app/database/vbtest/archivelog/1_271_956019402.dbf thread=1 sequence=271
    channel clone_default: deleting archived log(s)
    archived log file name=/opt/app/database/vbtest/archivelog/1_271_956019402.dbf RECID=1 STAMP=965152986
    media recovery complete, elapsed time: 00:00:01
    Finished recover at 11-JAN-18

    contents of Memory Script:
    {
       shutdown clone immediate;
       startup clone nomount;
       sql clone "alter system set  db_name =
    ''VBTEST'' comment=
    ''Reset to original value by RMAN'' scope=spfile";
       sql clone "alter system reset  db_unique_name scope=spfile";
       shutdown clone immediate;
       startup clone nomount;
    }
    executing Memory Script

    database dismounted
    Oracle instance shut down

    connected to auxiliary database (not started)
    Oracle instance started

    Total System Global Area     246349824 bytes

    Fixed Size                     2212288 bytes
    Variable Size                230690368 bytes
    Database Buffers               8388608 bytes
    Redo Buffers                   5058560 bytes

    sql statement: alter system set  db_name =  ''VBTEST'' comment= ''Reset to original value by RMAN'' scope=spfile

    sql statement: alter system reset  db_unique_name scope=spfile

    Oracle instance shut down

    connected to auxiliary database (not started)
    Oracle instance started

    Total System Global Area     246349824 bytes

    Fixed Size                     2212288 bytes
    Variable Size                230690368 bytes
    Database Buffers               8388608 bytes
    Redo Buffers                   5058560 bytes
    sql statement: CREATE CONTROLFILE REUSE SET DATABASE "VBTEST" RESETLOGS ARCHIVELOG
      MAXLOGFILES     30
      MAXLOGMEMBERS      5
      MAXDATAFILES      100
      MAXINSTANCES     8
      MAXLOGHISTORY      292
    LOGFILE
      GROUP  1 ( '/opt/app/database/vbtest/onlinelog/redo01.log' ) SIZE 50 M  REUSE,
      GROUP  2 ( '/opt/app/database/vbtest/onlinelog/redo02.log' ) SIZE 50 M  REUSE,
      GROUP  3 ( '/opt/app/database/vbtest/onlinelog/redo03.log' ) SIZE 50 M  REUSE
    DATAFILE
      '/opt/app/database/vbtest/datafile/system01.dbf'
    CHARACTER SET AL32UTF8


    contents of Memory Script:
    {
       set newname for tempfile  1 to
    "/opt/app/database/vbtest/datafile/temp01.dbf";
       switch clone tempfile all;
       catalog clone datafilecopy  "/opt/app/database/vbtest/datafile/sysaux01.dbf",
    "/opt/app/database/vbtest/datafile/undotbs01.dbf",
    "/opt/app/database/vbtest/datafile/users01.dbf";
       switch clone datafile all;
    }
    executing Memory Script

    executing command: SET NEWNAME

    renamed tempfile 1 to /opt/app/database/vbtest/datafile/temp01.dbf in control file

    cataloged datafile copy
    datafile copy file name=/opt/app/database/vbtest/datafile/sysaux01.dbf RECID=1 STAMP=965153002
    cataloged datafile copy
    datafile copy file name=/opt/app/database/vbtest/datafile/undotbs01.dbf RECID=2 STAMP=965153002
    cataloged datafile copy
    datafile copy file name=/opt/app/database/vbtest/datafile/users01.dbf RECID=3 STAMP=965153002

    datafile 2 switched to datafile copy
    input datafile copy RECID=1 STAMP=965153002 file name=/opt/app/database/vbtest/datafile/sysaux01.dbf
    datafile 3 switched to datafile copy
    input datafile copy RECID=2 STAMP=965153002 file name=/opt/app/database/vbtest/datafile/undotbs01.dbf
    datafile 4 switched to datafile copy
    input datafile copy RECID=3 STAMP=965153002 file name=/opt/app/database/vbtest/datafile/users01.dbf

    contents of Memory Script:
    {
       Alter clone database open resetlogs;
    }
    executing Memory Script

    database opened
    Finished Duplicate Db at 11-JAN-18
     
    You can notice that there is only one automatic channel ORA_AUX_DISK_1. My question is: What do I configure to use multi automatic channels for duplication ? Please help.

    Thanks
     
    Last edited: Jan 12, 2018
  6. zargon

    zargon Community Moderator Forum Guru

    Messages:
    2,564
    Likes Received:
    362
    Trophy Points:
    1,430
    Location:
    Aurora, CO
    You have only one auxiliary channel open so how can you expect to use more than that? Allocate more auxiliary channels and the duplicate will use them.