PL/SQL连接远程数据库

在oracle安装目录下 D:\softset\OracleXE\app\oracle\product\10.2.0\server\NETWORK\ADMIN

找到tnsnames.ora文件  用编辑器打开

 

如下在里面加入Oracle服务器信息
DB =
 (DESCRIPTION =
   (ADDRESS_LIST =
     (ADDRESS = (PROTOCOL = TCP)(HOST = 服务器地址)(PORT = 端口通常是1521))
   )
   (CONNECT_DATA =
     (SERVICE_NAME = 服务名称)
   )
 )

如:

 

ORCL_23 =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.23)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = orcl)
    )
  )

你可能感兴趣的:(oracle,pl/sql)