ODAC的tnsnames.ora文件

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ODAC的tnsnames.ora文件相关的知识,希望对你有一定的参考价值。

WIN7安装完ODAC之后,会在目录“C:\app\client\xushunyi\product\12.1.0\client_1\Network\Admin”下生成一个tnsnames.ora文件,里面用于配置Oracle数据库实例信息,一般可以参照Sample目录下的tnsname.ora文件对其进行配置。实例内容如下:

  

# Every line that begins with # is a comment line
#
# Create Oracle net service names, or aliases, for each database server
# you need to connect to.
#
# TNSNames.ora sample entry
#
# alias =
# (DESCRIPTION =
# (ADDRESS = (PROTOCOL = TCP)(HOST = myserver.mycompany.com)(PORT = 1521))
# (CONNECT_DATA =
# (SERVER = DEDICATED)
# (SERVICE_NAME = orcl)
# )
# )
#
# You can modify the entry below for your own database.
# <data source alias> = Name to use in the connection string Data Source
# <hostname or IP> = name or IP of the database server machine
# <port> = database server machine port to use
# <database service name> = name of the database service on the server

<data source alias> =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = <hostname or IP>)(PORT = <port>))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = <database service name>)
)
)

以上是关于ODAC的tnsnames.ora文件的主要内容,如果未能解决你的问题,请参考以下文章

ORACLE配置,修改tnsnames.ora文件实例

tnsnames.ora配置小结

通过代码获取文件 tnsnames.ora 的位置

Oracle Database 19c 不可用 tnsnames.ora 文件

Oracle三个配置文件tnsnames-listener-sqlnet介绍

oracle 网络访问配置tnsnames.ora文件的路径