Friday, August 4, 2017

RMAN-06034: at least 1 channel must be allocated to execute this command

Sometimes we are in hurry and overlook at things or copy paste the scripts and get into all sorts of troubles.

I was trying to speed up the creation of dataguard instance for our huge database and my script was erroring

RMAN-06034: at least 1 channel must be allocated to execute this command

Now what is this I did the things alright but why I am getting the error.

My script was :

RMAN> run {
2> allocate auxiliary channel ch1 type disk;
3> allocate auxiliary channel ch2 type disk;
4> allocate auxiliary channel ch3 type disk;
5> allocate auxiliary channel ch4 type disk;
6> allocate auxiliary channel stby1 type disk;
7> allocate auxiliary channel stby2 type disk;
8> allocate auxiliary channel stby3 type disk;
9> allocate auxiliary channel stby4 type disk;
10> duplicate target database for standby from active database
11> spfile
12> set audit_file_dest='/u01/app/oracle/admin/dev1tstd/adump'
13> set db_unique_name='dev1tstd'
14> set fal_server='dev1tstp1','dev1tstp2'
15> set instance_number='1'
16> NOFILENAMECHECK;
17> }


and error was

Starting backup at 03-AUG-17
released channel: ch1
released channel: ch2
released channel: ch3
released channel: ch4
released channel: stby1
released channel: stby2
released channel: stby3
released channel: stby4
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 08/03/2017 11:41:11
RMAN-05501: aborting duplication of target database
RMAN-03015: error occurred in stored script Memory Script
RMAN-06034: at least 1 channel must be allocated to execute this command

After having a closer look what I have found the issue. I was only allocating the auxiliary channels and that is what the error was saying as well. So it was fixed by 

run {
allocate channel ch1 type disk;
allocate channel ch2 type disk;
allocate channel ch3 type disk;
allocate channel ch4 type disk;
allocate auxiliary channel stby1 type disk;
allocate auxiliary channel stby2 type disk;
allocate auxiliary channel stby3 type disk;
allocate auxiliary channel stby4 type disk;
duplicate target database for standby from active database
spfile
set audit_file_dest='/u01/app/oracle/admin/dev1tstd/adump'
set db_unique_name='dev1tstd'
set fal_server='dev1tstp1','dev1tstp2'
set instance_number='1'
NOFILENAMECHECK;
}


Allocating more channels definitely helped my creating the dataguard instance much quicker but I still have to test how helpful were those multiple auxiliary channels.


No comments: