1 2 Previous Next 19 Replies Latest reply: Feb 18, 2014 9:12 AM by cleavitt RSS

Network Adapter Could Not Establish The Connection

967250 Newbie
Currently Being Moderated

Hi ,

 

I have installed RHEL 6 on VMware and have installed Oracle 11g r2 in it. However when I try to connect to the databse using SQL Developer from Windows I get the Network Adapter Could not Establish The connection error. I have started both the database and the listener on the Linux machine.

 

I connect to the Linux via putty via the IP address 192.168.101.130.

 

However when I give the same IP in SQL developer I get the error.

 

Here is the result of the TNSPING

 

[oracle@localhost ~]$ tnsping orcl

 

 

TNS Ping Utility for Linux: Version 11.2.0.1.0 - Production on 18-FEB-2014 00:01:12

 

 

Copyright (c) 1997, 2009, Oracle.  All rights reserved.

 

 

Used parameter files:

/app/oracle/product/11.2.0/dbhome_1/network/admin/sqlnet.ora

 

 

 

 

Used TNSNAMES adapter to resolve the alias

Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = orcl.localdomain)))

OK (40 msec)

 

Please let me know in case of any work around.

 

Thank you

  • 1. Re: Network Adapter Could Not Establish The Connection
    sb92075 Guru
    Currently Being Moderated

    any listener using (HOST = localhost) can never be accessed from any remote client.

     

    listener.ora file is NOT required to start or access any Oracle listener; so rename, remove, delete or otherwise eliminate listener.ora file & restart the listener

     

    wait 60+ seconds the do as below

     

    lsnrctl status

    lsnrctl service

     

    COPY the results from above then PASTE  all back here

  • 2. Re: Network Adapter Could Not Establish The Connection
    967250 Newbie
    Currently Being Moderated

    Here is what I did

     

    $ cd //app/oracle/product/11.2.0/dbhome_1/network/admin

    $ mv listerner.ora listen.ora

    $ lsnrctl

    LSNRCTL> stop

    Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))

    The command completed successfully

    LSNRCTL> start

    Starting /app/oracle/product/11.2.0/dbhome_1/bin/tnslsnr: please wait...

     

     

    TNSLSNR for Linux: Version 11.2.0.1.0 - Production

    Log messages written to /app/oracle/product/11.2.0/dbhome_1/log/diag/tnslsnr/localhost/listener/alert/log.xml

    Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost.localdomain)(PORT=1521)))

     

     

    Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))

    STATUS of the LISTENER

    ------------------------

    Alias                     LISTENER

    Version                   TNSLSNR for Linux: Version 11.2.0.1.0 - Production

    Start Date                18-FEB-2014 00:11:18

    Uptime                    0 days 0 hr. 0 min. 2 sec

    Trace Level               off

    Security                  ON: Local OS Authentication

    SNMP                      OFF

    Listener Log File         /app/oracle/product/11.2.0/dbhome_1/log/diag/tnslsnr/localhost/listener/alert/log.xml

    Listening Endpoints Summary...

      (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost.localdomain)(PORT=1521)))

    The listener supports no services

    The command completed successfully

    LSNRCTL> exit

     

    [oracle@localhost admin]$ lsnrctl status

     

     

    LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 18-FEB-2014 00:15:34

     

     

    Copyright (c) 1991, 2009, Oracle.  All rights reserved.

     

     

    Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))

    STATUS of the LISTENER

    ------------------------

    Alias                     LISTENER

    Version                   TNSLSNR for Linux: Version 11.2.0.1.0 - Production

    Start Date                18-FEB-2014 00:11:18

    Uptime                    0 days 0 hr. 4 min. 17 sec

    Trace Level               off

    Security                  ON: Local OS Authentication

    SNMP                      OFF

    Listener Log File         /app/oracle/product/11.2.0/dbhome_1/log/diag/tnslsnr/localhost/listener/alert/log.xml

    Listening Endpoints Summary...

      (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost.localdomain)(PORT=1521)))

    Services Summary...

    Service "orcl.localdomain" has 1 instance(s).

      Instance "ocl", status READY, has 1 handler(s) for this service...

    Service "orclXDB.localdomain" has 1 instance(s).

      Instance "ocl", status READY, has 1 handler(s) for this service...

    The command completed successfully

     

     

    [oracle@localhost admin]$ lsnrctl service

     

     

    LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 18-FEB-2014 00:15:57

     

     

    Copyright (c) 1991, 2009, Oracle.  All rights reserved.

     

     

    Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))

    Services Summary...

    Service "orcl.localdomain" has 1 instance(s).

      Instance "ocl", status READY, has 1 handler(s) for this service...

        Handler(s):

          "DEDICATED" established:0 refused:0 state:ready

             LOCAL SERVER

    Service "orclXDB.localdomain" has 1 instance(s).

      Instance "ocl", status READY, has 1 handler(s) for this service...

        Handler(s):

          "D000" established:0 refused:0 current:0 max:1022 state:ready

             DISPATCHER <machine: localhost.localdomain, pid: 2388>

             (ADDRESS=(PROTOCOL=tcp)(HOST=localhost.localdomain)(PORT=35110))

    The command completed successfully

  • 3. Re: Network Adapter Could Not Establish The Connection
    sb92075 Guru
    Currently Being Moderated

    no remote client can ever connect to any listener using (HOST=localhost.localdomain)!!!!!!!!!!!!!!!!!!!!!!!!!

     

    the system upon which the listener runs must be configured with a routeable IP (something other than 127.0.0.1)

  • 4. Re: Network Adapter Could Not Establish The Connection
    967250 Newbie
    Currently Being Moderated

    Thanks for the information.

     

    So is there any work around to it? To Reroute the IP?

  • 5. Re: Network Adapter Could Not Establish The Connection
    sb92075 Guru
    Currently Being Moderated

    967250 wrote:

     

    Thanks for the information.

     

    So is there any work around to it? To Reroute the IP?

    Oracle relies on the OS for any & all packet exchange.

    Oracle is the victim; not the culprit.

     

    localhost - Wikipedia, the free encyclopedia

  • 6. Re: Network Adapter Could Not Establish The Connection
    cleavitt Newbie
    Currently Being Moderated

    No.  You need to assign a different hostname to the Linux machine.  "Localhost" is a reserved name in the world of networking and it always points to the local machine.  Therefore, you can never use "localhost" to connect to a remote machine as the system will try to connect to itself.

     

    http://en.wikipedia.org/wiki/Localhost

     

    Google "how to change hostname on (your OS name/version)" and complete those steps.  After that, you will most likely still have issues because by default the OS probably has a firewall running and it will block connections to the Oracle listener.  By default it won't be configured to accept connections on port 1521.  You have a couple of options...

     

    1) Disable the firewall completely.

     

    Run these commands to do that...

     

    /etc/init.d/iptables stop

    chkconfig iptables off

     

    The first command stops the service.  The second command prevents it from being restarted when the OS reboots.

     

    2) Add an exception to the firewall for port 1521.  It should be something like this...

     

    Edit the IPTables configuration with vi...

     

    vi /etc/sysconfig/iptables

     

    Append a new rule as follows...

     

    -A INPUT -m state --state NEW -m tcp -p tcp --dport 1521 -j ACCEPT

     

    Save and close, then restart the IPTables service...

     

    /etc/init.d/iptables restart

  • 7. Re: Network Adapter Could Not Establish The Connection
    967250 Newbie
    Currently Being Moderated

    I changed the hostname and configured the iptables. Still no luck.

  • 8. Re: Network Adapter Could Not Establish The Connection
    sb92075 Guru
    Currently Being Moderated

    post results from OS commands  below

     

    lsnrctl status

    lsnrctl status

     

    > Still no luck.

    above is NOT how oracle reports errors.

    Is COPY & PASTE  broken for you?

  • 9. Re: Network Adapter Could Not Establish The Connection
    967250 Newbie
    Currently Being Moderated

    Here you go.

     

    [root@redhat6 admin]# hostname

    redhat6

     

     

    [root@redhat6 admin]# lsnrctl status

     

     

    LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 18-FEB-2014 01:21:50

     

     

    Copyright (c) 1991, 2009, Oracle.  All rights reserved.

     

     

    Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))

    STATUS of the LISTENER

    ------------------------

    Alias                     LISTENER

    Version                   TNSLSNR for Linux: Version 11.2.0.1.0 - Production

    Start Date                18-FEB-2014 01:19:00

    Uptime                    0 days 0 hr. 2 min. 49 sec

    Trace Level               off

    Security                  ON: Local OS Authentication

    SNMP                      OFF

    Listener Parameter File   /app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora

    Listener Log File         /app/oracle/diag/tnslsnr/redhat6/listener/alert/log.xml

    Listening Endpoints Summary...

      (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))

      (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1521)))

    The listener supports no services

    The command completed successfully

    [root@redhat6 admin]#

    [root@redhat6 admin]#

    [root@redhat6 admin]#

    [root@redhat6 admin]#

    [root@redhat6 admin]# lsnrctl service

     

     

    LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 18-FEB-2014 01:21:58

     

     

    Copyright (c) 1991, 2009, Oracle.  All rights reserved.

     

     

    Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))

    The listener supports no services

    The command completed successfully

    [root@redhat6 admin]#

     

    It is still showing the hostname as localhost. Though you can see I have changed the hostname

  • 10. Re: Network Adapter Could Not Establish The Connection
    sb92075 Guru
    Currently Being Moderated

    >It is still showing the hostname as localhost. Though you can see I have changed the hostname


    post content of /etc/hosts file


    hostname "redhat6" needs to be associated with a routeable IP#; NOT  127.0.0.1

  • 11. Re: Network Adapter Could Not Establish The Connection
    967250 Newbie
    Currently Being Moderated

    Below is the content of the /etc/hosts file

    [root@redhat6 Downloads]# cat /etc/hosts

     

     

    192.168.101.130 redhat6

    127.0.0.1       localhost.localdomain   localhost

    ::1     localhost6.localdomain6 localhost6

     

     

     

     

    [root@redhat6 Downloads]#

  • 12. Re: Network Adapter Could Not Establish The Connection
    sb92075 Guru
    Currently Being Moderated

    post content of   /app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora

  • 13. Re: Network Adapter Could Not Establish The Connection
    967250 Newbie
    Currently Being Moderated

    [root@redhat6 Downloads]# cat  /app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora

    # listener.ora Network Configuration File: /app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora

    # Generated by Oracle configuration tools.

     

     

    LISTENER =

      (DESCRIPTION_LIST =

        (DESCRIPTION =

          (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))

          (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))

        )

      )

     

     

    ADR_BASE_LISTENER = /app/oracle

     

     

    I see here the HOST is localhost. Do I have to change it here??

  • 14. Re: Network Adapter Could Not Establish The Connection
    sb92075 Guru
    Currently Being Moderated

    >Do I have to change it here??

    YES!

1 2 Previous Next

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points