8 Replies Latest reply: Jul 13, 2011 8:58 AM by lake RSS

    Ora 12154: TNS could not resolve connect identifier specified

    703317
      Hi,

      I have Oracle 11g (Release 1_32bit) Client on my C:\ drive which connect to a Remote 11g (11.1.0.7.0 - 64bit) server.
      I have installed 10g DB Server(10.2.0.1.0) and Oracle 10g Forms(Forms [32 Bit] Version 10.1.2.0.2 ) on my D:\ drive.

      When I try to connect to Oracle 10g DB from Forms using "Connect" button, I get following error:
      "ORA-12154: TNS: could not resolve the connect identifier specified"

      Tns and Listner files both are same in Developer_Suite home and 10g home.

      Can someone please help me with this error?

      Thanks
        • 1. Re: Ora 12154: TNS could not resolve connect identifier specified
          Paul M.
          "ORA-12154: TNS: could not resolve the connect identifier specified"
          $ oerr ora 12154
          12154, 00000, "TNS:could not resolve the connect identifier specified"
          // *Cause:  A connection to a database or other service was requested using
          // a connect identifier, and the connect identifier specified could not
          // be resolved into a connect descriptor using one of the naming methods
          // configured. For example, if the type of connect identifier used was a
          // net service name then the net service name could not be found in a
          // naming method repository, or the repository could not be
          // located or reached.
          // *Action:
          //   - If you are using local naming (TNSNAMES.ORA file):
          //      - Make sure that "TNSNAMES" is listed as one of the values of the
          //        NAMES.DIRECTORY_PATH parameter in the Oracle Net profile
          //        (SQLNET.ORA)
          //      - Verify that a TNSNAMES.ORA file exists and is in the proper
          //        directory and is accessible.
          //      - Check that the net service name used as the connect identifier
          //        exists in the TNSNAMES.ORA file.
          //      - Make sure there are no syntax errors anywhere in the TNSNAMES.ORA
          //        file.  Look for unmatched parentheses or stray characters. Errors
          //        in a TNSNAMES.ORA file may make it unusable.
          //   - If you are using directory naming:
          //      - Verify that "LDAP" is listed as one of the values of the
          //        NAMES.DIRETORY_PATH parameter in the Oracle Net profile
          //        (SQLNET.ORA).
          //      - Verify that the LDAP directory server is up and that it is
          //        accessible.
          //      - Verify that the net service name or database name used as the
          //        connect identifier is configured in the directory.
          //      - Verify that the default context being used is correct by
          //        specifying a fully qualified net service name or a full LDAP DN
          //        as the connect identifier
          //   - If you are using easy connect naming:
          //      - Verify that "EZCONNECT" is listed as one of the values of the
          //        NAMES.DIRETORY_PATH parameter in the Oracle Net profile
          //        (SQLNET.ORA).
          //      - Make sure the host, port and service name specified
          //        are correct.
          //      - Try enclosing the connect identifier in quote marks.
          //
          //   See the Oracle Net Services Administrators Guide or the Oracle
          //   operating system specific guide for more information on naming.
          $
          Tns and Listner files both are same in Developer_Suite home and 10g home.
          Listener files are totally useless in Developer Suite home, since they are server files.
          • 2. Re: Ora 12154: TNS could not resolve connect identifier specified
            703317
            Thanks Paul for replying back but still it doesn't solve the purpose.

            I checked everything and its the same as given but still I am getting same error.

            Another thing, if I connect through Sql plus listed in the Developer suite (Program -> Developer Suite ->Application Development -> SQL Plus), it connects but same thing doesn't work through Forms
            • 3. Re: Ora 12154: TNS could not resolve connect identifier specified
              Amatu Allah Neveen Ebrahim
              Hi
              still it doesn't solve the purpose.
              did u google for the error ?

              Pls have a look here ....


              Hope this helps...

              Regards,

              Amatu Allah.
              • 4. Re: Ora 12154: TNS could not resolve connect identifier specified
                703317
                Hi Amatu,

                I had checked this already but it doesn't work.

                Thanks
                • 5. Re: Ora 12154: TNS could not resolve connect identifier specified
                  robinxx
                  One problem I've had in the past is needing to put GLOBAL in the tnsnames.ora (If you're using tnsnames.ora. Otherwise, never mind.)

                  myservice =
                  (DESCRIPTION =
                  (ADDRESS = (PROTOCOL = TCP)(HOST = 1.2.3.4)(PORT = 9999))
                  (CONNECT_DATA =
                  (SERVER = DEDICATED)
                  (SERVICE_NAME = myservice)
                  (GLOBAL_NAME = myservice)
                  )
                  )

                  So try putting the global_name line name in there. Tnsnames is of course linked to what the server is serving.
                  Yes i have better luck with hard coded ip numbers than domain names.
                  I would search for all tnsnames.ora on the machine and see if any of them are not the correct thing. There is typically an incorrect one with every product in the network\admin directory. Replace them with the correct one. (correct is tnsping instance works) Even then you might end up having to stick a tnsnames.ora in a directory of binaries if some insist on not finding it. Yeah I know
                  about tns_admin but I've personally not had much luck with it.
                  • 6. Re: Ora 12154: TNS could not resolve connect identifier specified
                    703317
                    It's not working.

                    Can it be a problem beacause I have two oracle versions on my machine, 11g client on C: drive and 10g DB and 10g Developer Suite on D: and there is a confusion which tns to refer to?
                    • 7. Re: Ora 12154: TNS could not resolve connect identifier specified
                      Paul M.
                      if I connect through Sql plus listed in the Developer suite (Program -> Developer Suite ->Application Development -> SQL Plus), it connects but same thing doesn't work through Forms
                      That's very strange, since they should use the same tnsnames.ora (assuming you're using this one).

                      I'd try as follows : create a .bat file where you

                      - set Developer suite environment (e.g. ORACLE_HOME and PATH)

                      - set TNS_ADMIN environment variable, pointing to a directory where is a tnsnames.ora you know is working

                      - launch developer suite executable.

                      Create an icon on the desktop and try starting this way.
                      • 8. Re: Ora 12154: TNS could not resolve connect identifier specified
                        lake
                        You have a remote 11g database and you can connect to it?
                        You just can't connect to the local 10g database?
                        You did start the instance and the listener on your local database?

                        Note that if you have multiple tnsnames.ora entries they will need to be combined into one see below and that has to be the case
                        particularly for the one forms is using. And the local database has to be running and the listener has to be running.

                        Are you on a dhcp served machine? In that case Oracle has a thing with a loopback adapter that is very hard to understand.
                        Apparently no oracle product on windows does localhost out of the box. It has some kind of need to link the netbios hostname
                        to a localhost type (non routable) ip number. If you have this problem you had to have installed and configured the ms loopback adapter and
                        modified the hosts file c:\windows\system32\drivers\etc\hosts And ideally you did this before you installed anything that needs to
                        connect to the loopback adapter.
                        But you might be able to get it to use localhost with 127.0.0.1 hostname in there?
                        (note do hostname at command prompt to see for sure what it is.)
                        look and check that your sqlnet.ora and listener.ora are doing the right thing on your local database.

                        I don't think this makes a lick of sense but here's the official instructions:
                        http://download.oracle.com/docs/cd/B19306_01/install.102/b14316/reqs.htm#BABGCEAI
                        If you can make sure that your ip number never changes by thus configuring the dhcp server /router then you are in
                        business without this.

                        /* remote machine and loopback adapter entry. Must have right thing in hosts file whatever that is. */
                        /* note on the same windows machine there is an IPC connection defined */
                        REMOTE =
                        (DESCRIPTION =
                        (ADDRESS = (PROTOCOL = TCP)(HOST = 1.2.3.4)(PORT = 9999))
                        (CONNECT_DATA =
                        (SERVER = DEDICATED)
                        (SERVICE_NAME = remote)
                        (GLOBAL_NAME = remote)
                        )
                        )

                        LOOPY =
                        (DESCRIPTION =
                        (ADDRESS = (PROTOCOL = TCP)(HOST = 10.252.252.252)(PORT = 1521))
                        (CONNECT_DATA =
                        (SERVER = DEDICATED)
                        (SERVICE_NAME = ora11)
                        )
                        )