如何配置pl/sql 连接远程oracle服务器

1。首先去oracle的官方下载客户端的压缩包,地址是:http://www.oracle.com/technetwork/database/features/instant-client/index-097480.html,选择机器的操作系统后选择oracle对应的版本的base那个压缩包下载。
注:64位系统PL/SQL配置(需要下载32位的Oracle11gInstantClient,解压到单独目录)
2。将下载后的压缩包解压到相应的目录,比如 D:\worksoftware\instantclient_10_2下;
3。在这个目录下建立NETWORD目录,再在NETWORK目录下建立ADMIN目录,如D:\worksoftware\instantclient_10_2\NETWORK\ADMIN;
4。在第二步所建立的目录下新建一个tnsnames.ora文件,当然也可以从服务器上copy这个文件,文件的内容如下
databasename =   
(DESCRIPTION =   
      (ADDRESS_LIST =   
        (ADDRESS = (PROTOCOL = TCP)(HOST = ip address)(PORT = 1521))   
      )   
      (CONNECT_DATA =   
        (SERVICE_NAME = database name)   
      )  
    ) 
databasename =
    (DESCRIPTION =
      (ADDRESS_LIST =
        (ADDRESS = (PROTOCOL = TCP)(HOST = ip address)(PORT = 1521))
      )
      (CONNECT_DATA =
        (SERVICE_NAME = database name)
      )
    )
 
例如我的就是
  ORCL =  
  (DESCRIPTION =   
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.113)(PORT = 1521))   
    (CONNECT_DATA =   
      (SERVER = DEDICATED)  
      (SERVICE_NAME = orcl)  
    )   
  ) 
ORCL =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.113)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = orcl)
    )
  )
5。打开PL SQL DEVELOPER 工具,点击tools-》preferences在右侧的oracle home里填上客户端的home,如D:\worksoftware\instantclient_10_2;在OCI Library里填上oci.dll路径,如D:\worksoftware\instantclient_10_2\oci.dll;
 
  
6。
 
  

NLS_lANG=SIMPLIFIED CHINESE_CHINA.ZHS16GBK 这个东西主要是解决中文问题的。

TNS_ADMIN=F:\MyJob\Oracle11gInstantClient\ADMIN

7。ok配置完毕,应该是可以的啦,最好在启动之前先ping下远程的服务器,通了就应该可以连接上了 我的配置,其中BOC_TEST_91等为连接字符串 BOC_TEST_91 = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 10.1.29.91)(PORT = 1521)) (CONNECT_DATA = (SERVICE_NAME = bot) ) ) BOC_TEST_68 = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 10.1.19.68)(PORT = 1521)) (CONNECT_DATA = (SERVICE_NAME = bot) ) ) BOC_PRO_56 = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 10.1.11.56)(PORT = 1521)) (CONNECT_DATA = (SERVICE_NAME = bop) ) )

你可能感兴趣的:(DataBase)