Creating a Source PDB

Before executing the OMS_Clone_Tenant.sql script, you must complete the following steps.

Procedure

  1. Create a source PDB for the tenant.
  2. Execute OMS_DDL.sql and OMS_SeedData.sql for this PDB.
    This newly created tenant PDB is considered as a master-copy for creating any further tenants PDBs. You can call this PDB "pdb0". Don't store any user data in pdb0 except for the seed data.
  3. Navigate to wherever you can find enough available space to store the data files for the new tenant's PDB.
    Usually the tenant's directory is under /u01/app/oracle/oradata/orcl/ (but this might vary according to the environment).
  4. You can call the cloned PDB which you are trying to create pdb1. Create a subdirectory called pdb1 under your chosen directory in step 3 (for example - under orcl/).
    Note: You might have to log in as a root user to create the subdirectory, and then change the owner to oracle and the group to oinstall (considering you have installed oracle 12c with OS user oracle which belongs to the install group).
  5. Login as SYSDBA and execute the following command:
    alter session set container=CDB$ROOT;
  6. Close the source (master-copy) PDB by executing the following command:
    alter pluggable database <<source_pdb_name>> close immediate;