8 Replies Latest reply on Jan 21, 2017 1:18 PM by user9228758

    SQL Developer connectivity issue - localhost works - hostname does not, any idea why not?

    user9228758

      For quite some time I have got a kind of an issue with SQL Developer.

      Connection Type Basic, with Hostname = localhost at port 1521 and sid xe works fine.

      What also works is Hostname = IP6 Address

       

      But when I use the windows Hostname like Hostname = labtop23 (the host does not belong to a domain)

      Then I get time out errors.

       

      The listener is clearly listening to HOST=labtop23

       

      Am I missing somewhere, something?

       

      The browser based access with apex is working fine, too.

      .

        • 1. Re: SQL Developer connectivity issue - localhost works - hostname does not, any idea why not?
          Gbenga Ajakaye

          To access your database using SQL Developer, you have to use the localhost and not the computer name. If you have a VM on your computer and you install oracle inside that VM, then you should be able to access that VM hostname from your computer's sql developer. However, you can only access your database, which resides on your window server directly using LOCALHOST.

          • 2. Re: SQL Developer connectivity issue - localhost works - hostname does not, any idea why not?

            Pure rubbish! I don't know where you get your information but I suggest you get a new source - I'd start with the Oracle docs if I were you and just getting started.

            • 3. Re: SQL Developer connectivity issue - localhost works - hostname does not, any idea why not?

              You can safely ignore the advice the other responder gave you - it is totally wrong.

               

              For quite some time I have got a kind of an issue with SQL Developer.

              Connection Type Basic, with Hostname = localhost at port 1521 and sid xe works fine.

              What also works is Hostname = IP6 Address

              But when I use the windows Hostname like Hostname = labtop23 (the host does not belong to a domain)

              Then I get time out errors.

              What errors?

               

              The 'hostname' you provide needs to be the name of the server the database is installed on that you are trying to connect to.

               

              And if you use 'hostname' you need to have an entry in your 'hosts' file (.../system32/drivers/etc/hosts) that provides the IP address of the server.

               

              The listener is clearly listening to HOST=labtop23

               

              Am I missing somewhere, something?

               

               

              The listener does NOT listen to 'hosts' - it listens to 'ports. It doesn't know, and doesn't care where the incoming call on the port originates.

               

              It uses the info from registered databases to provide the link between the sid or service_name you provide and the DBs that have registered with the listener.

               

              Check your  hosts file to see if it contains the hostname and ip address of the server where the DB is located.

              • 4. Re: SQL Developer connectivity issue - localhost works - hostname does not, any idea why not?
                Gbenga Ajakaye

                Get a life dude!

                 

                "Hostname: This is the host system for the Oracle Database instance. Enter an IP address, a machine name, or localhost (when connecting to a database on the same machine as Oracle SQL Developer). The default is localhost ."

                 

                SQL Developer: Making Database Connections

                 

                • 5. Re: SQL Developer connectivity issue - localhost works - hostname does not, any idea why not?

                  Gbenga Ajakaye wrote:

                   

                  Get a life dude!

                   

                  "Hostname: This is the host system for the Oracle Database instance. Enter an IP address, a machine name, or localhost (when connecting to a database on the same machine as Oracle SQL Developer). The default is localhost ."

                   

                  SQL Developer: Making Database Connections

                   

                  Get some learning dude!

                   

                  That doc quote is correct and contradicts the advice you gave

                   

                  See where it says 'a machine name'? That means you can ALWAYS use a host name whether the DB is on a remote machine or on a local machine.

                   

                  The parenthetical text is explaining that you can ONLY use 'localhost' if the DB is on the same machine.

                   

                  This is what YOU said (reread your own reply if you need to)

                  To access your database using SQL Developer, you have to use the localhost and not the computer name.

                  As that doc quote that you, yourself, provided says you do NOT 'have to use the localhost'.

                   

                  You got it backwards - you can ALWAYS use a hostname.

                   

                  Unfortunately, based on your replies in several other recent threads you seem to have gotten into the habit of offering advice without actually trying things yourself.

                   

                  Quoting the docs is relatively safe although they can be wrong also. But if you make a definitive statement you need to make sure you test it yourself first.

                   

                  We want, and need, more people to contribute to the forums. But it is important to try to provide information that is as accurate as possible.

                   

                  Please try to make an effort to test things before you post. That isn't always possible but if you haven't actually tested something then just say 'I have not tested this but I believe ....'. That way anyone reading what you post will know to take it with a grain of salt.

                  • 6. Re: SQL Developer connectivity issue - localhost works - hostname does not, any idea why not?
                    Gbenga Ajakaye

                    Thanks rp0428 for your reply. Your suggest to test things out before posting actually makes sense and I intend to keep it mind - moving forward.

                    • 7. Re: SQL Developer connectivity issue - localhost works - hostname does not, any idea why not?
                      Jim Smith

                      What do you get for each of the following?  Are the all targetting the same address?

                       

                      ping localhost

                      ping <IP6 address>

                      ping labtop23

                       

                      What do you see with this?

                       

                      lsnrctl status

                       

                      Timeouts are odd.  If your hostname wasn't resolving, or resolving to the wrong host, I would expect the generic "network adapter could not establish the connection" error.  It could be that traffic is being caught in firewall.

                      • 8. Re: SQL Developer connectivity issue - localhost works - hostname does not, any idea why not?
                        user9228758

                        Thanks All and thanks Jim,

                        sorry for the late response, I did not realise that I received replies.

                        The issue is still around.

                         

                        ping localhost

                         

                        Pinging Labtop23 [::1] with 32 bytes of data:

                        Reply from ::1: time<1ms

                        Reply from ::1: time<1ms

                        Reply from ::1: time<1ms

                        Reply from ::1: time<1ms

                         

                        Ping statistics for ::1:

                            Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),

                        Approximate round trip times in milli-seconds:

                            Minimum = 0ms, Maximum = 0ms, Average = 0ms

                         

                        ping Labtop23

                         

                        Pinging Labtop23 [fe80::394e:1881:d965:a7d9%20] with 32 bytes of data:

                        Reply from fe80::394e:1881:d965:a7d9%20: time<1ms

                        Reply from fe80::394e:1881:d965:a7d9%20: time<1ms

                        Reply from fe80::394e:1881:d965:a7d9%20: time<1ms

                        Reply from fe80::394e:1881:d965:a7d9%20: time<1ms

                         

                        Ping statistics for fe80::394e:1881:d965:a7d9%20:

                            Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),

                        Approximate round trip times in milli-seconds:

                            Minimum = 0ms, Maximum = 0ms, Average = 0ms

                         

                        ping fe80::394e:1881:d965:a7d9%20

                         

                        Pinging fe80::394e:1881:d965:a7d9%20 with 32 bytes of data:

                        Reply from fe80::394e:1881:d965:a7d9%20: time<1ms

                        Reply from fe80::394e:1881:d965:a7d9%20: time<1ms

                        Reply from fe80::394e:1881:d965:a7d9%20: time<1ms

                        Reply from fe80::394e:1881:d965:a7d9%20: time<1ms

                         

                        Ping statistics for fe80::394e:1881:d965:a7d9%20:

                            Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),

                        Approximate round trip times in milli-seconds:

                            Minimum = 0ms, Maximum = 0ms, Average = 0ms

                         

                        lsnrctl status

                         

                        LSNRCTL for 64-bit Windows: Version 11.2.0.2.0 - Production on 21-JAN-2017 14:04:15

                         

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

                         

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

                        STATUS of the LISTENER

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

                        Alias                     LISTENER

                        Version                   TNSLSNR for 64-bit Windows: Version 11.2.0.2.0 - Production

                        Start Date                21-JAN-2017 11:35:34

                        Uptime                    0 days 2 hr. 28 min. 42 sec

                        Trace Level               off

                        Security                  ON: Local OS Authentication

                        SNMP                      OFF

                        Default Service           XE

                        Listener Parameter File   D:\oraclexe\app\oracle\product\11.2.0\server\network\admin\listener.ora

                        Listener Log File         D:\oraclexe\app\oracle\diag\tnslsnr\Labtop23\listener\alert\log.xml

                        Listening Endpoints Summary...

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

                          (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=fe80::394e:1881:d965:a7d9%20)(PORT=1521)))

                          (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=Labtop23)(PORT=8080))(Presentation=HTTP)(Session=RAW))

                        Services Summary...

                        Service "XEXDB" has 1 instance(s).

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

                        Service "xe" has 1 instance(s).

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

                        The command completed successfully