Focus On Oracle

Installing, Backup & Recovery, Performance Tuning,
Troubleshooting, Upgrading, Patching, Zero-Downtime Upgrade, GoldenGate

Oracle Exadata ,Oracle ODA, Oracle ZDLRA


当前位置: 首页 » 技术文章 » Oracle 12c+

容器数据库(CDB)和可插拔数据库(PDB)概述

原文链接:https://oracle-base.com/articles/12c/multitenant-overview-container-database-cdb-12cr1,里面介绍了很多cdb和pdb在不同版本的特性,很全面,是很好的学习资源!

Oracle 12c Release 1 (12.1) introduced the Multitenant option. This article provides a basic overview of the multitenant option, with links to more detailed articles on the functionality.

Overview

The multitenant option represents one of the biggest architectural changes in the history of the Oracle database. The option introduced the concepts of the Container Database (CDB) and Pluggable Database (PDB).

  • Container Database (CDB) : On the surface this seems very similar to a conventional Oracle database, as it contains most of the working parts you will be already familiar with (controlfiles, datafiles, undo, tempfiles, redo logs etc.). It also houses the data dictionary for those objects that are owned by the root container and those that are visible to all PDBs.
  • Pluggable Database (PDB) : Since the CDB contains most of the working parts for the database, the PDB only needs to contain information specific to itself. It does not need to worry about controlfiles, redo logs and undo etc. Instead it is just made up of datafiles and tempfiles to handle it's own objects. This includes it's own data dictionary, containing information about only those objects that are specific to the PDB. From Oracle 12.2 onward a PDB can, and should, have a local undo tablespace.

Multitenant Overview

This split of the data dictionary between common objects, in the root container, and PDB-specific objects, in the PDB's data dictionary, is very important, because this separation is what gives the multitenant option its flexibility. From the perspective of the PDB, the data dictionary is the union of the root and PDB data dictionaries, so internally the PDB feels very much like a normal Oracle database. For example, theDBA_%andALL_%views within the PDB appears the same as any non-CDB database.

Oracle Managed Files (OMF) and Multitenant

Oracle recommend the use of Oracle Managed Files (OMF) when using the multitenant architecture, as it simplifies a number of pieces of functionality. It seems the use of OMF is mandatory for some functionality, like the Application Containers functionality in Oracle 12.2.

Creating Pluggable Databases (PDBs)

Since the bulk of the working parts are already present in the root container, creating a new PDB is a comparatively quick and simple task. When creating a completely new PDP, the PDB is created as a copy of a seed PDB, so it only takes as long as the files take to copy.

Multitenant Create From Seed

Instead of creating a new PDB from the seed, you can clone an existing PDB.

Multitenant Clone

It is also possible to create clones in a remote CDB.

Multitenant Remote Clone

A more detailed description of creating and cloning PDBs can be found here.

Unpluging and Plugging in Pluggable Databases (PDBs)

One of the most powerful features of the multitenant option is the ability to unplug a PDB from a CDB and plug it back into another CDB.

Multitenant Unplug Plug

Not only does this allow databases to be moved easily, but it also provides an alternative way to patch and upgrade to future versions. An example of using unplug/plugin to perform a patch can be found here. A general discussion of the unplug/plugin mechanism is described here.

Conversion of a non-CDB database to a pluggable database involves getting a description the non-CDB database and using this to plug it into a CDB as a new PDB. This method is described here.

Relocate a Pluggable Database (PDB)

From Oracle 12.2 onward it is possible to relocate a PDB, moving it from one CDB to another. This is significantly simpler than doing a conventional umplug/plugin.

Multitenant Relocate

You can read about the relocating PDBs here.

Refreshable Pluggable Database (PDB)

From Oracle 12.2 onward it is possible to refresh a cloned PDB from the source PDB, provided it has only ever been opened in read-only mode.

Multitenant Refresh

You can read about refreshing PDBs here.

Refreshable Pluggable Database (PDB) Switchover

From Oracle 18c onward it is possible to switchover a refreshable PDB.

Multitenant Refreshable PDB Switchover

You can read about refreshable PDB switchover here.

Proxy Pluggable Database (PDB)

From Oracle 12.2 onward it is possible to create proxy PDB, which is a skeleton PDB that sends SQL across to a remote PDB to be processed. This allows you to have a local endpoint for a remote database.

Multitenant Proxy

You can read about proxy PDBs here.

Application Containers

Oracle 12.2 introduces the concept of application containers, which act like a mini-root container. They can be used to centralise shared configuration and applications, which are used by their dependent application PDBs.

Multitenant Application Container

You can read about application containers here.

Pluggable Database (PDB) Snapshot Carousel

From Oracle 18c onward it is possible to create automatically managed snapshots of a PDB, also know as a snapshot carousel.

Multitenant PDB Snapshot Carousel

You can read about PDB Snapshot Carousel here.

Container Database (CDB) Fleet Management

From Oracle 18c onward it is possible to monitor multiple container databases centrally as a fleet.

Multitenant CDB Fleet Management

You can read about CDB Fleet Management here.

Views

The introduction of the multitenant option brings with it an extra layer of data dictionary views, allowing reporting across the root container and the pluggable databases (PDBs). Ignoring editions for the moment, prior releases had the following hierarchy.

DBA_ : All objects in the database.
|
--ALL_ : Objects accessible by the current user, including those 
  |owned by the current user.
  --USER_ : Objects owned by the current user.

With Oracle 12c, an extra layer is added to the hierarchy.

CDB_ : All objects in all containers * (root and all PDBs).
|
--DBA_ : All objects in the current container (root or PDB).
  |
  --ALL_ : Objects accessible by the current user in the current container(root or PDB), 
    |       including those owned by the current user.
    --USER_ : Objects owned by the current user in the current container(root or PDB).

The views are described in the Reference Manual.

* The output of theCDB_views is dependent on the container they are accessed from. When accessed from the root container, they do indeed present all the information from all the containers. When accessed from a PDB, they effectively act like theDBA_views from within the container. This can be a little confusing at first.

Multitenant Articles

The following articles provide more detailed explanations of some of the concepts described in this article.

12.1.0.1 Onward

In 12.1 you can use a single PDB per CDB, also known as Lone-PDB, for free. If you want more than one PDB (2-252) you have to buy the Multitenant Option on top of Enterprise Edition.

12.1.0.2 Onward

12.2.0.1 Onward

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. The Multitenant Option still entitles you to 2-252 PDBs on regular kit, or 2-4096 PDBs on Oracle engineered systems or Oracle Database Clouds Services.

18c Onward

Oracle 18c XE allows up to three user-defined PDBs for free. All other editions have the same rules as 12.2 regarding the Multitant Option.

Multitenant Option: CDBs and PDBs - YouTube Playlist

19c Onward

  • Enhancements to database-managed PDB snapshots (docs).
  • Workload capture and replay in a PDB (docs, docs).
  • ADDM analysis for PDBs (docs, docs).
  • Support for multiple PDB shards in the same CDB (docs).
  • Fine-grained single-instance PDB patching (docs).
  • Cloning a remote PDB using DBCA (docs).
  • Remote PDB relocation (docs).
  • Cloud object store support for Data Pump Import (docs, docs).
  • Database Vault Operations Control for infrastructure database administrators (docs).

Non-CDB Architecture Deprecated

With the release of Oracle Database (12.1.0.2), the non-CDB architecture has been deprecated. Some 12c features do not currently work with the multitenant architecture (see here), so depending on the features you require, you may still need the old pre-12c style instances.

Remember, using a single PDB does not require the Multitenant option, so lone-PDB setups can be used at no extra cost, allowing you to get familiar with the multitenant architecture.

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.

For more information see:

Hope this helps. Regards Tim...


关键词:cdb pdb 12c 

相关文章

关于max_string_size
在Oracle数据库19c中使用JSON
保障业务连续性的神器
Oracle事务卫士(Transaction Guard)和应用连续性(Application Continuity)
如何使用Autoupgrade升级RAC数据库
Oracle PDB升级/迁移实践
容器数据库(CDB)和可插拔数据库(PDB)概述
PDB Migration/Failover in Dataguard
Oracle Database 12c之后DataGuard环境中的PDB操作
在18c中通过ASM Flex DiskGroup克隆PDB
How to generate AWR on PDB and ADG(12.2 afterwards)
在12c上使用wm_concat
Top