Install and configure CMAN 19c in the Oracle Cloud, step by step

Installing and configuring CMAN is a trivial activity, but having the steps in one place is better than reinventing the wheel.

Prepare for the install

Download the Oracle Client in the Oracle Database 19c download page.

Choose this one: (64-bit) (1,134,912,540 bytes) , not the one named “” because it is a preinstalled home that does not contain the CMAN tools.

Access the OCI Console and create a new Compute instance. The default  configuration is OK, just make sure that it is Oracle Linux 7 🙂

Do not forget to add your SSH Public Key to access the VM via SSH!

Access the VM using

ssh opc@{public_ip}

Copy the Oracle Client zip in /tmp using your favorite scp program.

Install CMAN

Follow these steps to install CMAN:

# become root
sudo su - root

# install some prereqs (packages, oracle user, kernel params, etc.):
yum install oracle-database-preinstall-19c.x86_64

# prepare the base directory:
mkdir /u01
chown oracle:oinstall /u01

# become oracle
su - oracle

# prepare the Oracle Home dir
mkdir -p /u01/app/oracle/product/cman1930

# unzip the Client install binaries
mkdir -p $HOME/stage
cd $HOME/stage
unzip /tmp/

# prepare the response file:
cat <<EOF > $HOME/cman.rsp

# install!
$HOME/stage/client/runInstaller -silent -responseFile $HOME/cman.rsp  ORACLE_HOME_NAME=cman1930

# back as root:

# finish the install


Basic configuration

# as oracle:

mkdir -p /u01/app/oracle/network/admin
export TNS_ADMIN=/u01/app/oracle/network/admin

cat <<EOF > $TNS_ADMIN/cman-test.ora
cman-test = (configuration=
  (parameter_list =
    (registration_invited_nodes = *)
  ) )

echo "IFILE=${TNS_ADMIN}/cman-test.ora" >> $TNS_ADMIN/cman.ora

This will create a CMAN configuration named cman-test. Beware that it is very basic and insecure. Please read the CMAN documentation if you want something more secure or sophisticated.

The advantage of having the TNS_ADMIN outside the Oracle Home is that if you need to patch CMAN, you can do it out-of-place without the need to copy the configuration files somewhere else.

The advantage of using IFILE inside cman.ora, is that you can manage easily different CMAN configurations in the same host without editing directly cman.ora, with the risk of messing it up.

Preparing the start/stop script

Create a file /u01/app/oracle/scripts/ with this content:

#!/bin/bash -l


Usage () {
        cat <<EOF

        Purpose   : Start/stop a CMAN configuration

        Usage: `basename $0` -a {start|stop|reload|restart|status} -c <config_name> -o <oracle_home>

                -a action           One in start|stop|reload|restart|status
                -c config_name      Name of the cman instance (e.g. ais-prod, gen-prod, etc.)
                -o oracle_home      The ORACLE_HOME path that must be used for the operation (e.g. cman1930)


while getopts ":${LOCAL_PARSE_OPTIONS}" opt ; do
        case $opt in
                        eerror "Invalid option: -$OPTARG"
                        exit 1
                        eerror "Option -$OPTARG requires an argument."
                        exit 1

if [ ! $L_Config ] ; then
        eerror "Please specify a configuration name with -c. Possible values are: "
        ls -1 $CENTRAL_CONFIG_DIR | sed -e "s/\.ora//" | grep -v cman
        exit 1

## if the install step was OK, we should have a valid OH installed with this name:
if [ ! -f $ORACLE_HOME/bin/cmctl ] ; then
        echo "Please set a valid ORACLE_HOME name with -o."
        exit 1

case $L_Action in
                $OH/bin/cmctl startup -c $L_Config
                $OH/bin/cmctl shutdown -c $L_Config
                $OH/bin/cmctl reload -c $L_Config
                $OH/bin/cmctl shutdown -c $L_Config
                sleep 1
                $OH/bin/cmctl startup -c $L_Config
                $OH/bin/cmctl show status -c $L_Config
                # do it again for the exit code
                $OH/bin/cmctl show status -c $L_Config | grep "The command completed successfully." >/dev/null
                echo "Invalid action"
                exit 1

This is at the same time ORACLE_HOME agnostic and configuration agnostic.

Make it executable:

chmod +x /u01/app/oracle/scripts/

and try to start CMAN:

$ /u01/app/oracle/scripts/ -o /u01/app/oracle/product/cman1930 -c cman-test -a start
VERSION         =
ORACLE_HOME     = /u01/app/oracle/product/cman1930
VERSION         =
ORACLE_HOME     = /u01/app/oracle/product/cman1930

CMCTL for Linux: Version - Production on 12-JUL-2019 09:23:50

Copyright (c) 1996, 2019, Oracle.  All rights reserved.

Current instance cman-test is not yet started
Connecting to (DESCRIPTION=(address=(protocol=tcp)(host=ocf-cman-1)(port=1521)))
Starting Oracle Connection Manager instance cman-test. Please wait...
CMAN for Linux: Version - Production
Status of the Instance
Instance name             cman-test
Version                   CMAN for Linux: Version - Production
Start date                12-JUL-2019 09:23:50
Uptime                    0 days 0 hr. 0 min. 9 sec
Num of gateways started   2
Average Load level        0
Log Level                 ADMIN
Trace Level               OFF
Instance Config file      /u01/app/oracle/product/cman1930/network/admin/cman.ora
Instance Log directory    /u01/app/oracle/diag/netcman/ocf-cman-1/cman-test/alert
Instance Trace directory  /u01/app/oracle/diag/netcman/ocf-cman-1/cman-test/trace
The command completed successfully.

Stop should work as well:

$ /u01/app/oracle/scripts/ -o /u01/app/oracle/product/cman1930 -c cman-test -a stop
VERSION         =
ORACLE_HOME     = /u01/app/oracle/product/cman1930
VERSION         =
ORACLE_HOME     = /u01/app/oracle/product/cman1930

CMCTL for Linux: Version - Production on 12-JUL-2019 09:28:34

Copyright (c) 1996, 2019, Oracle.  All rights reserved.

Current instance cman-test is already started
Connecting to (DESCRIPTION=(address=(protocol=tcp)(host=ocf-cman-1)(port=1521)))
The command completed successfully.

Add the service in systemctl

# as root:

cat <<EOF > /etc/systemd/system/cman-test.service
Description=CMAN Service for cman-test

ExecStart=/u01/app/oracle/scripts/ -c cman-test -a start -o /u01/app/oracle/product/cman1930
ExecReload=/u01/app/oracle/scripts/ -c cman-test -a reload -o /u01/app/oracle/product/cman1930
ExecStop=/u01/app/oracle/scripts/ -c cman-test -a stop -o /u01/app/oracle/product/cman1930


/usr/bin/systemctl enable cman-test.service

# start
/usr/bin/systemctl start cman-test
# stop
/usr/bin/systemctl stop cman-test

Open firewall ports

By default, new OL7 images use firewalld. Just open the port 1521 from the public zone:

# as root:
firewall-cmd --permanent --add-port=1521/tcp
firewall-cmd --reload


Bonus: have a smart environment!

# as root:
yum install -y git rlwrap

# Connect as oracle
sudo su - oracle

# Clone this repository
git clone

# Enable the profile scripts
echo ". ~/COE/" >> $HOME/.bash_profile

# set the cman1930 home by default:
echo "setoh cman1930" >> $HOME/.bash_profile
echo "export TNS_ADMIN=/u01/app/oracle/network/admin" >> $HOME/.bash_profile

# Load the new profile
. ~/.bash_profile
[root@ocf-cman-1 tmp]# su - oracle
Last login: Fri Jul 12 09:49:09 GMT 2019 on pts/0
VERSION         =
ORACLE_HOME     = /u01/app/oracle/product/cman1930

# [ oracle@ocf-cman-1:/home/oracle [09:49:54] [ [CLIENT] SID="not set"] 0 ] #
# # ahhh, that;s satisfying


Oracle Grid Infrastructure 19c does not configure the local-mode automaton by default. How to add it?

I have been installing Grid Infrastructure 18c for a while, then switched to 19c when it became GA.

At the beginning I have been overly enthusiast by the shorter installation time:

The GIMR is now optional, that means that deciding to install it is a choice of the customer, and a customer might like to keep it or not, depending on its practices.

Not having the GIMR by default means not having the local-mode automaton. This is also not a problem at all. The default configuration is good for most customers and works really well.

This new simplified configuration reduces some maintenance effort at the beginning, but personally I use a lot the local-mode automaton for out-of-place patching of Grid Infrastructure (read my blog posts to know why I really love the local-mode automaton), so it is something that I definitely need in my clusters.

A choice that makes sense for Oracle and most customers

Oracle vision regarding Grid Infrastructure consists of a central management of clusters, using the Oracle Domain Services Cluster. In this kind of deployment, the Management Repository, TFA, and many other services, are centralized. All the clusters use those services remotely instead of having them configured locally. The local-mode automaton is no exception: the full, enterprise-grade version of Fleet Patching and Provisioning (FPP, formerly Rapid home provisioning or RHP) allows much more than just out-of-place patching of Grid Infrastructure, so it makes perfectly sense to avoid those configurations everywhere, if you use a Domain Cluster architecture. Read more here.

Again, as I said many times in the past, doing out-of-place patching is the best approach in my opinion, but if you keep doing in-place patching, not having the local-mode automaton is not a problem at all and the default behavior in 19c is a good thing for you.

I need local-mode automaton on 19c, what I need to do at install time?

If you have many clusters, you are not installing them by hand with the graphic interface (hopefully!). In the responseFile for 19c Grid Infrastructure installation, this is all you need to change comparing to a 18c:

$ diff grid_install_template_18.rsp grid_install_template_19.rsp
< oracle.install.responseFileVersion=/oracle/install/rspfmt_crsinstall_response_schema_v18.0.0
> oracle.install.responseFileVersion=/oracle/install/rspfmt_crsinstall_response_schema_v19.0.0

as you can see, also Flex ASM is not part of the game by default in 19c.

Once you specify in the responseFile that you want GIMR, then the local-mode automaton is installed  as well by default.

I installed GI 19c without GIMR and local-mode automaton. How can I add them to my new cluster?

First, recreate the empty MGMTDB CDB by hand:

$ dbca -silent -createDatabase -sid -MGMTDB -createAsContainerDatabase true \
 -templateName MGMTSeed_Database.dbc -gdbName _mgmtdb \
 -storageType ASM -diskGroupName +MGMT \
 -datafileJarLocation $OH/assistants/dbca/templates \
 -characterset AL32UTF8 -autoGeneratePasswords -skipUserTemplateCheck

Prepare for db operation
10% complete
Registering database with Oracle Grid Infrastructure
14% complete
Copying database files
43% complete
Creating and starting Oracle instance
45% complete
49% complete
54% complete
58% complete
62% complete
Completing Database Creation
66% complete
69% complete
71% complete
Executing Post Configuration Actions
100% complete
Database creation complete. For details check the logfiles at:
Database Information:
Global Database Name:_mgmtdb
System Identifier(SID):-MGMTDB
Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/_mgmtdb/_mgmtdb2.log" for further details.

Then, configure the PDB for the cluster. Pay attention to the -local switch that is not documented (or at least it does not appear in the inline help):

$ mgmtca -local

After that, you might check that you have the PDB for your cluster inside the MGMTDB, I’ll skip this step.

Before creating the rhpserver (local-mode automaton resource), we need the volume and filesystem to make it work (read here for more information).

The volume:

ASMCMD> volcreate -G MGMT -s 1536M --column 8 --width 1024k --redundancy unprotected GHCHKPT

ASMCMD> volinfo --all
Diskgroup Name: MGMT

         Volume Name: GHCHKPT
         Volume Device: /dev/asm/ghchkpt-303
         State: ENABLED
         Size (MB): 1536
         Resize Unit (MB): 64
         Redundancy: UNPROT
         Stripe Columns: 8
         Stripe Width (K): 1024

The filesystem:

(oracle)$ mkfs -t acfs /dev/asm/ghchkpt-303

(root)# $CRS_HOME/bin/srvctl add filesystem -d /dev/asm/ghchkpt-303 -m /opt/oracle/rhp_images/chkbase -u oracle -fstype ACFS
(root)# $CRS_HOME/bin/srvctl enable filesystem -volume ghchkpt -diskgroup MGMT
(root)# $CRS_HOME/bin/srvctl start filesystem -volume ghchkpt -diskgroup MGMT

Finally, create the local-mode automaton resource:

(root)# $CRS_HOME/bin/srvctl add rhpserver -local -storage /opt/oracle/rhp_images

Again, note that there is a -local switch that is not documented. Specifying it will create the resource as a local-mode automaton and not as a full FPP Server (or RHP Server, damn, this change of name gets me mad when I write blog posts about it 🙂 ).