3.3.3.1 Creation of Application PDB

A PDB that is plugged in to an application container can be created from application seed through cloning.

Below script will be used to create Application PDB from Application Seed. DBA rights are required to perform this step.

Application_PDB_Creation

(Refer the Attachment panel of this document to view the script)

Input sample for the script:
CDB Name FC142CDB
CDB Schema User Name Sys
CDB Schema Password Sys
CDB HOST 1.1.1.1
CDB PORT 1522
CDB Mounted Path /scratch/db1800dat
Application Root Name FCAPPROOT
Application PDB Name FCAPPPDB1

Note for Shared Application and User Authentication deployment model before object conversion:

SMS function ids will be available in Approot and the remaining all function ids will be available as PDB function ids.
  1. Application root before object conversion will only have the static data.
  2. If the data import has to be done to the application root schema, following steps 3 to 8 has to be carried out.
  3. Triggers have to be disabled in the respective schemas before initiating the import.
  4. Tables which are going to be available in the Application root as part of this model can be identified with the below query. (Total of around 21 tables)

    SELECT DISTINCT a.object_name
    FROM cstm_approot_objects a
    WHERE sharing = 'DL'
    AND UPPER(object_type) = 'TABLE'
    AND EXISTS (SELECT 1
    FROM user_objects b
    WHERE b.object_name = a.object_name
    AND b.object_type = 'TABLE')
    AND EXISTS (SELECT 1
    FROM cstm_approot_functions_menu c
    WHERE c.function_id = a.function_id
    AND c.modifiable = 'S');

  5. The export data dump taken from the entities has to be imported into the application root schema only for these above set of tables.
  6. For the PDB’s, data from the entities can be directly imported into the respective application PDBs.
  7. Once the import is completed, triggers have to be enabled again in the schemas.
  8. After the data import, object conversion will be done from the installer.

Example

If there are two entity schemas available for India and Japan region and we have two export dump taken for these schemas.

Step 1: Importing data into the Application root schema
Import the dump taken from India entity schema for the given list of tables followed by the import of dump from Japan entity schema for the same list of tables.
If the table is already present in the application root schema, action should be allowed to just append the table data.

impdp Approot_user/Approot_pwd@Approot_Schema
tables= < Tables from the above script>
content=DATA_ONLY
DIRECTORY=DUMP_FC144ENTITY1
DUMPFILE=FC144DEVPDB1_FULDUMP_210519.DMP
LOGFILE=FC144DEVPDB1_FULDUMP_APPROOT_260919_LOG.LOG
REMAP_SCHEMA=FC143ITR:FC14419CM1
REMAP_TABLESPACE=FC143ITR:FC14419CM1
DATA_OPTIONS=skip_constraint_errors
table_exists_action=append transform=OID:n

Note:

Remap Tablespace recheck in target schema before providing.
Step 2: Importing data into the Application PDB schema
Once the first Application PDB is created from the application seed which will have only the data for static INCs, import the full dump taken from India entity schema.
Similarly, for the second application PDB import the full dump taken from Japan entity schema.
If the table is already present in the application PDB, action should be allowed to just append the table data.

impdp Approot_user/Approot_pwd@Approot_Schema
DIRECTORY=DUMP_FC144ENTITY1
DUMPFILE=FC144DEVPDB1_FULDUMP_210519.DMP
LOGFILE=FC144DEVPDB1_FULDUMP_PDB_260919_LOG.LOG
REMAP_SCHEMA=FC143ITR:FC14419CM1
REMAP_TABLESPACE=FC143ITR:FC14419CM1
DATA_OPTIONS=skip_constraint_errors
table_exists_action=append transform=OID:n

Note:

Remap Tablespace recheck in target schema before providing.
Note for Shared Application and Shared Data – Default deployment model before object conversion:
Identified list of entities will be available in approot and sharing of entities from Approot to individual PDBs is applicable in this model.
  1. Application root before object conversion will only have the static data.
  2. If the data import has to be done to the application root/ schema, following steps 3 to 8 has to be carried out.
  3. Triggers have to be disabled in the respective schemas before initiating the import.
  4. Tables which are going to be available in the Application root as part of this model can be identified with the below query. (Total of around 464 tables)

    SELECT DISTINCT a.object_name
    FROM cstm_approot_objects a
    WHERE sharing = 'DL'
    AND UPPER(object_type) = 'TABLE'
    AND EXISTS (SELECT 1
    FROM user_objects b
    WHERE b.object_name = a.object_name
    AND b.object_type = 'TABLE')
    AND EXISTS (SELECT 1
    FROM cstm_approot_functions_menu c
    WHERE (c.function_id = a.function_id OR

    a.function_id IN ('STATIC', 'DYNAMIC')));

  5. The export data dump taken from the entities has to be imported into the application root schema only for these above set of tables.
  6. For the PDB’s, data from the entities can be directly imported into the respective application PDBs.
  7. Once the import is completed, triggers have to be enabled again in the schemas.
  8. After the data import, object conversion will be done from the installer.

Example

If there are two entity schemas available for India and Japan region and we have two export dump taken for these schemas.

Step 1: Importing data into the Application root schema
Import the dump taken from India entity schema for the given list of tables followed by the import of dump from Japan entity schema for the same list of tables.
If the table is already present in the application root schema, action should be allowed to just append the table data.

impdp Approot_user/Approot_pwd@Approot_Schema
DIRECTORY=DUMP_FC144ENTITY1
DUMPFILE=FC144DEVPDB1_FULDUMP_210519.DMP
LOGFILE=FC144DEVPDB1_FULDUMP_PDB_260919_LOG.LOG
REMAP_SCHEMA=FC143ITR:FC14419CM1
REMAP_TABLESPACE=FC143ITR:FC14419CM1/USERS
DATA_OPTIONS=skip_constraint_errors
table_exists_action=append transform=OID:n

Note:

Remap Tablespace recheck in target schema before providing.
Note for Shared Application and Shared Data – Default deployment model before object conversion:
Identified list of entities will be available in approot and sharing of entities from Approot to individual PDBs is applicable in this model.
  1. Application root before object conversion will only have the static data.
  2. If the data import has to be done to the application root/ schema, following steps 3 to 8 has to be carried out.
  3. Triggers have to be disabled in the respective schemas before initiating the import.
  4. Tables which are going to be available in the Application root as part of this model can be identified with the below query. (Total of around 464 tables)

    SELECT DISTINCT a.object_name
    FROM cstm_approot_objects a
    WHERE sharing = 'DL'
    AND UPPER(object_type) = 'TABLE'
    AND EXISTS (SELECT 1
    FROM user_objects b
    WHERE b.object_name = a.object_name
    AND b.object_type = 'TABLE')
    AND EXISTS (SELECT 1
    FROM cstm_approot_functions_menu c
    WHERE (c.function_id = a.function_id OR

    a.function_id IN ('STATIC', 'DYNAMIC')));

  5. The export data dump taken from the entities has to be imported into the application root schema only for these above set of tables.
  6. For the PDB’s, data from the entities can be directly imported into the respective application PDBs.
  7. Once the import is completed, triggers have to be enabled again in the schemas.
  8. After the data import, object conversion will be done from the installer.

Example

If there are two entity schemas available for India and Japan region and we have two export dump taken for these schemas.

Step 1: Importing data into the Application root schema
Import the dump taken from India entity schema for the given list of tables followed by the import of dump from Japan entity schema for the same list of tables.
If the table is already present in the application root schema, action should be allowed to just append the table data.

impdp Approot_user/Approot_pwd@Approot_Schema
tables= < Tables from the above script>
content=DATA_ONLY
DIRECTORY=DUMP_FC144ENTITY1
DUMPFILE=FC144DEVPDB1_FULDUMP_210519.DMP
LOGFILE=FC144DEVPDB1_FULDUMP_APPROOT_260919_LOG.LOG
REMAP_SCHEMA=FC143ITR:FC14419CM1
REMAP_TABLESPACE=FC143ITR:FC14419CM1
DATA_OPTIONS=skip_constraint_errors
table_exists_action=append transform=OID:n

Note:

Remap Tablespace recheck in target schema before providing.
Step 2: Importing data into the Application PDB schema
Once the first Application PDB is created from the application seed which will have only the data for static INCs, import the full dump taken from India entity schema
Similarly, for the second application PDB import the full dump taken from Japan entity schema.
If the table is already present in the application PDB, action should be allowed to just append the table data.

impdp Approot_user/Approot_pwd@Approot_Schema
DIRECTORY=DUMP_FC144ENTITY1
DUMPFILE=FC144DEVPDB1_FULDUMP_210519.DMP
LOGFILE=FC144DEVPDB1_FULDUMP_PDB_260919_LOG.LOG
REMAP_SCHEMA=FC143ITR:FC14419CM1
REMAP_TABLESPACE=FC143ITR:FC14419CM1
DATA_OPTIONS=skip_constraint_errors
table_exists_action=append transform=OID:n

Note:

Remap Tablespace recheck in target schema before providing.