Anda di halaman 1dari 15

Oracle Database 12c – Pluggable Databases

Oracle Database 12c was released a few days ago. One of the most exciting new features from my
point of view is the new multitenancy feature, aka pluggable databases.

What Oracle are doing is bringing us many of the advantages that virtualisation has for Operating
Systems, to the database arena. The idea is that you build a container database (CDB), which
contains many pluggable databases (PDB). As far as the application or TNS users are concerned,
each PDB looks exactly like a standard non-PDB would have done prior to 12c. However, for the
administrator it means one set of OS processes, one UNDO tablespace, one redo log, one alert log,
one spfile….etc. You get the picture.

The advantage that gets me most excited though, is the ability to unplug a PDB from the CDB and
plug it in elsewhere. Databases can be cloned in this manner, but best of all they can be patched this
way too! Simply unplug the PDB from your old un-patched CDB and plug it into your recently
patched CDB and you’re done. Oracle has completely disassociated the administrative overhead of
the database from the user data.

Here we can see the new database creation screen within DBCA -
I’m creating a container database named cdb1 and at the same time also creating a pluggable
database named pdb1.

A quick look at the running oracle processes shows that the container database is running, but no
representation of the PDB at an OS level -
So how do we login to our PDB? We set up the environment to login to the CDB -
You can see above that our PDB is up and running, we just can’t necessarily see that by looking for
pmon processes any more.

We can still shut down databases -

The following image shows me switching between root (more on this in a second) and my PDB and
also demonstrating the lack of individual UNDO tablespaces -
So to finish up, here is a quick overview of some of the components within a container database -

CDB$ROOT – AKA root, this is the part of the database which you connect into by default as
SYSDBA and it contains the UNDO, REDO etc.
PDB$SEED – This is what Oracle uses to create new PDB’s within the CDB. You can’t modify it
after creation.
PDB1 – One or more (or none!) PDB’s (named whatever you want) within the CDB.
The feature has huge potential for application deployment, consolidated backups, cloning, patching,
upgrades – I’m really looking forward to getting people using it.

DB12C DBCA – CREATE A


PLUGGABLE DATABASE
With the release of Oracle Database 12c, there is a lot of excitement and thoughts about multi-tenant
databases. This basically means that we can run more database while achieving a smaller foot print on
servers and within the infrastructure. This concept of multi-tenant databases is actually going to make it
cool again to be a DBA. Instead of fighting for resources to house multiple database; we can now use
existing servers within the infrastructure and still provide the support organizations are looking for.

In this blog post, I want to show you how easy it is to create a pluggable database from the Database
Configuration Assistant (DBCA). This is one of the many ways, Oracle has provided to end users for
creating pluggable databases quickly and effortlessly.

As with any database install we need to have the binaries install before we can use DBCA. Once the
binaries are installed, we should have created a container database (CDB). The container database is
going to be where we create our pluggable database. My environment for testing this is as follows:

Oracle Enterprise Linux 6.4 (V33411-01.iso)

Oracle Database 12c Enterprise Edition (12.1.0.1)

Oracle_Home is set to /oracle/app/product/12.1.0.1/dbhome_1

In short, I have a pretty generic environment set up.

Lets start the DBCA and create our pluggable database.

I always set my Oracle environment before I start to interact with Oracle tools.

[oracle@oel ~]$ . oraenv


ORACLE_SID = [oracle] ? ora12c

The Oracle base has been set to /oracle/app

[oracle@oel ~]$ env | grep ORA

ORACLE_SID=ora12c

ORACLE_BASE=/oracle/app

ORACLE_HOME=/oracle/app/product/12.1.0.1/dbhome_1

This actually makes it easier to start the DBCA because I don’t need to specify the path to the file since it is
already setup in my environment.

Starting the DBCA is easy and will bring use to the first screen. You will notice that Oracle has added a
new option called “Manage Pluggable Databases“. This is the path that the DBCA will use to manage,
create, delete and alter any pluggable databases that are associated with the container database.

[oracle@oel dbhome_1]$ dbca &

[1] 8853
Step two, we have multiple options to use for the pluggable database(s). Since we are focusing on creating
a pluggable database, select the “Create Pluggable Database” option.
Step three, we can choose what container database we would like to create the pluggable database in. For
the purpose of this example, I’m creating the pluggable in the “ora12c” container database.
Step four, we can create a new pluggable database. We can also create a pluggable form a PDB archive or
from an RMAN supported PDB file set. Again, we are just creating so lets stick with the default option.
Step five, we have to name our PDB, identify what type of storage we are using and setup an initial PDB
Admin user. As a general rule, it is good to come up with a naming scheme for PDBs. I tend to
usepdb<name> format, just so I can keep track of what is PDB versus non-PDB. For storage of a PDB,
I’m using my file system for storage; however, you can also select an ASM instance to use.
Step six, is our review screen. Review what you have selected and make sure it will create the PDB where
you are expecting it to be created.
Step seven, is the progress screen.
When the pluggable database is created and successful, the DBCA will let you know.

After closing DBCA, how can we tell if the pluggable database is created and running? Pluggable
databases are contained within a container database. This means that we cannot use normal avenues of
looking up a database process (ps -ef | grep -i peon). Actually, one of the easiest way to see if the
pluggable is running is to check the listener status. The new pluggable database will automatically
register with the listener upon creation.
[oracle@oel dbhome_1]$ lsnrctl status | grep -i pdbtest

Service "pdbtest.acme.com" has 1 instance(s).

Well, hope you see how easy it is to create a pluggable database from one of the tools that Oracle provides.

Enjoy!

Anda mungkin juga menyukai