Multi-tenant container database architecture in Oracle Database 12cr1
The Oracle Database 12c Release1 introduced the Oracle Multi-tenant architecture, which allowed consolidation of multiple pluggable databases (PDBs) together in a multi-tenant container database (CDB). Various PDBs store data in objects independently of other PDBs and are maintained separately. Because PDBs isolate data and operations, each PDB is a self-contained, fully functional traditional Oracle Database from an application point of view. However, from an operational point of view, a CDB is a database having a single set of background processes and a shared memory area (SGA); these are shared by all the PDBs in the CDB. This architecture eliminates replication overheads, making the most efficient use of available resources. Any existing pre-Oracle Database 12c database (non-CDB) can be simply adopted as a PDB without having to make any changes to the database or application. Consequently, by consolidating multiple non-CDBs as PDBs, administrators can manage many databases as one.
Containers in a CDB (Pre 12.2)
A container is a collection of schemas, objects, and related structures in a multitenant container database (CDB). Every CDB has the following containers:
Every CDB has one and only one CDB root container, also called the “CDB root” or simply “root”. The root container is named CDB$ROOT. While the root stores Oracle-supplied metadata and common users, it does not store user data. . All PDBs belong to the root.
Every CDB has one and only one seed PDB, named PDB$SEED, which is a system-supplied template for the creation of PDBs that support applications. Since the Seed PDB itself is not intended to support an application, objects cannot be added to or modified in it.
Every CDB can have zero or more user-created PDBs. A user-created PDB, or simply “PDB”, is a user-created entity that contains the data and code specific to a particular application. Each PDB’s data is isolated in its own container. For example, sales and human resources applications can have their own dedicated PDBs.
The following figure shows a CDB CDB1 with four containers:
Limitations in Oracle 12cR1
Although Oracle 12cR1 Multi-tenant allowed database administrators to manage many databases as one by consolidating them as PDBs in a multi-tenant CDB, the same did not hold true for application administrators. In Oracle 12cR1, common objects exist in Oracle-supplied schemas in the CDB root only. If multiple PDBs shared an application, there was no provision for a single master definition of the application on top of PDBs. For example, let us say there are four user-created PDBs (PDB_North, PDB_South, PDB_East, and PDB_West) representing databases of regional offices of the same organization, each using the same application SALES.
In such a case, a full copy of the database components of the application must be stored individually in each PDB. Also, an application upgrade script must be run on each tenant PDB individually. Hence, the need to extend the benefits of managing many as one to the application administrator.
Oracle Database 12.2 introduces the concept of Multi-tenant Application Containers that enable many PDBs to share application objects such as code, metadata, and data. As a result, application administrators can now efficiently manage many application PDBs as one in a single Application Container while securely isolating their individual customer-specific data. This capability is ideally suited for SaaS, franchise, and other applications that are typically shared across different constituents, but require secure isolation of each constituent’s data.
An application container is a special type of PDB that stores data for one or more user-created applications and shares application metadata and common data among various application PDBs contained within it. An application container has the following containers:
Containers in a CDB with Application Container(s) (184.108.40.206)
With the introduction of Application Containers, multi-tenant architecture has been revised as follows:
The following figure shows a CDB CDB1 with an Application Container. In this variation, CDB1 has following containers:
In the above example, an Application Container has been used for a company that builds and maintains a sales application that is used by its various regional offices. The structure of the information about its customers is consistent across all regions and hence is stored in the Application Root. Since each office has different customers and therefore different customer data, there is a separate application PDB for each regional office. A metadata-linked table is used to store customer information so that structure of the table is the same in each application PDB, but the customer data is different.
Application Containers: Other Features
Use Cases for Application Containers
Application Container Views
The following views give information about applications. They can be queried from the application root container and in some cases the application container PDBs.
Thanks Anju for the article.
Thanks Foued for your time and feedback!