Martins Blog

Trying to explain complex things in simple terms

Support for Pluggable Databases in Enterprise Manager

Posted by Martin Bach on August 29, 2013

Currently there is an interesting thread on the oracle-l mailing list about OEM 12c support for database 12c Release. Unlike previous OEM generations this time OEM was not lagging behind. I am using OEM 12.1.0.2.0 with the database plugin 12.1.0.3.0 and yes, I can see PDBs!

pdbs-001

The above snapshot is from the database targets overview page. As you can see there is a Container Database (CDB1) and it has exactly 1 PDB. When you click on the CDB you get to the main page:

pdbs-002

This is pretty cool because it allows you to view the resources consumed by the CDB broken down into the CDB$ROOT as well as the PDBs. When you click on the PDB name it takes you to another screen from where you manage the PDB. This is done in more or less the same way as you’d manage a non-CDB. Differences exist of course when it comes to visibility of information. You can expect to be presented only with the information you are allowed to see within the context of the PDB!

And it works with emcli too!

Enterprise Manager Command Line Interface (emcli) has support for PDBs as well, you can create them, plug and unplug etc. Here is an example how to create a PDB from a clone. If you refer back to the output of the last print screen you see a PDB named PDB1 in container database CDB1 on server2.example.com. I wanted to clone PDB1 to swingbench1 using the command line interface. The documentation is a bit sketchy at the moment and it is not terribly clear how to create a PDB from a “dbca-template” (at least to me) but I seem to have managed to initialise the creation of a PDB from a clone. On the OMS I ran the command:

[oracle@oem12oms1 ~]$ emcli create_pluggable_database \
>   -cdbTargetName=CDB1 \
>   -cdbTargetType=oracle_database \
>   -cdbHostCreds=ORACLE_HOST \
>   -pdbName=swingbench1 \
>   -sourceType=CLONE \
>   -cdbTargetCreds=LAB_SYS \
>   -sourcePDBName=CDB1_PDB1 \
>   -sourceCDBCreds=LAB_SYS \
>   -sameAsSource
Successfully submitted create database job. Procedure execution ID is: E5134C261D1127FBE043DE64A8C0D388

The execution of this requires the definition of named credentials (setup->security->named credentials). In this case I am using my host credentials ORACLE_HOST, and LAB_SYS to connect as sysdba. If you are unsure about the target names use emcli get_targets -targets=”oracle_database” followed by emcli get_targets -targets=”oracle_pdb” to list the databases as well as the PDBs.

After a little while the PDB will be created. Check enterprise->provisioning and patching->procedure activity for your job. Clicking on it gives you more information on what’s happening. In this case the procedure completed successfully:

pdbs-004

This is nice because it’s repeatable, scriptable and does NOT require a password to be stored in the script!

[oracle@server2 ~]$ sqlplus / as sysdba

SQL*Plus: Release 12.1.0.1.0 Production on Thu Aug 29 05:42:01 2013

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Advanced Analytics
and Real Application Testing options

SQL> select name,open_mode from v$pdbs;

NAME			       OPEN_MODE
------------------------------ ----------
PDB$SEED		       READ ONLY
PDB1			       READ WRITE
SWINGBENCH1		       READ WRITE

SQL>

Summary

Certain particularities such as CDB and PDB resource plans are well managed already. I can only recommend OEM 12c over 11.1, it feels so much better and the user interface is more modern too. Happy consolidation!

License Warning

I have no idea about licensing these components-before you implement them make sure you are appropriately licensed for the feature. Which is actually true for all the blog posts here…

About these ads

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
Follow

Get every new post delivered to your Inbox.

Join 2,233 other followers

%d bloggers like this: