Oracle 12c PDB Cloning with RMAN – Aux DB connection issues

oracleoracle-12crman

I'm trying to run the following to duplicate a PDB using RMAN.

rman target  testuser/testuser@PDB01 auxiliary testuser/testuser@PDB02 as sysbackup

I can connect to both the target and aux PDBs remotely using sqlplus without any problems. I can connect to the target using RMAN also. But the auxiliary connection is a problem. Does anybody know why RMAN prevents a remote connection to an auxiliary database in this situation?

rman target testuser/testuser@PDB01 auxiliary testuser/testuser@PDB02

Recovery Manager: Release 12.1.0.2.0 - Production on Tue Jun 19 15:34:51 2018

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

connected to target database: TESTDB1 (DBID=1985676993)
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00554: initialization of internal recovery manager package failed
RMAN-06814: cannot connect to pluggable database PDB02
If I run the commands individually I get the following ....

RMAN> connect target testuser/testuser@PDB01
connected to target database: TESTDB1 (DBID=1985676993)

RMAN> connect auxiliary testuser/testuser@PDB02

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-06814: cannot connect to pluggable database PDB02

Just to prove the aux PDB02 has no issues I can use it as a the RMAN target and it works. It's just the auxiliary command that's the problem:

RMAN> connect target testuser/testuser@PDB02
connected to target database: TESTDB2 (DBID=958109427)

Any suggestions as to the possible cause of this?

Best Answer

$ oerr rman 6814
6814, 1, "cannot connect to pluggable database %s"
// *Cause:  An error was received when connecting to database because
//          the database is a pluggable database.
// *Action: Connect to the root database and retry the command.

That is not how you clone a PDB.

Duplicating PDBs

When you duplicate one or more PDBs, RMAN also duplicates the root (CDB$ROOT) and the seed database (PDB$SEED). The resulting duplicate database is a fully functional CDB that contains the root, the seed database, and the duplicated PDBs.

And this is how you do it:

Cloning a Remote PDB or Non-CDB

Example:

CREATE PLUGGABLE DATABASE pdb02 FROM pdb01@pdb01_link;