How to clone CDB to same ODA with different CDB name and different PDB name
My goal is to create a clone of our production database to be used for testing. I have an x8-2s running ODA 19.18. All my databases are running bare metal.
I have an existing production tde-enabled CDB named cdb1 and a PDB named pdb1. I would like to clone cdb1 to cdb2 and clone pdb1 to pdb2.
Would this plan work?
1. Backup CDB and restore it as a copy to same ODA:
odacli irestore-database -r (json backup report from cdb1) -u cdb2 -t -dh xxxxxx -fd
2. Rename pdb1 to pdb2 on cdb2
connect to cdb2...
alter session set container=pdb1; alter system enable restricted session; alter database rename global_name to pdb2; alter system disable restricted session;