in Oracle 13.2.1 OEM, I am using emcli tool. In that I am passing test.py as below
emcli @test.py
cat test.py is as below
login ( username="Admin_user", password="admin_pw" )
myDBs = list( resource="Targets", search="TARGET_TYPE='oracle_database'" )
for DB in myDBs.out()['data']:
print DB['TARGET_NAME']
execute_sql -sql="select * from global_name;" -credential_set_name="DBCredsSYSDBA" -targets="DB["TARGET_NAME"],:oracle_database" <-- That is within the python script, I am trying to call execute_sql. How to do this?