Oracle – How to Use EMCLI to Update OEM Oracle Home Path

oracleoracle-enterprise-manager

Is is possible to use the Enterprise Manager Command Line Interface (EMCLI) to change the Oracle Home Path?

We recently upgraded many databases, listeners, and ASMs, and I'd like to automate this process:

  1. Select the target
  2. Go to Target Setup –> Monitoring Configuration
  3. Change "Oracle Home Path", click Next, click Submit.

I looked through the EMCLI Verb Reference and could not find a way to do this.

Best Answer

Assuming your DB target name as seen in EM is ORCL11.WORLD and you want to set it's Monitoring Configuration's Oracle Home to /oracle/product/11.2.0.4, the syntax would be the following:

emcli modify_target -type='oracle_database' -name='ORCL11.WORLD' -properties='OracleHome:/oracle/product/11.2.0.4'

Probably would be similar approach for Listeners, ASM, etc.

Version note: This worked for me on EM 12cR4.