Mir Sayeed Hassan – Oracle Blog

Oracle DBA – Tips & Techniques | Learn with real-time examples

  • Translate

  • It’s Me






  • My Certificates

  • Links

    My Acclaim Certification : Credly Profile
    My Oracle ACE Pro Profile

  • Achievements

    Awarded Top 100 Oracle Blogs from Worldwide - #RANK 39
  • VISITORS COUNT

  • Verified International Academic Qualification from World Education Service (WES)

    Verified International Academic Qualification from World Education Service (WES)

  • Jobs

emcli login failed in OEM 13.5C

Posted by Mir Sayeed Hassan on January 4th, 2022

emcli login failed in OEM 13.5C

This error occur while login to the emcli on OMS

[oracle(oemsw)@cloudctl bin]$ ./emcli login -username=sysman
Enter password ***********

Error: Connection to the current OMS could not be established. Check the log files for further details.
Log file location is : /u02/OEM13.5C/gc_inst/em/EMGC_OMS1/sysman/emcli/setup/.emcli/.emcli.log
[oracle(oemsw)@cloudctl bin]$ ./emcli sync
Error: Connection to the current OMS could not be established. Check the log files for further details.
Log file location is : /u02/OEM13.5C/gc_inst/em/EMGC_OMS1/sysman/emcli/setup/.emcli/.emcli.log

Error log

Dec 28, 2021 5:34:54 PM oracle.sysman.emCLI.verb.LoginVerb execute
SEVERE:
oracle.sysman.emCLI.omsbrowser.HttpConnectionException:
at oracle.sysman.emCLI.omsbrowser.LoginSystem.establishSession(LoginSystem.java:340)
at oracle.sysman.emCLI.omsbrowser.OMSBrowser.getPageInternal(OMSBrowser.java:933)
at oracle.sysman.emCLI.omsbrowser.OMSBrowser.getPageCommon(OMSBrowser.java:857)
at oracle.sysman.emCLI.omsbrowser.OMSBrowser.getPage(OMSBrowser.java:802)
at oracle.sysman.emCLI.verb.LoginVerb.doLogin(LoginVerb.java:598)
at oracle.sysman.emCLI.verb.LoginVerb.execute(LoginVerb.java:350)
at oracle.sysman.emSDK.emCLI.CLIController.execute(CLIController.java:367)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at oracle.sysman.emCLI.StandAloneLaunchHandler.invoke(StandAloneLaunchHandler.java:413)
at oracle.sysman.emCLI.StandAloneLaunchHandler.launch(StandAloneLaunchHandler.java:286)
at oracle.sysman.emSDK.emCLI.CLIController.launch(CLIController.java:255)
at oracle.sysman.emSDK.emCLI.CLIController.main(CLIController.java:207)
Caused by: java.net.ConnectException: Connection refused (Connection refused)
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:476)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:218)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:200)

Check the status of OMS

[oracle(oemsw)@cloudctl bin]$ ./emctl status oms
Oracle Enterprise Manager Cloud Control 13c Release 5
Copyright (c) 1996, 2021 Oracle Corporation. All rights reserved.
WebTier is Up
Oracle Management Server is Up
JVMD Engine is Up

Solution: Login to $OMS_HOME/bin & Issue the below command

[oracle(oemsw)@cloudctl bin]$ ./emcli setup -username=sysman -password=******** -url=https://10.20.**.**:7802/em -trustall -autologin
Oracle Enterprise Manager 13c Release 5.
Copyright (c) 1996, 2021 Oracle Corporation and/or its affiliates. All rights reserved.

Emcli setup successful

Verify:

[oracle(oemsw)@cloudctl bin]$ ./emcli status
Oracle Enterprise Manager 13c Release 5 EM CLI.
Copyright (c) 1996, 2021 Oracle Corporation and/or its affiliates. All rights reserved.

Instance Home : /home/oracle/.emcli
Verb Jars Home : /u02/OEM13.5C/middleware/bin/./bindings/13.5.0.0.0/.emcli
Status : Configured
EM CLI Home : /u02/OEM13.5C/middleware/bin/.
EM CLI Version : 13.5.0.0.0
Java Home : /u02/OEM13.5C/middleware/oracle_common/jdk/jre
Java Version : 1.8.0_261
Log file : /home/oracle/.emcli/.emcli.log
Log level : SEVERE
EM URL : https://10.20.**.**:7802/em
EM user : sysman
Auto login : true
Trust all certificates : true
[oracle(oemsw)@cloudctl bin]$ $ emcli sync
Synchronized successfully

=====Hence tested & Verified in our test env=====