Oracle 12c Rman Duplicate Archive Log Not Verified

duplicationoracleoracle-12crman

I am trying to duplicate a DB from live to dev but it is failing. Can anybody advise what is going wrong? Both databases are running Oracle 12c. All database files seem to be copied over but it fails when trying to apply the archive logs.

I am running a full database and archive log backup before executing the DUPLICATE command.

Command

RUN{
DUPLICATE TARGET DATABASE TO UAT 
FROM ACTIVE DATABASE 
USING BACKUPSET 
SPFILE 
set control_files 'E:\oracle\product\12.1.0\oradata\UAT\CONTROLFILE\cf1.ctl','E:\oracle\product\12.1.0\oradata\UAT\CONTROLFILE\cf2.ctl','E:\oracle\product\12.1.0\oradata\UAT\CONTROLFILE\cf3.ctl' 
set db_recovery_file_dest 'L:\ORACLE\ORADATA\UAT' 
set db_create_file_dest 'E:\oracle\product\12.1.0\oradata' 
set log_archive_dest_1 'LOCATION=L:\BACKUP\UAT\RMAN_BACKUPS' 
set log_archive_dest_2 'LOCATION=L:\ORACLE\ORADATA\UAT\ARCHIVELOG' 
set audit_file_dest 'E:\oracle\admin\UAT\adump' 
set core_dump_dest 'E:\oracle\admin\UAT\cdump' 
nofilenamecheck;
}

Error

Finished restore at 24-MAY-16

sql statement: alter system archive log current
current log archived

contents of Memory Script:
{
restore clone force from service  'ENGSPH'
           archivelog from scn  2661373093;
   switch clone datafile all;
}
executing Memory Script

Starting restore at 24-MAY-16
using channel ORA_AUX_DISK_1

channel ORA_AUX_DISK_1: starting archived log restore to default destination
channel ORA_AUX_DISK_1: using network backup set from service ENGSPH
channel ORA_AUX_DISK_1: restoring archived log
archived log thread=1 sequence=5659
Oracle instance started

Total System Global Area    2147483648 bytes

Fixed Size                     3047720 bytes
Variable Size                822087384 bytes
Database Buffers            1308622848 bytes
Redo Buffers                  13725696 bytes

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

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

sql statement: alter system reset  db_unique_name scope=spfile

Oracle instance shut down
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 05/24/2016 16:26:55
RMAN-05501: aborting duplication of target database
RMAN-03015: error occurred in stored script Memory Script

ORA-19845: error in backupArchivedLog while communicating with remote database s
erver
ORA-17628: Oracle error 19571 returned by remote Oracle server
ORA-19571:  RECID  STAMP  not found in control file
ORA-19660: some files in the backup set could not be verified
ORA-19662: archived log thread 1 sequence 5659 could not be verified
ORA-19845: error in backupArchivedLog while communicating with remote database s
erver
ORA-17628: Oracle error 19571 returned by remote Oracle server
ORA-19571:  RECID  STAMP  not found in control file

Thanks for any help.

Best Answer

Could you please tell us how you connected to rman?

For example:

rman target sys/asdf@prod auxiliary sys/asdf@dev

The reason for you problem is that the two databases have trouble communicating with each other.

If you use auxiliary / because your rman session is located on the dev server this is not going to work. The reason is pretty simple as follows.

Lets say your rman session was opened on server dev. You use this connection:

rman target sys/asdf@prod auxiliary sys/asdf@dev

The auxiliary database uses the TNSalias "prod" to connect to the target database. The prod database uses the TNSalias "dev" to connect to the auxiliary database. This means you have to configure the tnsnames.ora on both sides to be able to connect to the other database. Since the rman session is on dev in this example you have to configure the TNSalias "dev" on dev as well.

Back to the example with auxiliary /, it is obvious now why it cannot work.

Then there are additional stuff to keep in mind. The auxiliary database needs to be restarted several times. In some cases you loose the connection to the auxiliary database when it shuts down. This means you have to configure the dev database in the SID_LIST of the listener on the dev server. And take care that the password file is present.

Well, this sounds like a lot configuration overhead. If you have to refresh your dev database frequently this is not a big deal. But I personally prefer to clone from backup location because this is much more simple. You can also skip the SPFILE clause when you create it manually. In my experience you need 2 or 3 attempts to work out the correct parameter conversion. If some parameters change on your prod database you might have to adjust this clause again.