Creating a Source Pluggable Database

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

Procedure

  1. Create a source Pluggable Database for the tenant.
  2. Execute OMS_DDL.sql and OMS_SeedData.sql for this Pluggable Database.
    This newly created tenant Pluggable Database is considered as a master-copy for creating any further tenants Pluggable Databases. You can call this Pluggable Database "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 Pluggable Database.
    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 Pluggable Database, 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 install (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) Pluggable Database by executing the following command:
    alter pluggable database <<source_pdb_name>> close immediate;