To have multiple DB on the same machine, you need to run multiple DB instance. So, in a single instance DB, if you have 3 mounted DB, you will need 3 DB instances. With PDB, the idea is to remove this duplication of resources and to share one DB instance with multiple DBs now referred to as CDBs.
A container Database (CDB) contains Plugable database (PDB)
A container database consists of following three components each of which is called a container
- the root container (CDB$ROOT) which contains metadata for Oracle supplied objects
- Seed PDB (PBD$SEED) which contains metadata for user supplied objects
- PDBs which are generated by cloning seed PBD and assigned a unique ID upon creation.
At a physical level, the CDB has a database instance and database files, just as a non-CDB does.
The following files exist only in root container:
- The redo log files
- The redo log files are common for the whole CDB and therefore the information it contains is annotated with the identity of the PDB where a change occurs. All PDBs in a CDB share the ARCHIVELOG mode of the CDB
- The control file
- The control files are also common for the whole CDB. The control files are updated to reflect any additional tablespaces and datafiles of plugged PDBs.
- Add info about undo tbsp ??
- Temporary tbsp (required in root ;optional in user container):
- A temporary tbsp is required in the root container. This tbsp is optional in PDB. Each PDB can hold its own temporary tbsp for its own local users.
- System and SysAux tablespace (required in both containers)
- Each container has its own data dictionary stored in its proper SYSTEM tbsp ,containing its own metadata and a SYSAUX tbsp.
- User tablespace (only in user container)
- The PDBs can create their tbsp according to its application needs
There are four ways to provision a PDB:
- Create a new PDB from seed PDB
- Plug in a non-CDB as a PDB
- Clone a PDB from another PDB (in same or another CDB)
- Plug a unplugged PDB into another CDB. (However, a PDB can be plugged into only one CDB at a time)
When you create a CDB, you can specify how many PDBs it will contain. Once the CDB is created, you can use DBCA to plug and unplug PDBs
When you create a CDB using a CREATE DATABASE sql statement, you must enable PDBs (by specifying enable PLUGGABLE DATABASE clause) and specify the names and locations of the seed's files.
Backup and Recovery:
- Backup :
- Recovery: