DBA Hub

📋Steps in this guide1/4

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

This article describes how to manage WebLogic domains in Enterprise Manager Cloud Control using EMCLI, rather than using the web interface.

oracle miscconfigurationintermediate
by OracleDba
13 views
1

Setup

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.

Code/Command (click line numbers to comment):

1
2
3
4
5
6
7
unset SSH_ASKPASS
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
2

Add Domain

The 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. - 12 : /{FARM_NAME}_{DOMAIN_NAME}/{DOMAIN_NAME} - 10 : {FARM_NAME}_{DOMAIN_NAME} In its simplest form the 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.

Code/Command (click line numbers to comment):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
WLS_VERSION="12"
ADMIN_HOST="my-server.localdomain"
ADMIN_PORT="7001"
ADMIN_USERNAME="weblogic"
ADMIN_PASWORD="Welcome1"
FARM_NAME="MY_DEV_FARM"
AGENT_PORT="3872"
AGENT_URL="https://${ADMIN_HOST}:${AGENT_PORT}/emd/main/"
FILE_PATH="/tmp/"

cat > ${FILE_PATH}wls_discovery.csv <<EOF
${WLS_VERSION},${ADMIN_HOST},${ADMIN_PORT},${ADMIN_USERNAME},${ADMIN_PASWORD},,,,${FARM_NAME},${AGENT_URL}
EOF

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

Remove Domain

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

Code/Command (click line numbers to comment):

1
2
3
4
5
6
7
TARGET_NAME="/MY_DEV_FARM_my_domain/my_domain"

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

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

Help

The usage of the commands referenced in this article can displayed using the following commands. You can also check out all the other WebLogic verbs in the Help Command Output . For more information see: - EMCLI : All Articles Hope this helps. Regards Tim...

Code/Command (click line numbers to comment):

1
2
3
4
5
emcli help discover_wls
emcli help delete_target
emcli help get_targets

emcli help

Comments (0)

Please to add comments

No comments yet. Be the first to comment!