1 2 Previous Next 15 Replies Latest reply: Oct 10, 2012 10:43 AM by yoonas RSS

    ORA-12154: TNS:could not resolve the connect identifier specified

    967171
      Hi All,

      Thank you for advance.

      I have installed the Oracle, SQL Developer and Oracle Data Provider for .NET successfully in my server.

      I can access the oracle database using SQLPlus and Oracle developer without any error.

      if i connect with asp.net application, getting the following errors,
      ORA-12154: TNS:could not resolve the connect identifier specified


      Reference

      tnsnames.ora :

      MYSERVER =
      (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = ORAServer)(PORT = 1521))
      (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = MYSERVER )
      )
      )

      connection string :
      string constr = "User Id=myuser;Password=mypass;Data Source=MYSERVER";


      How can i fix that issue.
        • 1. Re: ORA-12154: TNS:could not resolve the connect identifier specified
          yoonas
          Hi,

          start sqlplus from run and try

          sqlplus myuser/mypass@MYSERVER



          Regards
          Yoonas
          • 2. Re: ORA-12154: TNS:could not resolve the connect identifier specified
            Tridus
            What version of Windows? Is it 64-bit?

            If you've got both 32 and 64 bit Oracle clients installed, make sure both of them have the same tnsnames.ora file. They each need their own copy.
            • 3. Re: ORA-12154: TNS:could not resolve the connect identifier specified
              967171
              Hi Yoonas,

              Thank you for your response.

              if i connect run and sqlplus myuser/mypass@MYSERVER,
              getting "ORA-12154: TNS:could not resolve the connect identifier" error.

              but i can connect with sqlplus(using oracle program file menu) using myuser/mypass@MYSERVER.
              • 4. Re: ORA-12154: TNS:could not resolve the connect identifier specified
                967171
                Hi Tridus,

                we are using windows server 2008 (64 bit operating system) and installed 64 bit oracle client
                • 5. Re: ORA-12154: TNS:could not resolve the connect identifier specified
                  yoonas
                  Hi,

                  You first installed oracle database then client, i guess. Check your client home and look for tnsnames in the client home add the same entry you posted before to this tnsnames.ora file

                  Regards
                  Yoonas
                  • 6. Re: ORA-12154: TNS:could not resolve the connect identifier specified
                    967171
                    Yes Yoonas, First i installed oracle database and then client (Oracle Data Provider for .NET).

                    I have checked the server and client home.

                    Server : C:\....\product\11.2.0\dbhome_1\network\admin\
                    Client : F:\....\product\11.2.0\client_1\network\admin\


                    in server contain the tnsnames.ora file. and also contain listerner.ora,sqlnet.ora .

                    but the client folder is empty.

                    can i create the tnsnames.ora file for client home?.


                    Now i have removed the client and check asp.net web application. getting the following error,

                    "The provider is not compatible with the version of Oracle client "

                    So i am going to install the client and also reinstall the visual studio 2010 ultimate.

                    Please advice me the what are the priority, how can i configure with poth.


                    my plan is visual studio 2010 ultimate web application intract with the oracle 11g database using the Oracle Data Provider for .NET.

                    Already i downloaded the Oracle Data Provider for .NET from
                    http://www.oracle.com/technetwork/database/windows/downloads/index-090165.html
                    • 7. Re: ORA-12154: TNS:could not resolve the connect identifier specified
                      yoonas
                      Hi,

                      If you have not already removed Just copy the tnsname.ora from server folder and paste in F:\....\product\11.2.0\client_1\network\admin\ folder. If you have already removed reinstall and copy it to your client home netword\admin folder.
                      Now try connecting as i said earlier (from run sqlplus).

                      Regards
                      Yoonas
                      • 8. Re: ORA-12154: TNS:could not resolve the connect identifier specified
                        967171
                        Hi Yoonas,

                        Yesterday copy the tnsname.ora from server folder and paste in F:\....\product\11.2.0\client_1\network\admin\ folder.
                        but getting the same error. Can we need any other files maintain in client like sqlnet.ora,listerner.ora?.

                        I will install again the client and maintain the tnsname.ora also.

                        can i reinstall the visual studio?
                        • 9. Re: ORA-12154: TNS:could not resolve the connect identifier specified
                          yoonas
                          Hi,

                          Pleas post the output of lsnrctl and content of sqlnet,listener.

                          To run lsnrctl > start command prompt and enter lsnrctl status


                          Regards
                          Yoonas

                          Edited by: yoonus on Oct 10, 2012 8:08 AM
                          • 10. Re: ORA-12154: TNS:could not resolve the connect identifier specified
                            967171
                            I have installed the *"64-bit ODAC 11.2 Release 4 (11.2.0.3.0) for Windows x64"* with install existing oracle home and getting the following errors popup in instalation process,

                            oracle data access components for oracle server 11.2.0.3.0 can only be installed over on existing oracle database server 11.2.0.3.0.

                            but i tried 11.2.0.3.0 version only.
                            • 11. Re: ORA-12154: TNS:could not resolve the connect identifier specified
                              967171
                              Hi Yoonas,

                              my listener status,
                              Microsoft Windows [Version 6.1.7601]
                              Copyright (c) 2009 Microsoft Corporation. All rights reserved.

                              C:\Users\Administrator>lsnrctl status

                              LSNRCTL for 64-bit Windows: Version 11.2.0.1.0 - Production on 10-OCT-2012 08:13
                              :37

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

                              Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
                              TNS-12541: TNS:no listener
                              TNS-12560: TNS:protocol adapter error
                              TNS-00511: No listener
                              64-bit Windows Error: 2: No such file or directory
                              Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=MYServer)(PORT=1521)))
                              TNS-12541: TNS:no listener
                              TNS-12560: TNS:protocol adapter error
                              TNS-00511: No listener
                              64-bit Windows Error: 61: Unknown error

                              C:\Users\Administrator>
                              • 12. Re: ORA-12154: TNS:could not resolve the connect identifier specified
                                yoonas
                                Hi,

                                You removed server as well?
                                Are you selecting correct home for installation . Make sure you are not selecting your client installation home.

                                Regards
                                Yoonas
                                • 13. Re: ORA-12154: TNS:could not resolve the connect identifier specified
                                  yoonas
                                  Hi,

                                  Start the listener with lsnrctl start and then post the status output again.

                                  regards
                                  Yoonas
                                  • 14. Re: ORA-12154: TNS:could not resolve the connect identifier specified
                                    967171
                                    LSNRCTL for 64-bit Windows: Version 11.2.0.1.0 - Production on 10-OCT-2012 08:28
                                    :18

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

                                    Starting tnslsnr: please wait...

                                    Failed to open service <OracleodacTNSListener>, error 1060.
                                    TNSLSNR for 64-bit Windows: Version 11.2.0.1.0 - Production
                                    System parameter file is H:\app\Administrator\product\11.2.0\dbhome_1\network\ad
                                    min\listener.ora
                                    Log messages written to h:\app\administrator\diag\tnslsnr\MYServer\listener\aler
                                    t\log.xml
                                    Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROC1521
                                    ipc)))
                                    Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=MYServer)(PORT=1521)))

                                    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 10-OCT-2012 08:28:20
                                    Uptime 0 days 0 hr. 0 min. 1 sec
                                    Trace Level off
                                    Security ON: Local OS Authentication
                                    SNMP OFF
                                    Listener Parameter File H:\app\Administrator\product\11.2.0\dbhome_1\network\a
                                    dmin\listener.ora
                                    Listener Log File h:\app\administrator\diag\tnslsnr\MYServer\listener\al
                                    ert\log.xml
                                    Listening Endpoints Summary...
                                    (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROC1521ipc)))
                                    (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=MYServer)(PORT=1521)))
                                    Services Summary...
                                    Service "CLRExtProc" has 1 instance(s).
                                    Instance "CLRExtProc", status UNKNOWN, has 1 handler(s) for this service...
                                    The command completed successfully

                                    C:\Users\Administrator>lsnrctl status

                                    LSNRCTL for 64-bit Windows: Version 11.2.0.1.0 - Production on 10-OCT-2012 08:28
                                    :29

                                    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 10-OCT-2012 08:28:20
                                    Uptime 0 days 0 hr. 0 min. 9 sec
                                    Trace Level off
                                    Security ON: Local OS Authentication
                                    SNMP OFF
                                    Listener Parameter File H:\app\Administrator\product\11.2.0\dbhome_1\network\a
                                    dmin\listener.ora
                                    Listener Log File h:\app\administrator\diag\tnslsnr\MYServer\listener\al
                                    ert\log.xml
                                    Listening Endpoints Summary...
                                    (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROC1521ipc)))
                                    (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=MYServer)(PORT=1521)))
                                    Services Summary...
                                    Service "CLRExtProc" has 1 instance(s).
                                    Instance "CLRExtProc", status UNKNOWN, has 1 handler(s) for this service...
                                    The command completed successfully

                                    C:\Users\Administrator>
                                    1 2 Previous Next