Oracle 12c – Manage Multitenant CDB and PDBs with EM Express

Starting with Oracle 12c, when a database is created, it does not have the database control console, as it used to in Oracle 10g and 11g. Even if you try to upgrade the database with the DB Console in place, you will have to remove it manually or the Upgrade Assistant will remove it. The replacement for the DBConsole is the new GUI EM Express tool. It is a trimmed down version of Enterprise Manager Cloud Control and thus has the advantage of the tight integration with EM control as well.


Let’s look at how to manage CDB and PDBs database, using EM Express.

Manage Multitenant CDB and PDBs with EM Express

Configuring EM Express for CDB and PDBs

You will have to configure the EM Express for every container in 12c, whether it is a CDB or a PDB. Every container will have its own EM Express URL which can be used to manage the different aspects of the particular database. So the first step is to configure the EM Express for a CDB or PDB. The process is pretty much similar for either the CDB or the PDB.


Before you can start to configure the port for the EM Express tool, the following conditions must be met.


• Listener should be listening for the database you want to configure EM Express for.
• LOCAL_LISTENER parameter must be set to the name of Listener listening for your DB.
• Dispatcher parameter is properly set for TCP protocol for the target database.


The following is what you should make sure before you go on to configure the port for EM Express.
$ lsnrctl status
LSNRCTL for Linux: Version 12.1.0.1.0 - Production on 25-AUG-2013 12:51:06

Copyright (c) 1991, 2013, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 12.1.0.1.0 - Production
Start Date 25-AUG-2013 12:29:43
Uptime 0 days 0 hr. 21 min. 24 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/12.1.0/db_1/network/admin/listener.ora
Listener Log File /u01/app/oracle/diag/tnslsnr/VST-12c/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcps)(HOST=VST-12c)(PORT=5500))(Security=(my_wallet_directory=/u01/app/oracle/admin/cdb12c/xdb_wallet))(Presentation=HTTP)(Session=RAW))
Services Summary...
Service "cdb12c" has 2 instance(s).
Instance "cdb12c", status UNKNOWN, has 1 handler(s) for this service...
Instance "cdb12c", status READY, has 1 handler(s) for this service...
Service "cdb12cXDB" has 1 instance(s).
Instance "cdb12c", status READY, has 1 handler(s) for this service...
Service "pdb12c" has 1 instance(s).
Instance "cdb12c", status READY, has 1 handler(s) for this service...
Service "pdb1_clone" has 1 instance(s).
Instance "cdb12c", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully

SQL> show parameter dispatcher;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
dispatchers string (PROTOCOL=TCP) (SERVICE=cdb12c XDB)
max_dispatchers integer

SQL> alter system set local_listener=LISTENER;
System altered.

SQL> show parameter local;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
local_listener string LISTENER
log_archive_local_first boolean TRUE
parallel_force_local boolean FALSE


We are ready now to configure EM Express for CDB or PDB. First we will do it for our CDB which is CDB12c.
SQL> exec DBMS_XDB_CONFIG.SETHTTPSPORT(5500);
PL/SQL procedure successfully completed.

SQL> select dbms_xdb_config.gethttpsport from dual;
GETHTTPSPORT
------------
5500


The EM Express for CDB12c is now configured and it can now be accessed using the below URL.
https://<hostname>:5500/em/


Next we will do the same for PDB. However this time we will have to use a different port number. Log into the PDB using SYS and issue the following command.

SQL> exec DBMS_XDB_CONFIG.SETHTTPSPORT(5501);
PL/SQL procedure successfully completed.

SQL> select dbms_xdb_config.gethttpsport from dual;
GETHTTPSPORT
------------
5501


The EM Express for PDB named PDB12c is now configured and can be accessed using URL below.

https://<hostname>:5501/em/

Using EM Express

You can use the individual URLs to access individual EM Express GUI for each container. The interface will be the same for every container. However options may be different depending on which container you are currently connected to. The EM Express for CDB will have more options and will show information about everything inside the CDB. The EM Express for the individual PDBs will only show information about that specific PDB database. Information about the CDB and other PDBs will not be available however.


The name of the container to which you are currently connected to is shown in the upper left hand corner. The image below is the screenshot of a CDB’s EM Express.

CDB EM Express


The image below is that of the EM Express for a PDB.

PDB EM Express


The name in the top left hand corner clearly indicates the container you are currently connected to.


Also I have expanded the Configuration tab to show the difference. The Configuration menu in CDB clearly has more options than the menu for the PDB. This is obviously because EM Express for CDB is for managing everything inside CDB including every PDB. While EM Express for PDB is only for that specific PDB.

Granting EM Express access to normal users

You can grant any user access to EM Express using the two new roles.


• EM_EXPRESS_BASIC will allow user to view information inside EM Express. User will not be able to change anything. The role includes SELECT_CATALOG_ROLE role.
• EM_EXPRESS_ALL will grant the full read/write access to EM data to any user. The role includes EM_EXPRESS_BASIC role.


Example below shows that we created a new user in PDB and granted him the EM_EXPRESS_BASIC role.

SQL> create user foo identified by foo;
User created.

SQL> grant connect,resource,em_express_basic to foo;
Grant succeeded.

Granting EM Express Access


The top right corner shows the username which you can see is being shown as FOO.