8i | 9i | 10g | 11g | 12c | 13c | 18c | 19c | 21c | 23ai | Misc | PL/SQL | SQL | RAC | WebLogic | Linux

Home » Articles » Misc » Here

EMCLI : Manage WebLogic Domains using Enterprise Manager Command Line Interface (Cloud Control)

The Enterprise Manager Command Line Interface (EMCLI) allows you to script your Cloud Control setup, rather than using the Cloud Control console. This article describes how to manage WebLogic domains in Cloud Control using EMCLI, rather than using the web interface.

For more information see:


You can perform these actions from anywhere with an EMCLI client, but for this example we're going to use the EMCLI client on the Cloud Control server. We use the following commands to connect to the OMS and sync the EMCLI client.

export OMS_HOME=/u01/app/oracle/middleware
export AGENT_HOME=/u01/app/oracle/agent/agent_inst
alias emcli='${OMS_HOME}/bin/emcli'

emcli login -username=sysman
emcli sync

Add Domain

The discover_wls verb is used to discover WebLogic domains and their sub-components. The resulting target will have a name in the following format depending on the WebLogic version, but it may vary a little depending on the setup.

In its simplest form the discover_wls verb requires an input CSV file containing information used during the discovery process. This can be used to discover multiple domains, or just a single domain, as shown here. The example probably seems overly verbose, but reading a CSV can be difficult.


cat > ${FILE_PATH}wls_discovery.csv <<EOF

emcli discover_wls -input_file=domain_discovery_file:${FILE_PATH}wls_discovery.csv

Remove Domain

The delete_target verb is used to remove all targets, including WebLogic domains. The get_targets verb is used to show the target has been removed.


emcli delete_target \
  -name="${TARGET_NAME}" \

emcli get_targets -targets="${TARGET_NAME}:weblogic_domain"


The usage of the commands referenced in this article can displayed using the following commands.

emcli help discover_wls
emcli help delete_target
emcli help get_targets

You can also check out all the other WebLogic verbs in the Help Command Output.

emcli help

For more information see:

Hope this helps. Regards Tim...

Back to the Top.