0% found this document useful (0 votes)
58 views4 pages

Oracle DB - Day 12

Uploaded by

suresh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
58 views4 pages

Oracle DB - Day 12

Uploaded by

suresh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Oracle Database Administration Training Series – Day 12

Oracle Multitenant Architecture

The Oracle Multitenant Architecture, introduced in Oracle Database 12c, is a significant innovation
that allows multiple databases (Pluggable Databases or PDBs) to run within a single Container
Database (CDB). This architecture improves resource utilization, simplifies database management,
and supports database consolidation.

1. Introduction to CDBs and PDBs

Container Database (CDB):

• A CDB is a single physical database that includes:

o Root Container (CDB$ROOT): The core infrastructure containing Oracle-supplied


metadata and common data shared across all PDBs.

o Seed PDB (PDB$SEED): A template used to create new PDBs.

o User-defined PDBs: Independent, self-contained databases running inside the CDB.

Pluggable Database (PDB):

• A PDB is a portable collection of schemas, schema objects, and non-schema objects that
appears to an application as a standalone database.

• Each PDB can have its own users, roles, and data while sharing the CDB's resources.

2. Advantages of Multitenant Architecture

1. Consolidation:

o Host multiple PDBs within a single CDB to reduce hardware and maintenance costs.

2. Resource Sharing:

o CPU, memory, and storage are shared efficiently among PDBs.

3. Ease of Management:

o Manage a single CDB instead of multiple standalone databases.

4. Rapid Provisioning:

o Quickly create PDBs using the seed template.

5. Isolation:

o Each PDB is independent, with its own security and administrative boundaries.

6. Portability:

o Plug/unplug PDBs easily between different CDBs.

1
3. Creating and Managing PDBs

Creating a New PDB

1. Using PDB$SEED:

o Create a new PDB from the seed template:

CREATE PLUGGABLE DATABASE my_pdb ADMIN USER pdb_admin IDENTIFIED BY password


FILE_NAME_CONVERT=('/u01/app/oracle/oradata/cdb1/pdbseed/',
'/u01/app/oracle/oradata/cdb1/my_pdb/');

2. Using Cloning:

o Clone an existing PDB:

CREATE PLUGGABLE DATABASE my_pdb_clone FROM source_pdb


FILE_NAME_CONVERT=('/source/location/', '/clone/location/');

3. Plugging an Unplugged PDB:

o Plug an unplugged PDB into a CDB:

CREATE PLUGGABLE DATABASE my_pdb USING '/path/to/unplugged_pdb.xml'


FILE_NAME_CONVERT=('/old/location/', '/new/location/');

4. Opening the PDB:

o After creation, open the PDB:

ALTER PLUGGABLE DATABASE my_pdb OPEN;

Managing PDBs

1. Viewing PDBs:

o List all PDBs in a CDB:

SELECT PDB_ID, PDB_NAME, STATUS FROM DBA_PDBS;

2. Switching Between PDBs:

o Connect to a specific PDB:

ALTER SESSION SET CONTAINER = my_pdb;

3. Closing a PDB:

o Close a specific PDB:

ALTER PLUGGABLE DATABASE my_pdb CLOSE IMMEDIATE;

4. Dropping a PDB:

o Drop a PDB:

DROP PLUGGABLE DATABASE my_pdb INCLUDING DATAFILES;

2
4. Plugging and Unplugging PDBs

Unplugging a PDB

1. Generate XML Metadata File:

o Unplug a PDB to an XML file:

ALTER PLUGGABLE DATABASE my_pdb CLOSE IMMEDIATE;

ALTER PLUGGABLE DATABASE my_pdb UNPLUG INTO '/path/to/unplugged_pdb.xml';

2. Check the Status:

o Verify the PDB is in an unplugged state:

SELECT PDB_ID, PDB_NAME, STATUS FROM DBA_PDBS;

Plugging in a PDB

1. Plug the PDB:

o Plug an unplugged PDB into a CDB:

CREATE PLUGGABLE DATABASE my_pdb USING '/path/to/unplugged_pdb.xml'


FILE_NAME_CONVERT=('/old/location/', '/new/location/');

2. Open the PDB in UPGRADE Mode:

o If the PDB is from a different Oracle version:

ALTER PLUGGABLE DATABASE my_pdb OPEN UPGRADE;

3. Perform Compatibility Checks:

o Use DBMS_PDB to check compatibility:

BEGIN
DBMS_PDB.CHECK_PLUG_COMPATIBILITY(
pdb_descr_file => '/path/to/unplugged_pdb.xml',
pdb_name => 'my_pdb');
END;
4. Open the PDB:

o Open the PDB for read/write:

ALTER PLUGGABLE DATABASE my_pdb OPEN;

Real-World MODI Airline Ticket Booking System Use Case

In a Modi airline ticket booking system, different PDBs can be used for various purposes:

1. Customer Booking PDB:

o Handles real-time ticket reservations and updates.

3
o Provides isolation and quick recovery in case of failure.

2. Payment Processing PDB:

o Manages payment transactions separately to ensure data security and compliance.

3. Analytics PDB:

o Stores historical booking data for analytical purposes, keeping it separate from
transactional databases to reduce load.

4. Regional PDBs:

o Separate PDBs for different regions or branches to handle localized booking systems,
ensuring better resource utilization.

By leveraging Oracle Multitenant Architecture, the airline system can maintain better resource
allocation, faster provisioning, and improved disaster recovery mechanisms.

You might also like