开发者

Getting an Error when trying to connect Visual Studio application to Oracle

开发者 https://www.devze.com 2023-04-08 21:38 出处:网络
I am new to Oracle.I amy trying to connect my Visual Studio 2010 VB application with an Oracle Server on a remote server.

I am new to Oracle.I amy trying to connect my Visual Studio 2010 VB application with an Oracle Server on a remote server.

I configured my tnsnames.ora by proving the host name and service name. When I tried to test the connection using the Add Connection functionality in Serv开发者_JAVA百科er Exploreer I got the following error:

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

Does this mean the values I entered into tnsnames.ora are wrong. Or do I need to configure anyother documents- listener.ora for example? I have not made any other changes except what I have mentioned above. Please let me know how to resolve this issue as it is time sensitive.

Thanks


Take Visual Studio out of the picture first. You need to confirm your Oracle client is configured properly on your machine.

If you installed the Oracle connection tools, you should have tnsping installed. From the command line, enter

tnsping <server_name>

This will try to find the Oracle server using the configuration specified in your tnsnames file (if your sqlnet file is configured to have Oracle use the tnsnames protocol). If it finds it, it will tell you what method it used. You can then use this information for your Visual Studio connection.

Make sure your sqlnet file is correct. You use this file to tell Oracle the order of protocols to use to resolve servers (e.g. tnsnames, ldap, etc.). Mine looks as follows:

SQLNET.AUTHENTICATION_SERVICES = (NTS)
NAMES.DIRECTORY_PATH = (LDAP,TNSNAMES)
NAMES.DEFAULT_DOMAIN = <domain_name>


This usually means one of two things.

  1. You don't have ODP.Net installed or it is missing some dll's (unlikely)
  2. You have more than one version of the oracle client on the machine and .net can't find the correct one.

Go to the system path for the machine and make sure that the FIRST oracle path in the path statement is pointing to the correct oracle client installation.

To remove oracle

  1. Stop DTC service and oracle mts service if running
  2. Delete All oracle directories (C:\Program Files, C:\Oracle, C:\App, etc)
  3. Remove Oracle from the path statement (all entries)
  4. Remove any environment variables
  5. Remove Oracle entries in the Local Machine registry and Current User section (if exists)
  6. Reboot the machine
  7. Reinstall the correct version
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号