使用 Widows 创建 Oracle ODBC DSN。输入端口号

发布于 2024-10-09 09:11:09 字数 581 浏览 1 评论 0原文

我的 c:\Oracle\product\11.1.0\network\ADMIN\TNSNAMES.ORA 文件中有以下条目。

在此处输入代码pvtest.world =

(DESCRIPTION =

(ADDRESS_LIST =

  (ADDRESS = (PROTOCOL = TCP)(HOST = xxxx.xxx.xxx)(PORT = 1521))

)

(CONNECT_DATA =

  (SID = pvtest)

  (SERVER = DEDICATED)

)

)

我可以使用 TOAD 成功连接。现在,当我尝试创建新的 ODBC DSN 时,它不允许我这样做。如何在 TNS 服务名称中指定端口号?

在此处输入代码出现以下错误: ------------------------------

测试连接

无法连接 SQL状态=S1000 [Oracle][ODBC][Ora]ORA-12514: TNS: 侦听器当前不知道连接描述符中请求的服务


正常

I have the following entry in my c:\Oracle\product\11.1.0\network\ADMIN\TNSNAMES.ORA file.

enter code herepvtest.world =

(DESCRIPTION =

(ADDRESS_LIST =

  (ADDRESS = (PROTOCOL = TCP)(HOST = xxxx.xxx.xxx)(PORT = 1521))

)

(CONNECT_DATA =

  (SID = pvtest)

  (SERVER = DEDICATED)

)

)

I could connect successfully using TOAD. Now when I try creating a new ODBC DSN it doesn't allow me to do so. How do I specify the port number in TNS Service Name?

enter code hereGet the following error : ---------------------------

Testing Connection

Unable to connect
SQLState=S1000
[Oracle][ODBC][Ora]ORA-12514: TNS:listener does not currently know of service requested in connect descriptor


OK

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

眉黛浅 2024-10-16 09:11:09

当你说可以用TOAD连接时,现在ODBC连接失败了,你还能这样做吗?如果您可以连接客户端 PC 上的任何工具,那么显然另一端的侦听器知道该服务,因此您必须怀疑您的一端。可能一个客户端工具正在尝试在与另一个客户端工具不同的位置访问 PVTEST。

如果一个客户端工具可以连接而另一个客户端工具不能连接,我首先要确认两个客户端都使用相同的 tnsnames.ora 文件。搜索您的客户端并查看是否还有其他 tnsnames.ora 文件,这将暗示其他 ORACLE_HOMES(如果您不知道它是什么,请 Google 一下)。

从命令行执行 TNSPING 并查看它是否到达主机。它还将告诉您连接的详细信息。

在 TOAD 中检查连接详细信息并确保它正在使用 tnsnames 连接,如果是,则检查哪个 tnsnames。

检查您的客户端是否设置了环境变量 TNS_ADMIN。

When you say you could connect with TOAD, can you do so now that the ODBC connection fails? if you can connect with any tool on your client PC than obviously the listener at the other end knows of the service so you have to suspect your end. Probably one client tool is trying to reach PVTEST at a diffrerent location than the other.

If one client tool can connect and the other cannot, first of I would confirm that both clients are using the same tnsnames.ora file. Search your client and see if there are other tnsnames.ora files which would imply other ORACLE_HOMES (Google that if you don't know what it is).

From a command line do a TNSPING and see if it reaches the host. It will also tell about the connection details.

In TOAD check the connection details and ensure it is using a tnsnames connection and if so which tnsnames.

Check if your client has the environment variable TNS_ADMIN set.

凹づ凸ル 2024-10-16 09:11:09

我对 Oracle XE 有这种块:

XE =
(描述=
(地址=(协议= TCP)(主机= test.acme.org)(端口= 1521))
(连接数据=
(服务器=专用)
(服务名称=XE)

如果将其与您的定义进行比较,则不会发现存在“SERVICE_NAME”参数。

I have this kind of block with Oracle XE:

XE =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = test.acme.org)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = XE)
)
)

If you compare that with yours definition, not that there is "SERVICE_NAME" parameter.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文