Laura Ramsey-Oracle Database

This Article has two parts,

  1. Basic Understanding of Application container and it’s architecture
  2. Create, Install, upgrade application in application container.

 

1. Basic Understanding of Application container and it’s architecture

 

“Application Container” is one of the new features of Oracle Database 12c Release 2.

In 12c Release 1, we have CDB, in which multiple database (PDBs) can be created. Now in 12c Release 2, new component has been introduce called, “Application Container”.

Application Container is optional. One can create as and when required. Application container seems to be a mini CDB, within CDB root.

Application Container also have it’s own PDBs.


Here is graphical representation of application container.

ApplicationContainerArch.jpg

Like the CDB root, an application root serves as parent container to the PDBs plugged into it.

In application root, you can manage common users and privileges, create application PDBs, switch containers, and issue DDL that applies to all PDBs in the application container.

 

Characteristics of Application Container

 

  • Application container belongs to CDB root.
  • Application container also called application root.
  • Application root may have multiple PDBs.
  • Application container is a PDB for CDB root.
  • Application root  will have metadata of each PDB which is associated with application container.
  • The application root has its own service name and users can connect to the application root in the same way that they connect to a PDB.
  • Application container can be created with the CREATE PLUGGABLE DATABASE statement, and also alter it with ALTER PLUGGABLE DATABASE.
  • Application root can be STARTUP and SHUTDOWN as normal PDB within CDB root.
  • You can use DDL to plug, unplug, and drop application roots.

 

How Application root is different from CDB root and PDB

 

  • An application root stores user-created common objects, which are called application common objects.
  • Application common objects are accessible to the application PDBs plugged in to the application root.
  • Application common objects are not visible to the CDB root, other application roots, or PDBs that do not belong to the application root.

 

 

Application Common Objects

An application common objects are created within an application in an application root. Common objects are either data-linked or metadata-linked.

 

Data-linked common object, application PDBs share a single set of data. For example, an application for the online_store_ac application container is named online_store_app, has version 1.0, and includes a data-linked country_zipcode table. In this case, the rows are stored once in the table in the application root, but are visible in all application PDBs.

 

Metadata-linked common object, application PDBs share only the metadata, but contain different sets of data. For example, a metadata-linked products table has the same definition in every application PDB, but the rows themselves are specific to the PDB. The application PDB named cat1pdb might have a products table that contains electronic products, whereas the application PDB named cat2pdb might have a products table that contains FMCG products.

 

Object Type

SHARING Value

Metadata Storage

Data Storage

Data-Linked

DATA

Application root

Application root

Extended Data-Linked

EXTENDED DATA

Application root

Application root and application PDB

Metadata-Linked

METADATA

Application root

Application PDB

 

 

Managing Applications in an Application Container

 

In an application container, an application is a named, versioned set of application metadata and common data. A typical application installs application common users and application common objects

 

Here, Application means, your backend i.e. your database/application objects, database/application objects includes your user accounts, tables, packages and so on.

 

An application can be installed, upgraded, and patched in an application root. Application must be installed, upgraded, or patched, by issuing an ALTER PLUGGABLE DATABASE ... BEGIN statement to start the operation and an ALTER PLUGGABLE DATABASE ... END statement to end the operation. These statements can be issued in the same user session or in different user sessions.

 

When application changes are performed, application PDBs can synchronize with the application in the application root to apply the changes. The application container also manages the versions of the application and the patches to the application:

 

Install an application :- Application version number needs to be specified.

Upgrade an application :- Old application version number and the new application version number needs to be specified.

Patch an application :- Minimum application version number for the patch and the patch number needs to be specified.

 

Basically, This application concept is used for versioning of your modified data in your tables. This helps DBAs & Developers to understand modified data for an application specific and manage and access them in different application versions.

 

The following is the typical process for creating and maintaining an application in an application container:

 

The following is the typical process for creating and maintaining an application in an application container:

 

1) Create the application container.

2) Install the application in the application root.

This step includes creating the application data model and configuring the application common users and application common objects.

3) Create the application PDBs in the application root.

4) Synchronize each application PDB that should install the application with the application in the application root.

5) Load the data for each application PDB.

6) Maintain the application by upgrading it and patching it in the application root.

7) Synchronize application PDBs that should apply changes from upgrades and patches.

8) Add new application PDBs whenever necessary.

 

Upgrading Applications in an Application Container

 

You can upgrade an application in application root only, and application PDBs applies the changes in the upgrade when they synchronize with the application. Application PDBs synchronize with an application by running an ALTER PLUGGABLE DATABASE statement with the SYNC clause. The upgrade can be done with one or more of the following: scripts, SQL statements, and graphical user interface tools.

 

When an application is upgraded, Oracle Database automatically creates a clone of the application root. During the upgrade operation, application PDBs is pointed to the clone. Applications continue to run during the upgrade operation.

 

UpgradeProcess.jpg

 

 

  1. When one installs application, it will be your initial version.
  2. Then user executes the ALTER PLUGGABLE DATABASE APPLICATION BEGIN UPGRADE statement, and then issues the application upgrade statements.

         During the upgrade, the database automatically does the following:

  • Clones the application root
  • Points the application PDBs to the application root clone

The clone is in read-only mode. The application remains available to the application PDBs.

  1. When user executes the ALTER PLUGGABLE DATABASE APPLICATION END UPGRADE statement.

An application PDBs are still pointing to the application root clone, and the original application root is at a new version. For example, if an application is at version 1.0 in the application root, then the upgrade might bring it to version 2.0. An application root clone, however, remains at version 1.0.

  1. Once upgrade done, one can synchronizes application PDBS with application root.

For example, after the synchronization, some application PDBs are plugged in to the application root at version 2.0. However, the application root clone continues to support application PDBs that must stay on version 1.0, or any new application PDBs that are plugged in to the application root at version 1.0.

 

 

Kindly check Part 2 of this article for Create, Install, upgrade application in application container.

 

 

Thanks and Regards,

Chandan Tanwani