With the launch of DB 12c in 2013, Oracle introduced a new architectural concept, called “multitenant databases”, where you have one super database (=container; CDB) and one or more sub databases (= pluggable DBs; PDB).
Before running the installer on an Oracle Linux environment, a library can be installed through yum to meet all the system per-requisites:
For Oracle Linux 6 – yum install oracle-rdbms-server-12cR1-preinstall
For Oracle Linux 5 – yum install oracle-validated -y
The software installer and DBCA are similar to 11g, except for this screen where you can pre-configure your CDB and PDBs:
23
This DBCA execution will not only create a CDB and 1 PDB, but a “seed pluggable database” as well. You can use this seed database as a template to create other pluggable databases.
35
By default, after running the DBCA, all CDBs and PDBs are up and running.
You must be having some basic questions after reading this architecture. So here are the answers.
Is there a difference when starting the listener and the CDB?
No! You can start the listener and your CDB in exactly the same way as you did with your pre-12c database.
How can you connect to the CDB?
Very simple: just the same as in the past with pre-12c databases.
$ sqlplus system@
SQL*Plus: Release 12.1.0.2.0 Production on Sat Feb 27 09:13:31 2016
Copyright (c) 1982, 2014, Oracle. All rights reserved.
Enter password:
Last Successful login time: Tue Feb 23 2016 15:18:49 +00:00
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 – 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
Are the PDBs opened by default, when starting the CDB?
No. This can be verified by this query:
SQL> select open_mode from v$pdbs where name=’′;
OPEN_MODE
———-
MOUNTED
The PDB is mounted; to open it, just run this command:
SQL> alter pluggable database open read write;
Pluggable database altered.
SQL> select open_mode from v$pdbs where name=’′;
OPEN_MODE
———-
READ WRITE
Note: this must be done as “SYSDBA”.
How can we connect to the PDB?
There are 2 methods:
First method: connect to the CDB and then switch to the PDB by setting the container:
$ sqlplus system@
SQL> show con_name
CON_NAME
——————————
CDB$ROOT
SQL> alter session set container=;
Session altered.
Second method: Modify your tnsnames.ora file by adding an entry for the PDB, based on the CDB entry.
Now, you can connect as usual to the PDB:
$ sqlplus system@
As you can see, it is all quite easy. One of the main benefits of this architecture is that you can handle every PDB as a separate database that can be upgraded or plugged/unplugged independently from other databases.
If you want to learn more on Database 12c like above or wish to discuss challenges you are hitting in Oracle Database 12c Administration, register for our Oracle Database 12c Training.
Note: We are so confident on our workshops that we provide 100% Money back guarantee, in unlikely case of you being not happy after 2 sessions, just drop us a mail before third session and We’ll refund FULL money (or ask us from our 100s of happy trainees in our private Facebook Group)
Did you subscribe to our YouTube Channel (435 already subscribed) and Private FaceBook Group (666 Members) ?
Next Task
- Download our Step By Step Guide to Create Oracle Cloud Account and Create Your first Oracle Database on Cloud. If you need any help then post comments below
Gulam Arizuddin Arizuddin says
Very good article. Atul and team, please keep writing more.