首页 > 代码库 > pl_sql develope连接远程数据库的方法

pl_sql develope连接远程数据库的方法

需要修改你所安装的数据的路径下 tnsnames.ora 文件(我安装路径是F:\app\Aside\product\11.2.0\dbhome_1\NETWORK\ADMIN)

tnsnames.ora中的内容如下所示:

# tnsnames.ora Network Configuration File: F:\app\Aside\product\11.2.0\dbhome_1\network\admin\tnsnames.ora
# Generated by Oracle configuration tools.

LISTENER_ORCL =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))


ORACLR_CONNECTION_DATA =http://www.mamicode.com/
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
(CONNECT_DATA =http://www.mamicode.com/
(SID = CLRExtProc)
(PRESENTATION = RO)
)
)

ORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
(CONNECT_DATA =http://www.mamicode.com/
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)

你需要复制一份orcl的内容 orcl是你的实例名称你可以随便取,localHost改为你要连接的IP地址,1521 改为你要连接的数据库的端口号,SEVRVICE_NAME=orcl 中的orcl改为你要连接的远程数据的实例的名称。 例如

aside =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.120.110.119)(PORT = 1521))
(CONNECT_DATA =http://www.mamicode.com/
(SERVER = DEDICATED)
(SERVICE_NAME = HolloOracle)
)
)

然后在pl_sql develope中选择你要连接的数据库的实例名输入用户名和密码就好了。

 

pl_sql develope连接远程数据库的方法