Preparing the Cloning Script

You must prepare the script OMS_Clone_Tenant.sql before executing it.

Procedure

  1. Replace <<source_pdb_name>> with the actual source PDB name. If you followed the naming convention suggested in Creating a Source PDB, it would be pdb0.
  2. Replace <<path_to_new_pdb_directory>> with the actual directory path to the new directory that you created to store the cloned PDB's data files. If you used the same directory and naming convention in Creating a Source PDB, this would be /u01/app/oracle/oradata/orcl/pdb1.
  3. Replace <<new_pdb_name>> with the new pdb name. If you followed the naming convention suggested in Creating a Source PDB, it would be pdb1.
  4. Execute the OMS_Clone_Tenant.sql script as SYSDBA.

    The new tenant is created with all the users, tables, and data which were existing in the original tenant.

  5. Update the tnsnames.ora file by adding a new listener entry for the newly created PDB (pdb1).
  6. Now you are ready to use the newly created container (pdb1) as a tenant database. Use the service name provided for the new PDB to connect from the ConfigValues_OMS.xml file.