Multitenent
Multi tenant architecture is the concept of the Container Database (CDB) and Pluggable Database (PDB). In this architecture multiple pluggable database are using the same SGA and background process of CDB. If you see the architecture, 2 pluggable databases ABC and XYZ are using the same sga and same background process. i.e there will be only one instance for a CDB. ( only pmon process)
The CDB represents the database as a whole.It contains multiple PDBs. but in EBS , only one PDB Supported. It contains the metadata of all the PDBs. This seems very similar to a conventional Oracle database, as it contains most of the working parts you will be already familiar with (control files, 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.
Suppose, assuming a situation, where we need to create two schemas with the same name in the same database. Is it possible???? No, it is not possible......
When we want to install two applications like PeopleSoft/EBS or any other custom application in the same database because some application which has a specific schema name -SYSADMIN in PeopleSoft or AP/AR/GL ect..ect required for EBS Case.
We could create two different databases but with two different databases comes two different sets of overhead - two instances which consume memory CPU The more databases you have, the more the CPU and memory usage - all because you want to create multiple schemas in the same name.
In 12c we can achieve the above goal.
In 12c, Oracle introduces a multi-tenancy option. Instead of creating a physical database for each SYSADM schema you want to create, you can create a virtual database for each schema.
Each virtual database behaves like an independent database; but runs on the top of a real, physical database which may be hidden from the end users.
These virtual databases are called PDB. The physical database that houses these containers is known as a Container Database (CDB). You can pull out (or "unplug") a PDB from one CDB and place it (or, "plug" it) into another CDB.
Clone
How To
SQL> select NAME, DECODE(CDB, 'YES', 'Multitenant Option enabled', 'Regular 12c Database: ') "Multitenant Option ?" , OPEN_MODE, CON_ID from V$DATABASE;
NAME Multitenant Option ? OPEN_MODE CON_ID
--------- -------------------------- -------------------- ----------
DBATEST Multitenant Option enabled READ WRITE 0
SQL> select CON_ID, NAME, OPEN_MODE from V$PDBS;
CON_ID NAME OPEN_MODE
---------- ------------------------------ ----------
2 PDB$SEED READ ONLY
3 PDB1 READ WRITE
4 PDB2 READ WRITE
CON_ID – 0 = The data pertains to the entire CDB, i.e for a complete database.
CON_ID – 1= The data pertains to the root container (CDB$ROOT)
CON_ID – 2= The data pertains to the seed ( PDB$SEED)
CON_ID – 3 onwards = The data pertains to a PDB, Each PDB has its own container ID.(PDB1,PDB2 etc)
CON_NAME
------------------------------
CDB$ROOT
SQL> sho con_id
CON_ID
------------------------------
1
SQL> alter session set container=PDB$SEED;
Session altered.
SQL> show con_name
CON_NAME
------------------------------
PDB$SEED
SQL> show con_id
CON_ID
------------------------------
2
SQL> show con_name
CON_NAME
------------------------------
PDB1
SQL> select sys_context ( 'Userenv', 'Con_Name') "Container DB" from dual;
Container DB
--------------------------------------------------------------------------------
PDB1
Session altered.
SQL> show con_name
CON_NAME
------------------------------
CDB$ROOT
sqlplus username/password@pdbname
SYS@ISPSOA> show con_name
CON_NAME
------------------------------
ISPSOA
SYS@ISPSOA> select con_id, name, open_mode, restricted from v$pdbs order by 1;
CON_ID NAME OPEN_MODE RES
---------- ------------------------------ ---------- ---
4 ISPSOA READ WRITE NO
Else
ALTER SESSION SET CONTAINER=PDB1;
Post a Comment