Oracle - 我使用什么 TNS 名称文件?

标签 oracle connection tnsnames tns

有时我会遇到 Oracle 连接问题,因为我无法确定数据库客户端正在使用哪个 tnsnames.ora 文件。

解决这个问题的最佳方法是什么?++对各种平台解决方案感到满意。

最佳答案

Oracle 提供了一个名为 tnsping 的实用程序:

R:\>tnsping someconnection

TNS Ping Utility for 32-bit Windows: Version 9.0.1.3.1 - Production on 27-AUG-20
08 10:38:07

Copyright (c) 1997 Oracle Corporation.  All rights reserved.

Used parameter files:
C:\Oracle92\network\ADMIN\sqlnet.ora
C:\Oracle92\network\ADMIN\tnsnames.ora

TNS-03505: Failed to resolve name

R:\>


R:\>tnsping entpr01

TNS Ping Utility for 32-bit Windows: Version 9.0.1.3.1 - Production on 27-AUG-20
08 10:39:22

Copyright (c) 1997 Oracle Corporation.  All rights reserved.

Used parameter files:
C:\Oracle92\network\ADMIN\sqlnet.ora
C:\Oracle92\network\ADMIN\tnsnames.ora

Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (COMMUNITY = **)
 (PROTOCOL = TCP) (Host = ****) (Port = 1521))) (CONNECT_DATA = (SID = ENTPR0
1)))
OK (40 msec)

R:\>

这应该显示您正在使用的文件。该实用程序位于 Oracle bin 目录中。

关于Oracle - 我使用什么 TNS 名称文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10499/

相关文章:

json - 使用 NSURLSession 下载 JSON 不会返回任何数据

tomcat - tomcat如何知道在哪里可以找到tnsnames.ora

oracle - 如何重现进程: Form - Automatic Row Processing (DML)的代码

oracle - 分层查询 - 沿着特定路径获取所有父级

oracle - 什么情况导致Oracle软件包无效?

MySQL 服务器已在 CakePHP bake 控制台中消失

database - 关于数据库通信安全

sql - Oracle OCI 错误 : Segmentation fault (core dumped) when fetching 100000 rows

excel - Oracle ODBC TNS-less 连接字符串(适用于 64 位 Excel)

oracle - 什么是 TNS :listener in the Context of Oracle?