9 Replies Latest reply on Jul 18, 2013 5:05 PM by 932a44c8-b9d7-4fea-8352-1f1e0d172d71

    The Network Adapter could not establish the connection

    user5827076
      I have sqldeveloper 3.1.06. DB 11.2.0.3 running on 64bit RedHat 2 node cluster using scan listener with 3 ips.

      I have a few scan listeners I am trying to connect to. That I can connect to using the jdbc url using sqlplus.

      Proof of connection

      C:\Documents and Settings\msouthcott>sqlplus bp_ls/carb0n@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=vc-orcltrx-scan.something.com)(PORT=1521))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=vcqa.something.com)))

      SQL*Plus: Release 11.2.0.1.0 Production on Tue Apr 24 09:41:20 2012

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


      Connected to:
      Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
      With the Partitioning, Real Application Clusters, OLAP, Data Mining
      and Real Application Testing options

      SQL>

      End Proof

      Yet sqldeveloper never connects to this jdbc or tnsnames connection. Always reports The Network Adapter could not establish the connection.

      Before anyone starts asking me to ping etc. I can connect I can connect every time without fail using sqlplus. nslookup returns 3 ips all ips are working and are pingable. All other apps (mostly Linux) work fine. It is just this sqldeveloper that doesn't. Even pl/sql developer works fine with this connection.

      Every time I test the connection with sqldeveloper I get the same result.

      Anyone else have this issue? Any idea what is causing this?
        • 1. Re: The Network Adapter could not establish the connection
          Gary Graham-Oracle
          Hi,

          Although I have no direct experience with Single Client Access Name (SCAN) listeners, supposedly the JDBC 11g2 thin driver supports it. SQL Developer 3.0 and 3.1 ship with 11.2.0.2 (ojdbc6.jar), but if your environment has set an ORACLE_HOME variable, SQL Developer will prefer some ojdbc jar (usually either ojdbc5 or ojdbc6) from that home instead. So that could be the cause if the ojdbc5.jar is mistakenly picked up instead of ojdbc6.jar.

          To verify which you are actually using, go to the Help|About|Properties tab and look for the jdbc.property value.

          If you are correctly pointing at a ojdbc6.jar, then perhaps SQL Developer is missing something in its code necessary to support SCAN. In that case, you might try either of...

          1. Tools|Preferences|Database|Advanced and tick-off the Use OCI/Thick driver check-box.
          2. Create a tnsnames.ora file with a descriptor specifying an address_list with all the hosts/host ips as a workaround.

          For (2), you can also use Tools|Preferences|Database|Advanced to point explicitly at the directory where this tnsnames.ora resides.

          If you are somehow pointing at a ojdbc5.jar instead, you can try forcing the use of the ojdbc6.jar we ship, as described in the following post:
          Re: Migrate from sql developer 1.5x to 3.x

          Hope this helps,
          Gary
          SQL Developer Team
          • 2. Re: The Network Adapter could not establish the connection
            user5827076
            I sort of have it figured out. Thanks for the instructions.

            I have a database that is in the process of moving from old listeners on port 1522 to new listeners on port 1521 the scan listeners. The local listener parameter is for 1522, the remote listener parameter is 1521. Whenever you connect and try and get into 1521 it is redirected to 1522 but without redirecting to the correct ip. This is where sqldeveloper( maybe java ) falls down. Where other applications seem to be able to fail over to a new port without issue jdbc does not seem to be able to accomplish this. Can anyone verify I am not a java guru or odbc guru.

            Edited by: user5827076 on Apr 30, 2012 12:35 PM
            • 3. Re: The Network Adapter could not establish the connection
              Gary Graham-Oracle
              Hi,

              Did you ever confirm which ojdbc jar (5 or 6) SQL Developer points to and whether your preference setting is for OCI/Thick or Thin? If you think JDBC is at fault rather than the SCAN configuration, then these could be factors.

              Also, you never identified exactly which SQL Developer connection types you tried. I imagine that Service name might work better than SID for the Basic type in a SCAN scenario. For a TNS type, did you try both variations: Network Alias; Connect Identifier? How about the Custom JDBC URL for an Advanced type?

              Anyway, as I noted before, I don't know much about SCAN, but your comments about moving from "old listeners" to "new listeners" and "local listener parameter" versus "remote listener parameter" have me wondering about your SCAN configuration. The following document link has lots of caveats about this in the Version and Backward Compatibility section on page 5:
              http://www.oracle.com/technetwork/products/clustering/overview/scan-129069.pdf

              Hope this helps,
              Gary
              • 4. Re: The Network Adapter could not establish the connection
                user5827076
                I tried 5 and 6 both exhibit the same results. I eventually built a quick jdbc connect class and traced the network packets with wire shark and found everytime the connection is told to connect to a different port than 1521 jdbc fails. All other programs not using jdbc do not fail. So having 2 listeners on different ports for the same db does not look good for jdbc.
                • 5. Re: The Network Adapter could not establish the connection
                  Gary Graham-Oracle
                  Thanks for the feedback. It's good to know this issue is not specific to SQL Developer.

                  According to the doc I read a day or two ago, JDBC is supposed to work. That means either a bug for it exists or one should be logged -- unless it is just some configuration problem with SCAN at your site.

                  Your options for pursuing this are:
                  1. JDBC forum: Java Database Connectivity (JDBC)
                  2. One of the Database forums, maybe General: General Database Discussions
                  3. Log an SR with Oracle Support. Your DB version is current, so I assume you are operating under a support agreement.

                  Best Wishes,
                  Gary

                  Edited by: Gary Graham on May 1, 2012 11:56 AM
                  In fact, searching for +"Single Client Access Name" across All Categories for the last 90 days only gets 17 hits, mostly in the RAC, ASM, and Clusterware installation forum. Here is a sample thread with two listeners on two ports and an argument over configuration:
                  Re: Listener issue in RAC?
                  • 6. Re: The Network Adapter could not establish the connection
                    berx
                    Can you please provide us the setting of
                     local_listener 
                    of all your instances? We will find the reason there, I'm sure.
                    I had several similar issues in the past, JDBC is just more strict than other implementations.
                    • 7. Re: The Network Adapter could not establish the connection
                      Gary Graham-Oracle
                      The original poster has opted to pursue this question in the JDBC forum:
                      JDBC Connection to RAC with 2 listeners 2 ports errors out

                      You can find the local_listener string there.

                      -Gary
                      • 8. Re: The Network Adapter could not establish the connection
                        187842
                        If anyone is running into the "Network Adapter could not establish the connection" issue with sqldeveloper, make sure that the folder where your tnsnames.ora file resides only has one copy of the tnsnames.ora file with no backup copies like tnsnames.ora.20120116_backup. If you have a db called SOME_DB in tnsnames.ora and tnsnames.ora.20120116_backup, sqldeveloper will find both entries of SOME_DB. Then, if there is a difference between those addresses (ie different port), then there is a conflict and sql developer will provide the Nework Adapter error message. Remove the backup copies of tnsnames.ora and then restart sql developer. If everything is correct, you should only see one occurrence of the db name in the drop down list for TNS when setting up your connection. If you have one entry for your db, then you will probably be able to connect. If you have multiple ones, then there is a chance one of them could be conflicting - you need to find the conflict and remove it. If you have multiple entries and CAN connect, it simply means that all the copies have the same address (same port, server name, etc.). Make sure you restart sqldeveloper though, otherwise it still "sees" the files even though you have removed them. Good luck.
                        • 9. Re: The Network Adapter could not establish the connection
                          932a44c8-b9d7-4fea-8352-1f1e0d172d71

                          thanks a lot for ur valuable info !!!!!!!!!!!!!!!!!!!!!!!!!!!

                          743025 wrote:

                           

                          I sort of have it figured out. Thanks for the instructions.

                          I have a database that is in the process of moving from old listeners on port 1522 to new listeners on port 1521 the scan listeners. The local listener parameter is for 1522, the remote listener parameter is 1521. Whenever you connect and try and get into 1521 it is redirected to 1522 but without redirecting to the correct ip. This is where sqldeveloper( maybe java ) falls down. Where other applications seem to be able to fail over to a new port without issue jdbc does not seem to be able to accomplish this. Can anyone verify I am not a java guru or odbc guru.

                          Edited by: user5827076 on Apr 30, 2012 12:35 PM