Multi-tenant Architecture & Creating database manually in Oracle 12c

Share via:

Dear Readers,

In this article, we will see the following Multi-tenant Architecture & Creating database manually in Oracle 12c.

Containers in Multitenancy

Oracle Database 12c introduced a new feature called “multitenant.” The multitenant feature provides the ability for a single instance to manage multiple databases. The multitenant architecture enables an Oracle database to function as a multitenant container database (CDB).

The multitenant architecture comprises the following :

“Multitenant” Database Instance:

This is a term used to distinguish between a database instance that supports multitenant database and one that does not.

Container Database (CDB):

This is the database that is created when that database supports Oracle’s multitenant option. It’s also called the ROOT container and is the CDB$ROOT within the data dictionary views of the CDB.
Root Container Database: This is created automatically when you create a multitenant database. The root container contains the data dictionary for the CDB.
Pluggable Database (PDB): These are the databases that are stored within the CDB. 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.

Note :
A Container Database (CDB) comprises zero, one, or many customer-created pluggable databases. All Oracle databases before Oracle Database 12c were non-CDBs.

Oracle Multitenant offers the ability to have up to 252 PDBs per multitenant container database. The multitenant architecture with one user-created pluggable database (single tenant) is available in all editions without the multitenant option.

Database Environment Before Database Consolidation
 

 

 

Single Container Database

 

 

 

Container DB with Seed & PDB’s

 

 

 

The ROOT

The root container, also called the root, is a collection of schemas, schema objects, and nonschema objects to which all PDBs belong. Every CDB has one and only one root container, which stores the system metadata required to manage PDBs. All PDBs belong to the root.

The name of the root is CDB$ROOT.

The root does not store user data. Thus, you must not add user data to the root or modify system supplied schemas in the root.

However, you can create common users and roles for database administratio.

A common user with the necessary privileges can switch between PDBs.

 

The SEED

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 can add or modify objects in PDB$SEED.

 

Pluggable Database

A Pluggable database (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 requirement.

Currently Oracle 12c supports up to 252 Pluggable Databases in a single container.

 

Data Objects in a CDB

A container data object is a table or view containing data pertaining to multiple containers and possibly the CDB as a whole, along with mechanisms to restrict data visible to specific common users through such objects to one or more containers.

Examples of container data objects are Oracle-supplied views whose names begin with V$ and CDB_.

All container data objects have a CON_ID column shows the meaning of the values for this column.

 

How to create/set up container database

There are three ways to create container database, as follows:

  1. Database Configuration Assistant (DBCA)
  2. Oracle Universal Installer (OUI)
  3. Manual Creation

 

Manual Creation:

Steps for creating container database :

  • Set environmental variable by using .bash_profile
  • Create parameter file (pfile).
  • Create directory structure.
  • Keep the database in nomount state.
  • Create database creation script and run at SQL prompt.
  • Post database creation steps: -Run the required scripts at SQL prompt.

Prerequisites for creating database:

  • Sufficient primary memory should be available to start the Oracle instance.
  • Sufficient disk space must be available on the computer.

 

Step 1: setting environment variable with  .bash_profile

Step 2: create parameter file (pfile)

 

Step 3: create directory structure

Step 4:  Connect to SQL* PLUS  and  keep the database in nomount state.

 

Step 5: Create database creation script .

 

Run at SQL prompt.

 

Step 6 : Run the database scripts to create the required views and tables in the database.

 

 

 

Inorder to view the data dictionary views from the seed db, we need to execute the catalog, catproc and pupbld scripts using catcon.pl (os level) in the seed db i.e. PDB$SEED database.

 

 

The above  perl scripts will execute more than one hour so wait until it completes.

 

Thank you for giving your valuable time to read the above information. Please click here to subscribe for further updates

KTEXPERTS is always active on below social media platforms.

Facebook : https://www.facebook.com/ktexperts/
LinkedIn : https://www.linkedin.com/company/ktexperts/
Twitter : https://twitter.com/ktexpertsadmin
YouTube : https://www.youtube.com/c/ktexperts
Instagram : https://www.instagram.com/knowledgesharingplatform

Share via:
Note: Please test scripts in Non Prod before trying in Production.
1 Star2 Stars3 Stars4 Stars5 Stars (10 votes, average: 5.00 out of 5)
Loading...

3 thoughts on “Multi-tenant Architecture & Creating database manually in Oracle 12c

  1. Hello Everyone

    Please join the session to understand what is Multitenant Architecture.

    Agenda for the talk is as follows.

    Multitenant Architecture

    .Container Database (CDB)?
    .Root Container Database?
    .Pluggable Database (PDB)?
    .Physical file system of CDB?
    .Creation of container database(CDB) using different methods.

    If possible please go through below link before joining session:

    https://www.ktexperts.com/oracle-12c-multitenant-architecture-creating-database-manually/

    Multitenant Architecture & Creating database manually

    Sat, Jun 9, 2018 7:00 AM – 10:00 AM PDT / 10 AM EST / 7:30 PM IST

    Please join my meeting from your computer, tablet or smartphone.
    https://global.gotomeeting.com/join/419337077
    You can also dial in using your phone.
    United States: +1 (646) 749-3122
    Access Code: 419-337-077

    Time Zone Converter :

    https://www.timeanddate.com/worldclock/converter.html?iso=20180609T140000&p1=176&p2=137

Add Comment