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 Pluggable Database name. If you followed the naming convention suggested in Creating a Source Pluggable Database, 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 Pluggable Database's data files. If you used the same directory and naming convention in Creating a Source Pluggable Database, 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 Pluggable Database, 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 Pluggable Database (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 Pluggable Database to connect from the ConfigValues_OMS.xml file.