作者:myfey | 来源:互联网 | 2014-07-09 16:02
oracle10g客户端连接oracle9i数据库oracle10g客户端连接oracle9i数据库,NetManager配置概要文件:命名方法选择:TNSNAMES服务命名:创建-下一步到第4页,选择(oracle8或更低版本)SID,输入数据库名比如...SyntaxHigh
oracle 10g客户端连接oracle 9i
数据库
oracle10g客户端连接oracle9i数据库,Net Manager配置
概要文件:命名方法选择:TNSNAMES
服务命名:创建-下一步到第4页,选择(oracle8或更低版本)SID,输入数据库名比如ecoradb
(说了是oracle9i数据库,为什么要选择这个呢,说不通啊,可事实上就是选择这个,如果不选择这个,pl/sql 连接数据库的时候会报 ORA-12154: TNS: 无法解析指定的连接标识符 的错误)
www.2cto.com
原来tnsnames.ora 的格式如下
12.2.26.123 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 12.2.26.123)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME= ecoradb)
)
)
最后tnsnames.ora 的格式如下:
12.2.26.123 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 12.2.26.123)(PORT = 1521))
)
(CONNECT_DATA =
(SID = ecoradb)
)
)
区别仅仅在于service_name 改成了sid
www.2cto.com
完整配置参考如下:
Sql代码
# tnsnames.ora Network Configuration File: D:\oracle\product\10.2.0\client_1\NETWORK\ADMIN\tnsnames.ora
# Generated by
Oracle configuration tools.
12.2.26.123 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 12.2.26.123)(PORT = 1521))
)
(CONNECT_DATA =
(SID = ecoradb)
)
)
www.2cto.com
ECORADB =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 12.2.26.123)(PORT = 1521))
)
(CONNECT_DATA =
(SID = ecoradb)
)
)