安装完ODTwithODAC112012,出现ORA-12560:TNS:协议适配器错误

参考:http://blog.csdn.net/tan_yixiu/article/details/6762357

操作系统:windows2008 Enterprise 64位

开发工具:VS2010

数据库:oracle11g

安装ODAC :ODTwithODAC112012后,出现ORA-12560:TNS:协议适配器错误

ODTwithODAC112012的下载地址:http://www.oracle.com/technetwork/topics/dotnet/utilsoft-086879.html

 

进入系统环境变量设置,查看Path路径,发现在安装ODAC时,同时安装了oracle客户端,

安装完成后发现在Path路径的最前面多了两个安装ODAC时产生的路径

F:\app\Administrator\product\11.2.0\client_1;

F:\app\Administrator\product\11.2.0\client_1\bin;

此时path路径为:F:\app\Administrator\product\11.2.0\client_1;F:\app\Administrator\product\11.2.0\client_1\bin;E:\app\Administrator\product\11.2.0\dbhome_1\bin;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;

这两个路径放到了oracle11g数据库路径前面,导致出现ORA-12560:TNS:协议适配器错误

将新加入的路径F:\app\Administrator\product\11.2.0\client_1;F:\app\Administrator\product\11.2.0\client_1\bin;置后(oracle数据库路径的后面)即可解决ORA-12560:TNS:协议适配器错误。

例如:将path修改为:E:\app\Administrator\product\11.2.0\dbhome_1\bin;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;F:\app\Administrator\product\11.2.0\client_1;F:\app\Administrator\product\11.2.0\client_1\bin;

解决ORA-12560:TNS:协议适配器错误。

 

接下来配置oracle客户端,否则VS2010无法连接到oracle数据

先找到 Oracle 数据库的安装目录,然后在其中找到如下目录

例如:我的安装在 E盘

E:\app\Administrator\product\11.2.0\dbhome_1\NETWORK\ADMIN

在其中找到下面标记的两个文件:tnsnames.ora 和sqlnet.ora

然后将这两个文件拷贝到 Oracle Developer Tools for Visual Studio .NET 的安装目录下的以下目录,

例如:我的安装在F盘

F:\app\Administrator\product\11.2.0\client_1\Network\Admin

然后便可以重启机器了,就可以了(注意我这个oracle数据库和Oracle Developer Tools for Visual Studio .NET 安装在同一台服务器上了)。

 

转载于:https://www.cnblogs.com/wolfplan/p/3877263.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值