none
ORA-12154: TNS:could not resovle the connect identifier specified

    Question

  • Just installed VS 2010 Prof. - form the Server Explorer - I try to add Data Connection to Oracle database

    I get: ORA-12154: TNS:could not resovle the connect identifier specified

    BUT SQL, TNSPING and MSQuery thro OBDC all work fine so I know the TNSname definition is good.

    Doesnt matter wether i use OLE, ODBC, .NET for Oracle - all ot=ptions fali to connect.

    Any ideas???

    Kev

    Wednesday, August 17, 2011 11:56 AM

Answers

All replies

  • Hi Kev,

     

    Welcome to the MSDN forum.

     

    Under my research, for the error “ORA-12154: TNS:could not resovle the connect identifier specified”, the possible cause is that 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.

     

    I have found some possible solution about this issue:

    1.      Create the environment variable: ORACLE_HOME via: control panel > system > advanced > environment variables and then DBArtisan knew where to find tnsnames.ora.

    2.      Make sure that "TNSNAMES" is listed as one of the values of the NAMES.DIRECTORY_PATH parameter in the Oracle Net profile (SQLNET.ORA)

    3.      Verify that a TNSNAMES.ORA file exists and is in the proper directory and is accessible.

    4.      Check that the net service name used as the connect identifier exists in the TNSNAMES.ORA file.

    5.      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.

    6.      Change the Oracle connection from "TNSNAME Mode" to "Standard mode".

    7.      "Allow inprocess" has to be checked in the provider options.

     

    I hope this helps.

     

    Best Regards,


    Alexander Sun [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, August 22, 2011 7:24 AM
  • Thanks for the effort:-

    1. I added the Oracle Home path as a variable ORACLE_HOME - no change!

    2. TNSNAMEs is specificed with NAMES.DIRECTORY_PATH in the sqlnet.ora file

    3,4,5 the TSNAMES.ora is fine several other applications use the file and the connection parameters without problem - TNSpimng works fine.

    5 & 6 I don't understand where these parameters exist!?

    Cheers Kev


    Kev Gibson
    Monday, August 22, 2011 8:24 AM
  • Found a solution from link below

    http://stackoverflow.com/questions/4228739/vs2010-oracle-driver-ora-12154-tsncould-not-resolve-the-connect-identifier-s

    Rather than giving the TNSname i gave server/SDI eg //DHA03116-SSDp06:1521/GFDDev

    Connected OK.


    Kev Gibson
    • Marked as answer by KevGibson Monday, August 22, 2011 10:40 AM
    Monday, August 22, 2011 10:39 AM
  • Check if you have sqlnet.ora file in the same directory as tnsnames.ora. In the sqlnet.ora file make sure the following line is like this.

    this solved the problem for me...

    SQLNET.AUTHENTICATION_SERVICES= (NONE)   

    Monday, May 6, 2019 11:07 PM