banner-image

Blog

Oracle 12c: Multitenant Container Database

Consolidate multiple databases with Oracle Database 12c.

Running multiple databases on modern enterprise servers can be an inefficient use of both hardware and human resources. The multitenant container database feature in Oracle Database 12c Release 1 consolidates data and code from multiple databases—without changing existing schemas or applications—to improve resource utilization, manageability, and data security.

The Oracle Multitenant Option

Over time, variations in hardware, operating systems, and Oracle Database versions can lead to increasing database maintenance costs. DBAs must schedule individual backups, patch individual databases, and implement different security strategies.

The Oracle Multitenant option introduced in Oracle Database 12c helps you consolidate databases into a standardized database version that is deployed on a shared cloud infrastructure. The option is supported by an architecture in which a host database called the container database (CDB) can hold multiple pluggable databases (PDBs). This option facilitates

  • Better resource utilization: Available resources—such as background processes, system global area (SGA), and Oracle metadata—can be shared.
  • Rapid cloning: Multiple clones of a pluggable database can be quickly created.
  • Rapid provisioning: On file systems that support the copy-on-write feature, provisioning can be done quickly.
  • Management of many as one: With Oracle Enterprise Manager, a CDB with many PDBs can be managed as a single database.
  • Agility: PDBs can be plugged or unplugged easily for patching, upgrade, or migration purposes.
  • Shared resource management. The Oracle Database Resource Manager feature supports the multitenant architecture, enabling a CDB-level plan to manage resources among PDBs.
  • Enhanced security: Data security is maintained at a granular level even in high-density consolidation cloud environments.

An existing database can be adopted, with no changes, as a PDB. The Oracle Multitenant option can be used with the Oracle Real Application Clusters and Oracle Active Data Guard options.

The Oracle Multitenant option uses the managing-many-as-one concept for activities such as backup and patching.

Multitenant Architecture

In the multitenant architecture, a container is a collection of schemas, objects, and related structures. A container appears to be a logically separate, independent database. Each container in a CDB has a unique ID and name.

A container is classified either as a PDB or root container (also called the root). The root is a collection of schemas, schema objects, and nonschema objects to which all PDBs belong. The root does not store any user data.

A CDB has a single set of background processes and SGA that is used by all PDBs plugged into that CDB. A database instance is associated with a single CDB. A database instance cannot be shared between a non-CDB and CDB.

Every CDB has the following containers:

  • One root container, called CDB$ROOT, that stores Oracle-supplied metadata and common users (database users known in every container belonging to that CDB).
  • One seed PDB, called PDB$SEED—a system-supplied template that the CDB can use to create new PDBs. The seed PDB cannot be modified.
  • Zero or more PDBs.

A PDB is a user-created entity containing a collection of schemas and schema objects that store the data and code required for an application. No PDBs exist when a CDB is first created. A PDB can be plugged into only one CDB at a time.

A CDB can have multiple PDBs plugged in at any given time, and each PDB exists in complete isolation from the other PDBs plugged into the same CDB. Each PDB retains granular control over its schemas and objects.

From the perspective of a user or application, the PDB appears as if it is a traditional non-CDB database. From the operating system perspective, the CDB is the database.

Horizontal Partitioning of the Oracle Data Dictionary

Horizontal partitioning of the Oracle data dictionary is at the heart of the multitenant architecture. This is a conceptual partitioning, not a physical table partitioning.

The CDB$ROOT root container contains a set of tablespaces and their data files, which implement the data dictionary tables to hold the metadata only for the Oracle system. The root’s metadata describes each PDB that is plugged into it. This metadata for a PDB is deleted from the root when that PDB is unplugged. The root, therefore, can be considered as a metadatabase only.

Each PDB has its own set of tablespaces and corresponding data files that implement the data dictionary tables to hold an application’s metadata, and a set of tablespaces that hold the application’s user-defined data.

The root differs significantly from a PDB in that it never holds any user-defined data. Both the root and the PDBs have distinct data dictionaries and can be the “focus” of a foreground process. Therefore a session, at every moment of its lifetime, has a uniquely defined current container that it can access.