https://docs.oracle.com/database/121/CNCPT/cdbovrvw.htm#CNCPT89243
About the Multitenant Architecture
The multitenant architecture enables an Oracle database to function as a multitenant container database (CDB) that includes zero, one, or many customer-created pluggable databases (PDBs). A PDB is a portable collection of schemas, schema objects, and nonschema objects that appears to an Oracle Net client as a non-CDB. All Oracle databases before Oracle Database 12c were non-CDBs
Every CDB has the following containers:
-
The root stores Oracle-supplied metadata and common users. An example of metadata is the source code for Oracle-supplied PL/SQL packages (see "Data Dictionary Architecture in a CDB"). A common user is a database user known in every container (see "Common Users in a CDB"). The root container is named
CDB$ROOT
. - Exactly one seed PDBThe seed PDB is a system-supplied template that the CDB can use to create new PDBs. The seed PDB is named
PDB$SEED
. You cannot add or modify objects inPDB$SEED
. - Zero or more user-created PDBsA PDB is a user-created entity that contains the data and code required for a specific set of features. For example, a PDB can support a specific application, such as a human resources or sales application. No PDBs exist at creation of the CDB. You add PDBs based on your business requirements.
The following graphic shows a CDB with four containers: the root, seed, and two PDBs. Each PDB has its own dedicated application. A different PDB administrator manages each PDB. A common user exists across a CDB with a single identity. In this example, common user
SYS
can manage the root and every PDB. At the physical level, this CDB has a database instance and database files, just as a non-CDB does.
Creation of a CDB
The
CREATE DATABASE ... ENABLE PLUGGABLE DATABASE
SQL statement creates a new CDB. If you do not specify the ENABLE PLUGGABLE DATABASE
clause, then the newly created database is a non-CDB and can never contain PDBs.
Example 17-1 Determining Whether a Database Is a CDB
SQL> SELECT NAME, CDB, CON_ID FROM V$DATABASE; NAME CDB CON_ID --------- --- ---------- CDB1 YES 0
Creation of a PDB
The
CREATE PLUGGABLE DATABASE
SQL statement creates a PDB. This PDB automatically includes a full data dictionary including metadata and internal links to system-supplied objects in the root. You can only create a PDB in a CDB and not within another PDB.
The following graphic depicts the options for creating a PDB:

Creation of a PDB
The
CREATE PLUGGABLE DATABASE
SQL statement creates a PDB. This PDB automatically includes a full data dictionary including metadata and internal links to system-supplied objects in the root. You can only create a PDB in a CDB and not within another PDB.
The following graphic depicts the options for creating a PDB:

The following sections describe the different techniques for creating PDBs.
1Creation of a PDB from Seed
You can use the
CREATE PLUGGABLE DATABASE
statement to create a PDB by copying the files from PDB$SEED
, which is a template for creating PDBs. The following graphic illustrates creation from the seed:
CREATE PLUGGABLE DATABASE hrpdb
ADMIN USER dba1 identfiied by password
2 Creation of a PDB by Cloning a PDB or a Non-CDB
You can use the
CREATE PLUGGABLE DATABASE
statement to clone a source PDB or non-CDB and plug the clone into the CDB. The source can be a PDB in a local or remote CDB, or starting in Oracle Database 12c Release 1 (12.1.0.2), it can also be a remote non-CDB. This technique copies the files associated with the source PDB or non-CDB to a new location and associates the copied files with the new PDB.
CREATE PLUGGABLE DATABASE salepdb from hrpdb
3 Creation of a PDB by Plugging in an Unplugged PDB
In its unplugged state, a PDB is a self-contained set of data files and an XML metadata file. This technique uses the XML metadata file that describes the PDB and the files associated with the PDB to associate it with the CDB. The following graphic illustrates plugging in an unplugged PDB:
CREATE PLUGGABLE DATABASE salespdb USING '/disk1/usr/financepdb.xml' NOCOPY
Creation of a PDB from a Non-CDB
Execute
DBMS_PDB.DESCRIBE
on a non-CDB in Oracle Database 12c
No comments:
Post a Comment