Home » RDBMS Server » Backup & Recovery » How to duplicate oracle database in multiple channels? (oracle11gr2)
How to duplicate oracle database in multiple channels? [message #667668] Wed, 10 January 2018 02:45 Go to next message
kalenko
Messages: 40
Registered: January 2018
Member
I saw on the internet, some oracle duplication commands used multi channels:

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.

[Updated on: Wed, 10 January 2018 03:44]

Report message to a moderator

Re: How to duplicate oracle database in multiple channels? [message #667670 is a reply to message #667668] Wed, 10 January 2018 04:13 Go to previous messageGo to next message
Michel Cadot
Messages: 68625
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

Post your script.
Post the execution of it.

Before, Please read How to use [code] tags and make your code easier to read.
No answer to unformatted code.

Re: How to duplicate oracle database in multiple channels? [message #667673 is a reply to message #667670] Wed, 10 January 2018 06:55 Go to previous messageGo to next message
kalenko
Messages: 40
Registered: January 2018
Member
Michel Cadot wrote on Wed, 10 January 2018 04:13

Post your script.
Post the execution of it.

Before, Please read How to use [code] tags and make your code easier to read.
No answer to unformatted code.

I am sorry about the bad format. The four lines above are the duplication log I get from the Internet. I wonder why they can do it but I can not.

[Updated on: Wed, 10 January 2018 07:00]

Report message to a moderator

Re: How to duplicate oracle database in multiple channels? [message #667675 is a reply to message #667673] Wed, 10 January 2018 07:02 Go to previous messageGo to next message
EdStevens
Messages: 1376
Registered: September 2013
Senior Member
kalenko wrote on Wed, 10 January 2018 06:55
Michel Cadot wrote on Wed, 10 January 2018 04:13

Post your script.
Post the execution of it.

Before, Please read How to use [code] tags and make your code easier to read.
No answer to unformatted code.

I am sorry about the bad format. The four lines above are the duplication log I get from the Internet. I wonder why they can do it but I can not.
So do as Michael asked: Post your entire script and the entire run log from executing your script. We're not interested in some snippet you found on the internet to incorporate into your script. We need to see YOUR script. In its entirety. Formatted.
Re: How to duplicate oracle database in multiple channels? [message #667684 is a reply to message #667675] Wed, 10 January 2018 08:40 Go to previous messageGo to next message
kalenko
Messages: 40
Registered: January 2018
Member
Here is the command I use:

duplicate database to vbtest nofilenamecheck backup location '/opt/app/backup/';

and here is the entire log:

Starting Duplicate Db at 10-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_LVL0_20171111_c-3202654855-20171111-01';
   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 10-JAN-18
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=771 device type=DISK

channel ORA_AUX_DISK_1: restoring control file
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
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 10-JAN-18

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

contents of Memory Script:
{
   set until scn  2404015;
   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 10-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 00001 to /opt/app/database/vbtest/datafile/system01.dbf
channel ORA_AUX_DISK_1: restoring datafile 00002 to /opt/app/database/vbtest/datafile/sysaux01.dbf
channel ORA_AUX_DISK_1: restoring datafile 00003 to /opt/app/database/vbtest/datafile/undotbs01.dbf
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_LVL0_20171111_30sjb94o_s96_p1
channel ORA_AUX_DISK_1: piece handle=/opt/app/backup/DB_LVL0_20171111_30sjb94o_s96_p1 tag=TAG20171111T234736
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:01:06
Finished restore at 10-JAN-18

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

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

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

executing command: SET until clause

Starting recover at 10-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=159
channel ORA_AUX_DISK_1: restoring archived log
archived log thread=1 sequence=160
channel ORA_AUX_DISK_1: reading from backup piece /opt/app/backup/AL_LVL0_20171111_32sjb96v_s98_p1
channel ORA_AUX_DISK_1: piece handle=/opt/app/backup/AL_LVL0_20171111_32sjb96v_s98_p1 tag=TAG20171111T234847
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:07
archived log file name=/opt/app/database/vbtest/archivelog/1_159_956019402.dbf thread=1 sequence=159
channel clone_default: deleting archived log(s)
archived log file name=/opt/app/database/vbtest/archivelog/1_159_956019402.dbf RECID=1 STAMP=965025100
archived log file name=/opt/app/database/vbtest/archivelog/1_160_956019402.dbf thread=1 sequence=160
channel clone_default: deleting archived log(s)
archived log file name=/opt/app/database/vbtest/archivelog/1_160_956019402.dbf RECID=2 STAMP=965025102
media recovery complete, elapsed time: 00:00:01
Finished recover at 10-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=965025120
cataloged datafile copy
datafile copy file name=/opt/app/database/vbtest/datafile/undotbs01.dbf RECID=2 STAMP=965025120
cataloged datafile copy
datafile copy file name=/opt/app/database/vbtest/datafile/users01.dbf RECID=3 STAMP=965025120

datafile 2 switched to datafile copy
input datafile copy RECID=1 STAMP=965025120 file name=/opt/app/database/vbtest/datafile/sysaux01.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=2 STAMP=965025120 file name=/opt/app/database/vbtest/datafile/undotbs01.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=3 STAMP=965025120 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 10-JAN-18


You can notice that my duplication process uses only one channel ORA_AUX_DISK_1. So my question is: what do I have to configure rman backup so that when I duplicate database, It will use multi channels.
Re: How to duplicate oracle database in multiple channels? [message #667685 is a reply to message #667684] Wed, 10 January 2018 09:42 Go to previous messageGo to next message
Michel Cadot
Messages: 68625
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

Before DUPLICATE:
CONFIGURE DEVICE TYPE DISK PARALLELISM <n>;
Re: How to duplicate oracle database in multiple channels? [message #667686 is a reply to message #667684] Wed, 10 January 2018 11:54 Go to previous messageGo to next message
EdStevens
Messages: 1376
Registered: September 2013
Senior Member
then you didn't show your full script. Where are the channel allocation commands you referred to in your opening post? You will recall I said " We need to see YOUR script. In its entirety. Formatted." Perhaps I also needed to emphasize "In its entirety". You didn't show the script, you showed one single command from it. Can you debug code you cannot see? Neither can anyone else.
Re: How to duplicate oracle database in multiple channels? [message #667690 is a reply to message #667686] Wed, 10 January 2018 14:20 Go to previous messageGo to next message
Michel Cadot
Messages: 68625
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

The script may be this single command line. Smile

Re: How to duplicate oracle database in multiple channels? [message #667694 is a reply to message #667685] Wed, 10 January 2018 21:27 Go to previous messageGo to next message
kalenko
Messages: 40
Registered: January 2018
Member
Michel Cadot wrote on Wed, 10 January 2018 09:42

Before DUPLICATE:
CONFIGURE DEVICE TYPE DISK PARALLELISM <n>;
Before DUPLICATE, rman starts nomount instance, so we cannot use the configure command above.
Re: How to duplicate oracle database in multiple channels? [message #667699 is a reply to message #667694] Thu, 11 January 2018 00:58 Go to previous messageGo to next message
Michel Cadot
Messages: 68625
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

So do it BEFORE shutting down the database!

By the way, why did you shut it down?

[Updated on: Thu, 11 January 2018 01:11]

Report message to a moderator

Re: How to duplicate oracle database in multiple channels? [message #667700 is a reply to message #667694] Thu, 11 January 2018 01:24 Go to previous messageGo to next message
John Watson
Messages: 8922
Registered: January 2010
Location: Global Village
Senior Member
run{allocate auxiliary channel a1 type disk;
allocate auxiliary channel a2 type disk;
allocate auxiliary channel a3 type disk;
allocate auxiliary channel a4 type disk;
duplicate database to vbtest nofilenamecheck backup location '/opt/app/backup/';}
However, there is no point because your entire backup is in one backup set. So you can't parallelize anything.
Re: How to duplicate oracle database in multiple channels? [message #667703 is a reply to message #667700] Thu, 11 January 2018 03:10 Go to previous messageGo to next message
kalenko
Messages: 40
Registered: January 2018
Member
John Watson wrote on Thu, 11 January 2018 01:24
run{allocate auxiliary channel a1 type disk;
allocate auxiliary channel a2 type disk;
allocate auxiliary channel a3 type disk;
allocate auxiliary channel a4 type disk;
duplicate database to vbtest nofilenamecheck backup location '/opt/app/backup/';}
However, there is no point because your entire backup is in one backup set. So you can't parallelize anything.
OK, I will backup using multi channels and there will be multi backup sets.
By the way, can we configure automatic multi channels for duplication?

[Updated on: Thu, 11 January 2018 03:21]

Report message to a moderator

Re: How to duplicate oracle database in multiple channels? [message #667707 is a reply to message #667690] Thu, 11 January 2018 06:18 Go to previous messageGo to next message
EdStevens
Messages: 1376
Registered: September 2013
Senior Member
Michel Cadot wrote on Wed, 10 January 2018 14:20

The script may be this single command line. Smile

But the OP stated he was allocating multiple channels, which would have required more to the script than the single DUPLICATE command.
Re: How to duplicate oracle database in multiple channels? [message #667718 is a reply to message #667703] Thu, 11 January 2018 09:34 Go to previous messageGo to next message
Michel Cadot
Messages: 68625
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

kalenko wrote on Thu, 11 January 2018 10:10

By the way, can we configure automatic multi channels for duplication?

Michel Cadot wrote on Wed, 10 January 2018 16:42

CONFIGURE DEVICE TYPE DISK PARALLELISM <n>;
Re: How to duplicate oracle database in multiple channels? [message #667726 is a reply to message #667718] Thu, 11 January 2018 20:12 Go to previous messageGo to next message
kalenko
Messages: 40
Registered: January 2018
Member
Michel Cadot wrote on Thu, 11 January 2018 09:34

kalenko wrote on Thu, 11 January 2018 10:10

By the way, can we configure automatic multi channels for duplication?
Michel Cadot wrote on Wed, 10 January 2018 16:42

CONFIGURE DEVICE TYPE DISK PARALLELISM <n>;
Before running the duplicate command, I start nomount instance, so I cannot apply the command you give.
SQL> startup nomount pfile='/opt/app/temp/initvbtest.ora';
$ rman auxiliary /
RMAN> duplicate database to vbtest nofilenamecheck backup location '/opt/app/backup/';

RMAN> CONFIGURE DEVICE TYPE DISK PARALLELISM 4;

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of configure command at 01/11/2018 18:17:56
RMAN-06136: ORACLE error from auxiliary database: ORA-01507: database not mounted

RMAN> 

[Updated on: Thu, 11 January 2018 20:29]

Report message to a moderator

Re: How to duplicate oracle database in multiple channels? [message #667729 is a reply to message #667726] Fri, 12 January 2018 00:41 Go to previous messageGo to next message
Michel Cadot
Messages: 68625
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

You can configure and "configure automatic multi channels" only if you are connected to the TARGET (in RMAN meaning, source in the common meaning).

Re: How to duplicate oracle database in multiple channels? [message #668408 is a reply to message #667729] Fri, 23 February 2018 02:25 Go to previous messageGo to next message
kalenko
Messages: 40
Registered: January 2018
Member
Michel Cadot wrote on Fri, 12 January 2018 00:41

You can configure and "configure automatic multi channels" only if you are connected to the TARGET (in RMAN meaning, source in the common meaning).

Yes, I already connected to the target, but It can not help, the error message is the same.
Re: How to duplicate oracle database in multiple channels? [message #668409 is a reply to message #668408] Fri, 23 February 2018 02:32 Go to previous messageGo to next message
Michel Cadot
Messages: 68625
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

This is not what you have posted.
You are only connected to the auxiliary.

Re: How to duplicate oracle database in multiple channels? [message #668410 is a reply to message #668409] Fri, 23 February 2018 03:23 Go to previous messageGo to next message
kalenko
Messages: 40
Registered: January 2018
Member
Michel Cadot wrote on Fri, 23 February 2018 02:32

This is not what you have posted.
You are only connected to the auxiliary.

Here is the full log:
[oracle@localhost ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Fri Feb 23 01:18:54 2018

Copyright (c) 1982, 2009, Oracle.  All rights reserved.

Connected to an idle instance.

SQL> startup nomount pfile='/opt/app/temp/initvbtest.ora';
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
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@localhost ~]$ rman target /

Recovery Manager: Release 11.2.0.1.0 - Production on Fri Feb 23 01:19:51 2018

Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

connected to target database: VBTEST (not mounted)

RMAN> CONFIGURE DEVICE TYPE DISK PARALLELISM 4;

using target database control file instead of recovery catalog
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of configure command at 02/23/2018 01:20:12
ORA-01507: database not mounted

RMAN> 


Please help!
Re: How to duplicate oracle database in multiple channels? [message #668430 is a reply to message #668410] Fri, 23 February 2018 10:24 Go to previous messageGo to next message
Michel Cadot
Messages: 68625
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

OK, this is consistent, what don't you understand?

Re: How to duplicate oracle database in multiple channels? [message #669778 is a reply to message #668430] Fri, 11 May 2018 03:18 Go to previous message
kalenko
Messages: 40
Registered: January 2018
Member
OK, I use the statement below to connect to both auxiliary and target database:

$ rman auxiliary / target sys@vbcms_pri

and finally I can duplicate database using automatic multi channels.
Thanks.
Previous Topic: Restore datafile after RMAN backup taken
Next Topic: RMAN and Dataguard
Goto Forum:
  


Current Time: Thu Mar 28 18:38:18 CDT 2024