8 Replies Latest reply on Jun 4, 2013 4:18 PM by Gary Graham-Oracle

    The Network Adapter not connecting to remote server

    1012168
      My office computer was recently updated to Windows 7 64-bit so I've had to reinstall everything. Part of my job includes pulling data from two separate databases on a remote Oracle server. Previously with Windows 32-bit, Oracle SQL Developer worked after I installed the Oracle Client and configured the TNS settings using Net Manager. However now in SQL Developer, I'm getting the following error when trying to connect to the databases using the exact TNS settings as before.

      Error: "Status : Failure -Test failed: The Network Adapter could not establish the connection"

      Versions:
      Windows 7 64-bit
      Oracle SQL Developer 3.2.2 (64-bit)
      Java SE DK 6 Update 43 (64-bit)
      Oracle Client 11g R2 (64-bit)

      I've set up both databases under Service Naming in Oracle Net Manager. I used screenshots of my previous Net Manager settings to create the connections so everything is correct. Also, both connections test successfully in Net Manager. The tnsnames.ora file contains

      PROD =
      (DESCRIPTION =
      (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = thor)(PORT = 1526))
      )
      (CONNECT_DATA =
      (SERVICE_NAME = PROD)
      )
      )

      DWHOUSE =
      (DESCRIPTION =
      (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = thor)(PORT = 1526))
      )
      (CONNECT_DATA =
      (SERVICE_NAME = DWHOUSE)
      )
      )


      In SQL Developer, I matched the new connection settings exactly as before using another screenshot of my previous developer connections. For example, I selected "TNS" from Connection Type and selected "DWHOUSE" for the Network Alias. I even tried to put the connection string as the Connect Identifier, but everything I tried gave the connection error.

      I followed some of the suggestions in other threads but everything seemed to work, such as I was able to connect to both databases using SQL Plus. Also, both "tnsping prod" and "tnsping dwhouse" resulted in an OK. Even ODBC using the Oracle driver works to connect to these databases.

      I thought installing the JDK, Oracle Client, and SQL Developer along with my screenshots would be an easy, no-hassle process to connect to these databases. Am I doing something wrong? What else can I try?
        • 1. Re: The Network Adapter not connecting to remote server
          Gary Graham-Oracle
          Hi,

          Indeed, it seems you prepared very carefully. The only thing I would have recommended, from the preparation perspective, is to have put backup copies of the old system's tnsnames.ora file (and an exported copy of SQL Developer's connection.xml file) on a flash drive rather than rely on screen shots as recreation aids.

          Given the current situation, however, you may wish to try one of the following:
          1. Rather than use the TNS connection type, try the Basic connection type with the host/port/SID or Service from the TNS settings.
          2. Use the TNS connection type connections you have, but point SQL Developer explicitly to the tnsnames.ora file via:
          Tools -> Preferences -> Database -> Advanced -> Tnsnames Directory
          This could be a tough one given the fact SQL*Plus works fine for you.

          Regards,
          Gary
          • 2. Re: The Network Adapter not connecting to remote server
            Jim Smith
            One possible cause is that the Windows 7 firewall is blocking java.exe and/or sqldeveloper.exe from using the network.
            • 3. Re: The Network Adapter not connecting to remote server
              1012168
              Gary,

              Your mention of backup copies reminded me that I have a backup of my entire hard drive on an external drive. I decided to run SQL Developer, which is version 2.1.1.64, from the external drive (G:) to see if I could back up the connections to a xml. First, to get SQL Developer to work, I pointed java (jdk1.6.0_21) and the tns locations to my G: drive. I also checked the original tns file. The only difference between by current one and the original (working) one was that the Service Names of both connections were in lowercase, e.g. SERVICE_NAME = dwhouse. The connections in the G: drive SQL Developer worked successfully, so I exported them to .xml. Then, I imported them into the new SQL Developer, but I still received the network connection error when testing the connections.

              I'm not sure if the problem is the newer jdk1.6.0_43 and/or newer SQL Developer 3.2.2. I'd rather not revert back to older versions if I don't have to. Any more ideas?


              Jim: Since the G: version worked, I don't think it's the firewall, but thanks for the suggestion.

              Thanks,
              Jen
              • 4. Re: The Network Adapter not connecting to remote server
                Gary Graham-Oracle
                Jen,

                Whenever I see a post with The Network Adapter could not establish the connection, I just Google it and find this blog:
                http://javaeesupportpatterns.blogspot.com/2011/08/network-adapter-could-not-establish.html

                to remind myself about situations that could be responsible. You might try replacing the host thor with the actual IP address, either by placing it in an alternate SQL Developer connection name of connection type Basic, or perhaps by adding it to your /etc/hosts file (on Wndows 7, C:\Windows\System32\drivers\etc\hosts)

                Hope this helps,
                Gary
                • 5. Re: The Network Adapter not connecting to remote server
                  Gary Graham-Oracle
                  Of course, the most striking point in your last post concerns the old SQL Developer install connecting just fine when run from the G-drive.

                  Although I am uncertain of the precise rules, I have noticed that when the Oracle client resides on the C-drive, but the SQL Developer install is elsewhere, SQL Developer picks up certain files in its install directory rather than from the Oracle client. One example is the ojdbc6.jar file. So you might also try installing SQL Developer 3.2 on some other drive (external or internal non-C-drive) and see if that works.

                  -Gary
                  • 6. Re: The Network Adapter not connecting to remote server
                    1012168
                    Gary,

                    Well, I looked over the article, and it was over my head. It's possible that I saw it on Google and dismissed it. :)

                    I tried using the IP address under the Basic connection type, but it didn't work. As far as moving the SQL Developer install, I forgot that I was running it from the Downloads folder in my home directory (U:) on the network. When I moved the folder to the C drive, it worked! Though, I don't understand why the older version worked on the G drive, but the newer version did not on the U drive even though I had explicitly pointed the newer version to Oracle directory when I told it where my tnsnames file was.

                    Thanks for all your help!

                    Jen
                    • 7. Re: The Network Adapter not connecting to remote server
                      Jim Smith
                      Windows 7 security feature. Programs from 'the internet' probably have restricted access. Network drives seem to count as the internet.

                      I get prompted when something gets blocked, but you may have switched that off without noticing.
                      • 8. Re: The Network Adapter not connecting to remote server
                        Gary Graham-Oracle
                        Thanks Jim, rather than learning the ins & outs of each new Windows version it is always my hope that things will just keep on working as before, but no such luck!

                        On Windows 7, I think that particular feature is configured in...
                        Control Panel -> Internet Options -> Security -> Local Intranet -> Sites
                        then adjust which paths / sites to include via the check box options