Oracle 12c Container Databases

The multi-tenant architecture enables an Oracle database to function as a multitenant container database (CDB).

A CDB includes zero, one, or many customer-created pluggable databases (PDBs). A PDB is a portable collection of schemas, schema objects, and non-schema 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:

Exactly one CDB root container (also called simply the root
The CDB root is a collection of schemas, schema objects, and non-schema objects to which all PDBs belong The root stores Oracle-supplied metadata and common users. An example of metadata is the source code for Oracle-supplied PL/SQL . A common user is a database user known in every container . The root container is named CDB$ROOT .
Exactly one system container
The system container includes the root CDB and all PDBs in the CDB. Thus, the system container is the logical container for the CDB itself.
Zero or more application containers
An application container consists of exactly one application root , and the PDBs plugged in to this root. Whereas the system container contains the CDB root and allthe PDBs within the CDB, an application container includes only the PDBs plugged into the application root. An application root belongs to the CDB root and no other container.
Zero or more user-created PDBs
A PDB contains the data and code required for a specific set of features (see "PDBs"). 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.

A PDB belongs to exactly zero or one application container. If a PDB belongs to an application container, then it is an application PDB . For example, the cust1_pdb and cust2_pdb application PDBs might belong to the saas_sales_ac application container, in which case they belong to no other application containers. An application seed is an optional application PDB that acts as a user-created PDB template, enabling you to create new application PDBs rapidly.

Exactly one seed PDB
The 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 in PDB$SEED .
The follwoing is an example of how to create a Container database on Windows 2012 R2 Server. This can be used by StarTeam Server.
  1. Create a new database using Database Configuration Assistant ( DBCA) and check the "Create as Container database" Option and provide the name of the pluggable database. For This example, define the instance name as StarTeam and Pluggable database name as st_plug.
  2. Go to Command Prompt
  3. export ORACLE_SID=starteam ( the pluggable database instance name)
  4. sqlplus / as sysdba
  5. SELECT name, pdb FROM v$services ORDER BY name and ensure that the container st_plug exists.
  6. alter session set container=st_plug;
  7. create user starteam identified by test container=current;
  8. Run the following statements
    1. grant unlimited tablespace to starteam;
    2. grant create session to starteam;
    3. grant create table to starteam;
    4. grant create view to starteam;
    5. grant create procedure to starteam;
    6. grant create sequence to starteam;
    7. grant create trigger to starteam;
    8. grant create type to starteam;
    9. grant create any context to starteam;
    10. grant drop any context to starteam;
  9. Create a Tnsnames.ora entry in the $OracleHome/Network/Admin/Tnsnames.ora file. Here is a sample entry
    St_plug = 
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST =
    cmv-orapdb)(PORT = 1521))
    (CONNECT_DATA =
     (SERVER = DEDICATED)
    (SERVICE_NAME = st_plug )
    )
    )

REMEMBER: This feature requires the StarTeam Administrator to create a database manually. The option "Create new StarTeam Database" should be unchecked ( See the screen shot below) and use tnsnames option for using an already created database ( Seen the second screen shot below ) . The database should be created using the steps described above.

GUID-6C4F4149-3291-4616-A6C0-B3076A00F995-low.png

GUID-38B72BD7-5540-4077-B1D6-763FA6BBF06C-low.png