11 Replies Latest reply: Jun 20, 2014 6:09 AM by Billy~Verreynne RSS

    Not able to connect to the DB.

    976208

      Hi Experts,

       

       

      I am able to connect to DB using SQL*PLUS or TOAD.

      But I am not able to connect to the DB through the .net application.

       

       

      I am getting the error.

       

       

       

       

       

      TNS listener did not get any connect data from client

       

       

       

      Please help me.

       

       

      Thanks.

        • 1. Re: Not able to connect to the DB.
          John Stegeman

          Oh, if you are getting "the error," then you need to apply "the fix."

           

          Unfortunately, no one can tell you which fix until you tell us which error.

          • 2. Re: Not able to connect to the DB.
            976208

            Hi,

             

            This is the error.


            TNS listener did not get any connect data from client


            Please help me.


            Thanks.

            • 3. Re: Not able to connect to the DB.
              SKP

              What error you are getting using sql*plus?

              Are youtring to connect using sqlplus from DB server or any other client machine in the network ?

              Give the details

              • 4. Re: Not able to connect to the DB.
                Billy~Verreynne

                For an Oracle error, we expect an ORA-nnnn or TNS-nnnn error code.

                 

                From the contents of the error message, it would seem to be a firewall or hostname resolution issue. But then I would expect a "ORA-12545: Connect failed because target host or object does not exist" or a "ORA-12547 TNS:lost contact" error.

                 

                 

                So you need (as mentioned above already) to supply more details. Connection details used. Actual error trace/stack data that results.

                 

                 

                PS. Also could be something like a "ORA-12569: TNS:packet checksum failure" error - having the actual error code will go a long way in diagnosing the problem

                • 5. Re: Not able to connect to the DB.
                  976208

                  Hi,

                   

                  I am able to connect using SQL*PLUS or TOAD.

                  I am connecting from client machine.

                   

                  Complete error message is

                   

                  ORA-12502: TNS:listener received no CONNECT_DATA from client

                   

                  Thanks.

                  • 6. Re: Not able to connect to the DB.
                    Billy~Verreynne

                    a) What is the Oracle error code?

                    b) What connection details are used by the client?

                     

                    If you cannot answer this, how do you expect us to diagnose the error and offer a solution??

                    • 7. Re: Not able to connect to the DB.
                      976208

                      Hi,

                       

                      The oracle error code is ORA-12502:

                       

                      The TNS entry is

                       

                      SALEDEV=

                        (description =

                          (load_balance = on)

                          (failover = on)

                          (address_list =

                          (ADDRESS = (PROTOCOL = TCP)(HOST = salesukdbscn.uk.aps.com)(PORT = 1521))

                          )

                          (connect_data =

                            (failover_mode = (type = select)(method = basic)(retries = 20)(delay = 15))

                            (service_name = salesdev_sql)

                          )

                        )

                       

                      Thanks.

                      • 8. Re: Not able to connect to the DB.
                        Billy~Verreynne

                        You TNS connection string used in/created by the client, is invalid.

                         

                        The basic TNS connection string looks as follows:

                        (DESCRIPTION=

                          (ADDRESS= (PROTOCOL=TCP)(HOST=<ip|hostname>)(PORT=1521))

                          (CONNECT_DATA= (SERVICE_NAME=<service>) (SERVER={dedicated|shared}))

                        )

                         

                        Error lib says:

                        12502, 00000, "TNS:listener received no CONNECT_DATA from client"
                        // *Cause:  No CONNECT_DATA was passed to the listener.
                        // *Action: Check that the service name resolved from TNSNAMES.ORA has
                        // the CONNECT_DATA component of the connect descriptor.

                         

                        So the client does not send a valid TNS connection string to the listener.

                         

                        What connection details do you use in the client?

                        • 9. Re: Not able to connect to the DB.
                          Billy~Verreynne

                          976208 wrote:

                           

                          The TNS entry is

                           

                          SALEDEV=

                            (description =

                              (load_balance = on)

                              (failover = on)

                              (address_list =

                              (ADDRESS = (PROTOCOL = TCP)(HOST = salesukdbscn.uk.aps.com)(PORT = 1521))

                              )

                              (connect_data =

                                (failover_mode = (type = select)(method = basic)(retries = 20)(delay = 15))

                                (service_name = salesdev_sql)

                              )

                            )

                           

                           

                          Entry seems valid - works fine for me when I replace HOST and SERVICE_NAME attribute values with ones that are valid for my environment.

                           

                          So when you use the alias in your client, something goes wrong. It reads the wrong tnsnames.ora file and thus not the expected connection string. It reads the right file, but the read itself is scewy (charset issue for example). It reads the right file, but reformats/changes/modifies the connection string before using it. Etc.

                           

                          What is the client? How is its Oracle client environment set up?

                          • 10. Re: Not able to connect to the DB.
                            976208

                            Hi,

                             

                             

                            I am able to connect connect with the same TNS entry using SQL*PLUS.

                            But while connecting from .net I am getting this error.

                            Please help how to debug.

                             

                             

                            Version is Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit

                             

                             

                            Thanks.

                            • 11. Re: Not able to connect to the DB.
                              Billy~Verreynne

                              This would seem to be a .Net error - which is not only not the forum space's topic, but also not even an Oracle product or technology.

                               

                              The obvious error that comes to mind is that the .Net environment uses a different Oracle Client, or has the TNS_ADMIN environmental variable set (which points to a directory with a broken tnsnames/sqlnet file).

                               

                              From an Oracle perspective I suggest simplifying the issue by creating a sanity test. Add a very simple, very basic, and working, TNS connection string to the tnsnames.ora file. Test this with SQL*Plus, and then test this with the .Net client.