DBA Hub

📋Steps in this guide1/4

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

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

oracle miscconfigurationintermediate
by OracleDba
12 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 Listener

The verb is used to add all targets, including listeners. The verb is used to show the target has been added.

Code/Command (click line numbers to comment):

1
2
3
4
5
6
7
8
9
10
11
12
LISTENER_HOST="NC_HOST_MY_HOST"
LISTENER_ORACLE_HOME="/u01/app/oracle/product/19.0.0/dbhome_1"
LISTENER_PORT="1521"
LISTENER_NAME="LISTENER"

emcli add_target \
  -name="${LISTENER_NAME}_${LISTENER_HOST}" \
  -type="oracle_listener" \
  -host="${LISTENER_HOST}" \
  -properties="LsnrName:${LISTENER_NAME};ListenerOraDir:${LISTENER_ORACLE_HOME}/network/admin;Port:${LISTENER_PORT};OracleHome:${LISTENER_ORACLE_HOME};Machine:${LISTENER_HOST}"

emcli get_targets -targets="${LISTENER_NAME}_${LISTENER_HOST}:oracle_listener"
3

Remove Listener

The verb is used to remove all targets, including listeners. 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
8
LISTENER_HOST="NC_HOST_MY_HOST"
LISTENER_NAME="LISTENER

emcli delete_target \
  -name="${LISTENER_NAME}_${LISTENER_HOST}" \
  -type="oracle_listener"

emcli get_targets -targets="${LISTENER_NAME}_${LISTENER_HOST}:oracle_listener"
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 listener 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 add_target
emcli help delete_target
emcli help get_targets

emcli help

Comments (0)

Please to add comments

No comments yet. Be the first to comment!