7 Replies Latest reply: Oct 14, 2013 10:32 AM by Jim Smith RSS

    Sql developer - not able to establish connection

    Priyanka_S

      I have installed sql developer 3.2.2 and now I am trying to establish a connection with the database 'orcl' which I just created. But it is giving me a 'socket read timed out error' with vendor code 504. Please help. Thanks in advance.

        • 1. Re: Sql developer - not able to establish connection
          Jim Smith

          Sounds like a firewall issue.

           

          What operating system are you running SQL Developer on?

          What operating system is the database running on?

          How have you defined your connection?

          How does that compare to the host/port/sid for the database you created?

          • 2. Re: Sql developer - not able to establish connection
            Priyanka_S

            I am using Windows 7. While creating the new database connection, I selected the connection type as 'TNS' and role as 'default'.

            The Network Alias as 'orcl' which was an option in the drop down menu. I gave the same name in the 'Connection name' .

            I gave the username and pwd and saved the connection. Now when I try to connect, it gives me the timed out error.

            I am new to SQL and I did these steps after seeing a video for the same on youtube.

            • 3. Re: Sql developer - not able to establish connection
              Jim Smith

              Is the database up and running?  Check Control Panel services for something like OracleServiceORCL

              Is the listener up?   Open a command window and type "lsnrctl status"

              Is the database connection properly defined?  In the command window type "tnsping orcl"

              Is windows firewall enabled?  Try opening port 1521 in the firewall.

              • 4. Re: Sql developer - not able to establish connection
                Priyanka_S

                The control panel shows the startup type as Automatic and status = started for OracleServiceORCL.

                What do i have to look for after typing the commands? The command 'lsnrctl status' completed successfully.

                The command 'tnsping orcl' did not return any such message. The last stmt on the command line was 'Attempting to contact.....'

                Windows firewall is not enabled. It is not using the recommended settings, I am trying to fix that.

                Thanks for your help.

                • 5. Re: Sql developer - not able to establish connection
                  Jim Smith

                  The lsnrctl status should show  what databases are known to the listener and are therefore available to connect to.

                  tnsping should show the connection definition (host, port, sid or service) for the named service, and whether it is accessible. 

                   

                  it doesn't look as if you connected successfully.

                   

                  Post the output from the commands here.

                  • 6. Re: Sql developer - not able to establish connection
                    Priyanka_S

                    The output from 'lsnrctl status' is -

                    C:\Users\Bits>lsnrctl status

                     

                     

                    LSNRCTL for 64-bit Windows: Version 11.2.0.1.0 - Production on 11-OCT-2013 22:59

                    :55

                     

                     

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

                     

                     

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

                    STATUS of the LISTENER

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

                    Alias                     LISTENER

                    Version                   TNSLSNR for 64-bit Windows: Version 11.2.0.1.0 - Produ

                    ction

                    Start Date                11-OCT-2013 10:18:43

                    Uptime                    0 days 12 hr. 41 min. 38 sec

                    Trace Level               off

                    Security                  ON: Local OS Authentication

                    SNMP                      OFF

                    Listener Parameter File   C:\Oracle\Bits\product\11.2.0\dbhome_1\network\admin\l

                    istener.ora

                    Listener Log File         c:\oracle\bits\diag\tnslsnr\Bits-PC\listener\alert\log

                    .xml

                    Listening Endpoints Summary...

                      (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROC1521ipc)))

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

                    Services Summary...

                    Service "CLRExtProc" has 1 instance(s).

                      Instance "CLRExtProc", status UNKNOWN, has 1 handler(s) for this service...

                    Service "orcl" has 1 instance(s).

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

                    Service "orclXDB" has 1 instance(s).

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

                    The command completed successfully.

                     

                     

                    The output for 'tnsping orcl' is -

                    C:\Users\Bits>tnsping orcl

                     

                     

                    TNS Ping Utility for 64-bit Windows: Version 11.2.0.1.0 - Production on 11-OCT-2

                    013 23:04:28

                     

                     

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

                     

                     

                    Used parameter files:

                    C:\Oracle\Bits\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 = localhos

                    t)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = orcl)))

                    OK (0 msec)

                     

                    The windows firewall is not working on my computer. Is that causing this issue?

                    • 7. Re: Sql developer - not able to establish connection
                      Jim Smith

                      Those look OK. 

                      Providing SQL Developer is picking up the corret TNSNAMES.ORA, there doesn't seem to be any reason you can't connect from SQL Developer.  Do you have more than one tnsnames.ora?

                       

                      An alternative is to use a Basic connection and specify, localhost, 1521, orcl as host,port,sid.