Click here to Skip to main content
15,893,594 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

i wonder if anyone can assist me. i keep getting an error ORA-12154: TNS Could not resolve the connection identifier. i installed the oracle instant client and odbc connections downloaded from oracle. the OS is windows 7 64 bit. as i understand it is not necessary to install an actual oracle home for the connections. but whenever i try to connect to the database via visual studio 2010 i get the ORA-12154: TNS: Could not resolve the connection identifier specified. i am at a loss at what i am need to do to fix this as i can't find the tnsnames.ora or the listener.ora file .
any help will be greatly appreciated
thank you
Kallie
Posted

Hello Kallie,

Oracle Instant Client does not really requires the TNS configuration (tnsnames.ora). According to documentation Instant Client allows you to run your applications without installing the standard Oracle client or having an ORACLE_HOME. So it does uses a slightly different connection string syntax. You can use any one of the following syntax with the instant client.

  • A SQL Connect URL string of the form:
    //host:[port][/service name]
    
    e.g. //oradb01.foo.com:1521/orcl
  • As an Oracle Net keyword-value pair.
    (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp) (HOST=HOSTNAME_OR_IP) 
    (PORT=1521)) 
    (CONNECT_DATA=(SERVICE_NAME=SERVICE_NAME))) 
    
    e.g.
    (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp) (HOST=oradb01.foo.com) 
    (PORT=1521)) 
    (CONNECT_DATA=(SERVICE_NAME=orcl)))

As per the documentation Naming methods that require TNS_ADMIN to locate configuration files continue to work if the TNS_ADMIN environment variable is set. If the TNS_ADMIN environment variable is not set, and TNSNAMES entries are used, then the ORACLE_HOME variable must be set, and the configuration files are expected to be in the $ORACLE_HOME/network/admin directory.

Regards,
 
Share this answer
 
v2
hi i installed Oracle 10g express and copied the existing working tns names and listeners files and it works perfectly
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900