Using EMCLI for Mass Update a Property Value

Here’s a quick and simple script which can help you to update a target property value of all targets running on a specific host. The script will expect you to enter 3 parameters: host name, property name and property value. Then it will search for the targets running on the given host name, and set the property to the given value:

It’s better to enter the property name in double quotes, because property names can contain spaces (for example “Line of Business”).

The script first checks the number of parameters, then login to OMS (enter your credentials – if you enter username but do not enter password, EMCLI will ask you to enter password when you run the script), gets the targets running on the given host (using EMCLI list command), and then executes set_target_property_value for each target. You may notice I give a non-default separator because some target names can contain colon (:) sign.

Please share

AWS Big Data Specialist. Oracle Certified Professional (OCP) for EBS R12, Oracle 10g and 11g. Co-author of "Expert Oracle Enterprise Manager 12c" book published by Apress. Awarded as Oracle ACE (in 2011) and Oracle ACE Director (in 2016) for the continuous contributions to the Oracle users community. Founding member, and vice president of Turkish Oracle User Group (TROUG). Presented at various international conferences including Oracle Open World.


  1. Stuart

    This is exactly what I was looking for. However, I am getting an HttpConnectionException whenever I try to login to my OMS. I have searched the web without any luck. Do you know how to fix this issue? I have been able to do the setup step just fine. I get a setup successful when I do the following:

    emcli setup -url=”https://[ip]:[port]/em” -username=”sysman” -trustall -novalidate

    I am just not able to do a login(). Any thoughts?

  2. Thanks Gokhan, this is very helpful. We need not to worry to set properties for multiple targets for a host. This will automatically do the work for us.

    Awesome Tip.



  3. ErickG

    Just upgraded to OEM 13.2, trying this method to update properties, when using set_target_property_value in script i am getting “TypeError: can only concatenate list (not “str”) to list”. Any ideas?

  4. yoshan

    Hi Gokhan,

    Interesting tips and I required help regarding emcli ‘create_job_from_library’. If it’s ok to post the issue, please update.

  5. SW

    Hey, I have been trying to run an emcli command to get the list of targets from MGMT$TARGET_PROPERTIES wherein the location is a particular value. But everytime I am getting an error – “ORA-00942: table or view does not exist” Same goes for MGMT$TARGET as well. Any ideas what could be wrong? Exact command is emcli list -sql=”SELECT TARGET_NAME FROM MGMT$TARGET_PROPERTIES WHERE PROPERTY_NAME LIKE ‘orcl_gtp_location’ AND PROPERTY_VALUE LIKE ‘ABC%'”..

Leave Comment

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.