locked
ORA-12154: TNS:could not resolve the connect identifier specified - error RRS feed

  • Question

  • User-563722881 posted

    Hi Team,

    I have tried all the method,

    1.Setting TNS_Admin env variable,

    2. Checked the tnsnames file fully, no error on this, because i am able to connect TOAD,

    but using dotnet if i run it , i got this error :ORA-12154: TNS:could not resolve the connect identifier specified

    3. I have tried Connection string as follows

    connString="user id=usridname;password=yourpassword;data source=(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=hostnamehere)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=servicenamehere)));"

    then i got this error : ORA-06413: Connection not open.

    Please anyone help on this, its very urgent.

    Thanks

    Selva.C

     

     

    Tuesday, April 3, 2012 12:37 PM

Answers

  • User269602965 posted

    So we still do not know about your environment.

    If the database server is on another machine, firewalls can block listening on Port 1521 (or what ever port you configured your listener to be),

    and generate this error.

    Not having Oracle Client installed can generate this error.

    Not having the correct tnsnames.ora configuration can cause this error.

    It is a generic error, with many causes, most causes are outside your application, and affected more by the Oracle configuration, network issues, and client installation issues.

    So give us more information about your setup.

    Is the application a web application or a windows application.

    What version is the database.

    Where is the database installed, same machine or remote machine

    If remote, you need to allow listening on the database server Oracle TNS Listener port configured in your database.

    What version of Oracle client is installed on the application server.

    Have you tried using the connection information on the application server using SQLPlus.

    etc.

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, April 4, 2012 8:40 PM

All replies

  • User269602965 posted

    Describe environment more.

    Database location??  Same server as the application or different server.

    What version of Oracle database?

    What version of ODP.NET?

    Put connection string in Web.Config like:

     <connectionStrings>    

    <add name="OraConnStr" connectionString="Data Source={DatabaseSID};Persist Security Info=True;User Id={SchemaName};Password={Password}" providerName="Oracle.DataAccess.Client"></add>

    </connectionStrings>

    then in code behind call connection string

        Dim connectionString As String = ConfigurationManager.ConnectionStrings("OraConnStr").ConnectionString

    Tuesday, April 3, 2012 8:34 PM
  • User-563722881 posted

    Hi

    Thanks for your reply,

    Initally I have used my project name as some xxx_sss() ie, with paranthesis.

    now i have changed the name to xxx alone.

    And also I have removed all the paranthesis in the connection string. my current connection string was :

    <add name="oracleConnectionString" connectionString="Data Source=xxx.xx.xxx.xxx;Persist Security Info=True;User Id=test;Password=sample123;" providerName="Oracle.DataAccess.Client"></add>

    Now I am getting the following error :

    ORA-12514: TNS:listener does not currently know of service requested in connect descriptor

    Please any one help , what is the problem on my code.

    Thanks in Advance,

    Selva.C

     

     

    Wednesday, April 4, 2012 2:32 AM
  • User269602965 posted

    So we still do not know about your environment.

    If the database server is on another machine, firewalls can block listening on Port 1521 (or what ever port you configured your listener to be),

    and generate this error.

    Not having Oracle Client installed can generate this error.

    Not having the correct tnsnames.ora configuration can cause this error.

    It is a generic error, with many causes, most causes are outside your application, and affected more by the Oracle configuration, network issues, and client installation issues.

    So give us more information about your setup.

    Is the application a web application or a windows application.

    What version is the database.

    Where is the database installed, same machine or remote machine

    If remote, you need to allow listening on the database server Oracle TNS Listener port configured in your database.

    What version of Oracle client is installed on the application server.

    Have you tried using the connection information on the application server using SQLPlus.

    etc.

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, April 4, 2012 8:40 PM