Avatar of Rao_S
Rao_S
 asked on

Need help with emcli in OEM 12c, maybe use shell script or python and run a series of emcli commands.

I have to populate the target properties of every target in OEM 12c.
I am trying a few to see if this will work.
When I run this, i get 82 rows.

select 'emcli set_target_property_value -property_records="'||a.TARGET_NAME||':'||a.TARGET_TYPE||':LifeCycle Status:'||b.property_value||'"'
from mgmt$target a,
(select target_name host,property_value from mgmt$target_properties
where target_type='host' and property_name='orcl_gtp_lifecycle_status') b
where a.host_name=b.host
and a.host_name  like '%lods07%';

I have attached the file, please take a look.

On the server after I log into emcli and log in as sysman, I can run each line follows:

oms_home@loem301dz:/odb/oem01/orabin/admin>emcli set_target_property_value -property_records="testdb87.rnd.pncint.net:rac_database:LifeCycle Status:Test"
Properties updated successfully

How do i create either a shell script or python script to either execute each line as a script or write a python script to do so?
PythonOracle DatabaseShell Scripting

Avatar of undefined
Last Comment
Rao_S

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Gerwin Jansen

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Rao_S

ASKER
Will look at it in detail later..
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23