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 this post Share on Facebook0Share on Google+0Share on LinkedIn28Share on Reddit0Tweet about this on Twitter

Gokhan Atil is a database administrator who has hands-on experience with both RDBMS and noSQL databases (Oracle, PostgreSQL, Microsoft SQL Server, Sybase IQ, MySQL, Cassandra, MongoDB and ElasticSearch), and strong background on software development. He is certified as Oracle Certified Professional (OCP) and is awarded as Oracle ACE (in 2011) and Oracle ACE Director (in 2016) for his continuous contributions to the Oracle users community.

3 Comments

  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.

    Thanks

    Deepak

Leave Comment

Your email address will not be published. Required fields are marked *