Overview

Application containers are new concept from 12.2 and they allow us to group PDB based on their purpose. Furthermore, we can treat these PDB as one whole in the way that we can partition among them, even if they are remote and thus increase the performance:

From 12.2 onward we are allowed to have a Proxy PDB, Application Root Container and a single user-defined PDB (regular or Application PDB) inside a single CDB without having to pay for the Multitenant Option. Notice we are still limited to a single user-defined PDB.

Management

The management of an application root container is very similar to the management of a single PDB.

Operations

The operations of application PDBs and application containers are the same as normal PDBs:

Creation

Deletion

Alteration

Creation

To create application root container, just create a normal PDB, but AS application root

Create application root container

Deletion

To delete a application container, use the following command:

Drop a application container

Create application PDB

To create an application PDB, we can use the same syntax as normal PDB, just we need to change the CDB :)

Create application PDB

Drop application PDB

To drop an application PDB, we can use the same command as a normal PDB

Drop application PDB

Application containers and application roots are mostly useful when we install and deal with applications. But what is application in a DB term.

Applications

Within an application container, an application is the named, versioned set of common data and metadata stored in the application root. In this context of an application container, the term “application” means “master application definition.” For example, the application might include definitions of tables, views, and packages. For example, you might create multiple sales-related PDBs within one application container, with these PDBs sharing an application that consists of a set of common tables and table definitions. You might store multiple HR-related PDBs within a separate application container, with their own common tables and table definitions.

To have an application, firstly we need to install an application.

Installation

Firstly we need to create an application PDB, you know already the steps from above so I will make them shorter :)

Install application container and PDB

Install application PDB

Install the application

To install an application, we can use the following process:

Install application

Now we can start configuring all that is needed for that application:

Configure the PDB for the application needs

End the installation

To end the installation we simply have to do the following command:

End installation

Bare in mind, at this point the PDBs, don't know about that installation, so if we try to see it from their point of view, it doesn't exist:

Check

Check on PDB level

Sync

To sync the PDBs with the application container, just execute the following:

Sync the PDB with application container

Verify

We can now verify that the application is visible from the PDBs

Verification

Upgrade

The upgrade in that case is the modification of the existing structure, either be: index creation / deletion, new column, etc. To upgrade an application, the process is very similiar:

Upgrade application

We have to, of course, still sync with the PDBs, otherwise it won't be visible:

Sync with the PDBS

We can again verify the version as follows:

Verification

Uninstall

To uninstall an application, we have to:

Uninstall it

Delete all the data

Sync (again :D )

So let's do it:

Uninstallation

Done, we have uninstalled and deleted the data, but we still have to SYNC the changes:

Sync

After that, we can verify that the application has been uninstalled:

Verification

Container Map

In order to put objects into the application container, they have to be partition. The way we partition such objects is called: Container map:

So let's see how it is done on table level.

Firstly we have to create several databases to store the database, alternatively, we can add proxy PDBs on different servers across the globe.

Create Application Container & PDBs

After we have created the container and the PDBs, we can create the container MAP

Create & Set the container MAP

Now we can start all installation

Install the Application

We can verify if container map is used for a specific table as follows:

Verify

Test

We can test if everything is fine, by connecting to the application root and insert couple records:

Now, when you select from that table, the query will be redirect to all PDBs and thus the data will be sharded across the PDBs. If the PDBs are proxy PDBs, it can be even distributed in different continents. The logic is, if you connect to the ROOT, you can see the information across all PDBs, if you connect to a specific PDB, you can select the data only in that PDB and what is shared in the root, you CANNOT see data from other PDBs.