The Problem

We were trying to run a RMAN script (running the duplicate database) from a Oracle 12c environment onto a 19c environment. The script worked perfectly fine on the 12c databases but was giving below error when run on a 19c database:

RUN
{
allocate auxiliary channel d1 device type disk maxpiecesize 20G;
allocate auxiliary channel d2 device type disk maxpiecesize 20G;
allocate auxiliary channel d3 device type disk maxpiecesize 20G;
allocate auxiliary channel d4 device type disk maxpiecesize 20G;
allocate auxiliary channel d5 device type disk maxpiecesize 20G;
allocate auxiliary channel d6 device type disk maxpiecesize 20G;
allocate auxiliary channel d7 device type disk maxpiecesize 20G;
allocate auxiliary channel d8 device type disk maxpiecesize 20G;

DUPLICATE DATABASE [target database name] TO [auxiliary database name]
BACKUP LOCATION '/[path]/backup'
LOGFILE
....
....
...
release channel d1;
release channel d2;
release channel d3;
release channel d4;
release channel d5;
release channel d6;
release channel d7;
release channel d8;
}

...............

RMAN-00571: ===========================================================
RMAN-03002: failure of release command at 03/08/2021 10:33:53
RMAN-06012: channel: d1 not allocated

The Solution

Apparently, it seems that starting 19c the channels are release automatically after recovery with dupicate and there is no need to add the “release channel xx” statement in the RMAN script. So in order to make sure the script run in the 19c environment simply remove the release statements from the below script:

RUN
{
allocate auxiliary channel d1 device type disk ;
allocate auxiliary channel d2 device type disk ;
allocate auxiliary channel d3 device type disk ;
allocate auxiliary channel d4 device type disk ;
DUPLICATE DATABASE "ORCL" TO "TEST"
BACKUP LOCATION '/data01/backup/';
   release channel d1;
   release channel d2;
   release channel d3;
   release channel d4;
}

So the script should look something like below:

RUN
{
allocate auxiliary channel d1 device type disk ;
allocate auxiliary channel d2 device type disk ;
allocate auxiliary channel d3 device type disk ;
allocate auxiliary channel d4 device type disk ;
DUPLICATE DATABASE "ORCL" TO "TEST"
BACKUP LOCATION '/data01/backup/';
}