Pre 12c Architecture
12c database architecture
MULTITENTANT CONTAINER DATABASE (CDB)
Multitentant Container Database (CDB) instances are similar to instances in a non-CDB (pre-12c) database. It’s owned by SYS user as in instances in previous versions of Oracle, but ownership is only allocated for the Container database as a whole. There is no separate instance for the underlying pluggable databases within that container database. It’s also maintained through the SPFile. The parameters can be modified from within the pluggable databases also but those parameters are recorded in an internal table – PDB_SPFILE$. It’s important to note that any parameter(s) changed from a pluggable database won’t escalate to the container database nor will that modification impact any other pluggable databases.
ROOT CONTAINER CDB$ROOT
ROOT container is the very first container that’s created with a container database. It gets a default name – CDB$ROOT. It’s almost the same as databases in previous Oracle versions, and has the same basic contents – data files, control files, redo logs etc. The most important thing you’ll see it doesn’t contain any tablespace to store custom user-created data. And that’s the main difference between a Root container and the databases from previous versions. A ROOT container is only meant to store the system metadata, objects used by the databases internally and owners created by the database at the time of its creation i.e. SYS and SYSTEM. It also contains the information about all pluggable databases associated with it.
A Root container has a new type of user, Common users, within it. Common users are those which are avail-ble not just inside a Root container but also at all of the pluggable databases as well. Internally-created users are all common users and if you need to, you can explicitly create new common users as well.
Since the Root container is still a database, it can be backed up via standard tools like RMAN and Data Pump.
Although there is no restriction to create user objects under the Root Container, but as per best practice, its advised not to create user objects under SYSTEM/SYSAUX tablespace, same logic applies here, One must never create any user objects under the Root Container.
SEED CONTAINER PDB$SEED
The Seed container is another default pluggable database that’s created at the same time as a container database. Like the Root container, the Seed container also gets a default name – PDB$SEED. It is used to create user-defined pluggable databases. For example, if you wanted to make a database for FINANCE work, you would use this seed container and create a new pluggable database.
Since the seed container is just meant to be used as a template for creating pluggable databases, it’s always in read-only mode, making any changes to its underlying objects impossible. Not only this, but a seed database also can’t be dropped. As with the Root container, the seed container can be backed up using oracle-supplied solutions like RMAN.
PLUGGABLE DATABASE
Pluggable containers are the databases which most DBAs are going to be interested in. The reason is that PDBs are user-created and will be used to hold the business related data as shown in the example above, where a Sales PDB is used to hold related objects. Unlike default containers like Root and Seed, PDBs are explicitly named by the DBA, which should be obvious since they are created on the basis of requirement by the business.
Each PDB holds user data, thus the data dictionary within it is used to hold the information for these objects. To keep the parent container database synched and updated with the object information of the underlying PDBs, the PDB-level data dictionary updates are synched using internal links. Each PDB is created via a service named after it within the database.
Putting all of these together
CON_ID & CON_NAME
In a multitenant system, the distinction between the containers is solved by the introduction of two new functions – CON_ID and CON_NAME. The first function returns an ID number assigned to every database and the second one, as should be obvious, returns the name of the database.
The default containers which are created within a CDB and even the default parent container databases are assigned fixed numbers starting from 0 for the entire database, 1 for the Root container and 2 for the Seed pluggable database. Any pluggable databases created explicitly will always be assigned ID numbers higher than 2.
HOW TO CREATE A MULTITENANT DATABASE ENVIRONMENT IN ORACLE 12C
When creating a database, you must designate it as a CDB or non-CDB for it to be able to support the multitenant architecture. The next set of examples walks you through the steps to create a container database with the DBCA. There is only one step that differentiates a CDB from a non-CDB when using the DBCA.
Following the advanced path of creating a database, the first thing you may notice is a check box for Create As Container Database on Step 4 of 13.
You also can choose the number of PDBs created at this time. You can also choose to create an empty container database with no pluggable databases at the onset. The rest of the steps are pretty much the same as when you create a non-CDB.
Multitenant : Create & Configure a Pluggable Database (PDB) in Oracle Database 12c Release 1 (12.1) -->
https://oracle-base.com/articles/12c/multitenant-create-and-configure-pluggable-database-12cr1
https://www.youtube.com/watch?v=kqxcc5YVl8c
http://allthingsoracle.com/getting-started-with-oracle-database-12c-multitenant-architecture/
http://docs.oracle.com/database/122/index.htm
http://www.dummies.com/programming/databases/basics-of-multitenant-architecture-and-pluggable-databases-in-oracle-12c/
Oracle 12c products--> https://www.youtube.com/watch?v=ttg_dd0Rgm0&list=PL44om9GCcbuNczZaZDxPy7gRW_qtSym5F
Oracle 12c Administration Demo Session --> https://www.youtube.com/watch?v=kqxcc5YVl8c
Oracle Database Upgradation From 11g to 12c Release 2 12.2.0.1 --> https://www.youtube.com/watch?v=dBYn3978kTM