OEM 13c-12c: Container Database Target in Enterprise Manager Cloud Control shows DOWN Status when using OCI


Error:

EM 13c / 12c Cloud Control shows a container database target (CDB) with DOWN status and this corresponding message:

The <OMS_HOME>/em/EMGC_OMS1/sysman/log/emoms.log will show the below exception:

 

ERROR conf.Task logp.251 - Caught Exception in thread pool-2308-thread-1
java.sql.SQLException: Listener refused the connection with the following error:
ORA-12514, TNS:listener does not currently know of service requested in connect descriptor


I was using OCI DBCS where listener was running from Grid Home

USE_SID_AS_SERVICE_LISTENER=ON was set in the listener.ora file for the database listener.
USE_SID_AS_SERVICE_LISTENER converts the SID connection string to service name and the EM Agent is connecting using the SID designation, hence the agent connection fails.

It will only be an issue if the database SID value is different from its SERVICE_NAME value.



Solution:


Create a second listener (without USE_SID_AS_SERVICE_LISTENER=ON being set) for use by the EM Agent for target monitoring. 

1. Archive and edit $ORACLE_HOME/network/admin/listener.ora and add the following lines:

LISTENER_EM =
 (DESCRIPTION_LIST =
   (DESCRIPTION =
     (ADDRESS = (PROTOCOL = TCP)(HOST = <host_name>)(PORT = <new_port>))
   )
 )


The listener may be created from a database Oracle Home or a Grid Infrastructure Oracle Home.


2. Start the new listener: $ORACLE_HOME/bin/lsnrctl start LISTENER_EM


3. Log in to the SQL*Plus of the CDB and run this command:

SQL> alter system set LOCAL_LISTENER="(ADDRESS_LIST=(ADDRESS=(PROTOCOL=tcp)(HOST=<host_name>)(PORT=<original_listener_port>))(ADDRESS=(PROTOCOL=tcp)(HOST=<host_name>)(PORT=<new_port>)))" scope=BOTH;

SQL> alter system register;


4. Make sure that the CDB and any PDBs are registered to both listeners:

a) lsnrctl status <original_listener_name>
b) lsnrctl status LISTENER_EM


5. From OEM, edit the monitoring configuration of the CDB:

a) Navigate: Targets > All Targets > right click listener target] > Target Setup > Monitoring Configuration
b) Modify the listener port to be the <new_port>, Select OK to save
c) Test the connection


With this listener arrangement, the regular listener will be used with USE_SID_AS_SERVICE_<name>=ON set, and the EM Agent will use another dedicated listener without USE_SID_AS_SERVICE_<name>=ON set.







If you like please follow and comment