在Win环境下的Oracle中,D:\Oracle\product\10.1.0\db_1\NETWORK\ADMIN\tnsnames.ora文件很重要,它作用是:本地命名的配置.
本地名可以用简单的名称访问到所需的数据库或服务器所需的信息,而这些信息保存到了tnsnames.ora中.
LocalName =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.2)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = my_service)
)
)
LOCALNAME: 本地名称
ADDRESS: 服务器地址
PROTOCOL: 使用协议
HOST: oracle服务器主机名或IP地址
PORT: 监听端口
SERVICE_NAME: oracle实例名(数据库名)或 SID=实例名
示例:
TEST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 172.152.2.20)(PORT = 1521))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = ncdb)
)
)
原文:http://www.cnblogs.com/amyzh/p/4927305.html