windows 由于初始化提供程序时出错,测试连接失败

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4457160/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 15:48:44  来源:igfitidea点击:

Test connection failed because of an error in initializing provider

windowsoracleora-12545

提问by oliverwood

I get this error when trying to connect to a database server remotely using udl file:

尝试使用 udl 文件远程连接到数据库服务器时出现此错误:

Test connection failed because of an error in initializing provider. ORA-12545: Connect failed because target host or object does not exist

由于初始化提供程序时出错,测试连接失败。ORA-12545: 连接失败,因为目标主机或对象不存在

I believe it is not a connectivity problem, because I can do these checklists successfully:

我相信这不是连接问题,因为我可以成功完成这些清单:

  • ping IP address
    • ping DNS name
    • tnsping service name
    • connect to the database using sqlplus, do select and other commands to the table
    • reconfigure service using Oracle Net Configuration Assistant
  • ping IP地址
    • ping DNS 名称
    • tnsping 服务名称
    • 使用sqlplus连接数据库,对表做select等命令
    • 使用 Oracle Net Configuration Assistant 重新配置服务

I also tried changing the host name in tnsnames.ora into its IP address, or put IP address and its alias name in etc\hosts, but it is still not working. I guess it is the problem in udl file. I use the same exact udl file with the one's in another PC that's working fine.

我还尝试将 tnsnames.ora 中的主机名更改为其 IP 地址,或者将 IP 地址及其别名放在 etc\hosts 中,但仍然无法正常工作。我想这是udl文件中的问题。我使用与另一台工作正常的 PC 中的完全相同的 udl 文件。

Do you have any idea?

你有什么主意吗?

回答by YudhiWidyatama

First guess, wrong IP or wrong oracle home is being used (and thus different tnsnames.ora). The other guess, I assume the UDL file is being used in a Windows-based PC : the error might be because the COM objects that being used as provider is not installed correctly. Maybe there is a problem with MDAC (Microsoft Data Access Components), you might also need to reinstall Oracle Client with Windows Interfaces enabled in custom options.

首先猜测,使用了错误的 IP 或错误的 oracle home(因此使用了不同的 tnsnames.ora)。另一种猜测是,我假设 UDL 文件正在基于 Windows 的 PC 中使用:错误可能是因为用作提供程序的 COM 对象未正确安装。可能 MDAC(Microsoft 数据访问组件)存在问题,您可能还需要重新安装 Oracle 客户端,并在自定义选项中启用 Windows 接口。