Skip to Main Content

Enterprise Manager

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

I want to use execute_sql of emcli within python

CloudGuardSep 13 2019 — edited Oct 31 2019

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?

Comments

Post Details

Added on Sep 13 2019
1 comment
211 views