oracle10g客户端连接oracle9i数据库

oracle10g客户端连接oracle9i数据库,Net Manager配置

 

概要文件:命名方法选择:TNSNAMES

服务命名:创建-下一步到第4页,选择(oracle8或更低版本)SID,输入数据库名比如ecoradb

                (说了是oracle9i数据库,为什么要选择这个呢,说不通啊,可事实上就是选择这个,如果不选择这个,pl/sql 连接数据库的时候会报 ORA-12154: TNS: 无法解析指定的连接标识符 的错误

 

原来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

 

完整配置参考如下:

# 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)
    )
  )

ECORADB =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 12.2.26.123)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SID = ecoradb)
    )
  )

 

 

你可能感兴趣的:(oracle10g客户端连接oracle9i数据库)