Adding targets to OEM 12C System in silent mode

Hi Guys,

In this article I’m going to tell you how to add targets to the OEM 12C system.

I’ve already illustrated how to install OEM here ( and and deploying the agents (

After setting up the OEM and deploying the agents into the machines which contain our targets to be monitored, the next step is to add the actual targets into the OEM system. This allows you to monitor the targets (Databases etc…) through the OEM console. This is the last but most important step in the entire process of setting up the OEM as you can’t monitor any Database (I mean to say any target but i mostly use the term ‘Database’ in the context of the word ‘target’ as my main focus is to monitor the Databases through OEM) or can’t see it in the console until you add it to the OEM System.

It’s pretty easy to add targets in GUI mode but you have to be a bit patient if you want to do any automation through silent mode 🙂

Let’s see how we could add the targets in silent mode.

The first step for adding the targets in silent mode is to install the EMCLI (Enterprise Manager Command Line Interface). This is a tool provided by Oracle to perform all the admin activities like adding targets, dropping targets etc… through the command line. You can find more about emcli @

  • Download emcli to your desktop by typing https://oms_host:port/em/console/emcli/download in the browser
  • Ftp this to all the machines where our targets are present (machines in which we deployed agents earlier).
  • Install emcli by issuing
    java -jar <emclikit.jar> client -install_dir=<Some directory which is considered as the EMCLI_HOME>
  • After finishing up the installation do,
    cd $EMCLI_HOME
    ./emcli setup -url=”https://oms_host:port/em&#8221; -username=sysman -password=<sysman password> -dir=$EMCLI_HOME -trustall

This will finish up the emcli installation – setup process. Do this on all the hosts which holds our targets of interest.

After the setup the next thing remained is to add the targets.

You can do that with a simple command like


./emcli add_target -name=”ORACLE_SID” -type=”oracle_database” -host=”$oemhost” -credentials=”UserName:dbsnmp;password:dbsnmp_password;Role:Normal” -properties=”SID:ORACLE_SID;Port:1521;OracleHome:<Oracle home of the target>;MachineName:<Machine where the target is present (current machine)>\”

This will cleanly add you Database to the OEM 12C and you can start to see this Database and it’s monitoring statistics in the OEM console.

refer this for further reading on emcl:




One Response to Adding targets to OEM 12C System in silent mode

  1. Pingback: Changing the passwords of Database users « queryCSM

Leave a Reply

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

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

Google+ photo

You are commenting using your Google+ 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 )


Connecting to %s

%d bloggers like this: