一、配置oracle服务器的监听器listener
修改<安装目录>/network/admin/目录下的listener.ora和tnsnames.ora两个文件。其中
listener文件大致如下:
# listener.ora Network Configuration File: /oracle/app/product/10.1.0/db_1/network/admin/listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = /oracle/app/product/10.1.0/db_1)
(PROGRAM = extproc)
)
(SID_DESC =
(GLOBAL_DBNAME = demo1) #demo1为oracle实例名
(ORACLE_HOME = /oracle/app/product/10.1.0/db_1)
(SID_NAME = demo1)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.100)(PORT = 1521)) #IP地址为oracle服务器
)
)
tnsnames.ora文件大致修改如下:
# tnsnames.ora Network Configuration File: /oracle/app/product/10.1.0/db_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.
DEMO1 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.100)(PORT = 1521)) #IP地址为oracle服务器
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = DEMO1) #demo1为oracle实例名,或者服务名称此名称可通过netmgr或netca修改
)
)
EXTPROC_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
)
(CONNECT_DATA =
(SID = PLSExtProc)
(PRESENTATION = RO)
)
)
以上修改也可通过图形界面的netmgr和netca进行配置。修改之后,重启监听器
二、下载安装oracle客户端。
在安装pl/sql developer的本地机器上必须安装oracle客户端(此处指针对oracle 10g版本,有说也可只安装相关驱动如oci驱动,
具体不详。并且客户端不一定为10g版本,8i,9i皆可)。
1.从官网上下载绿色版本的客户端,地址如下(或有改变):
http://www.oracle.com/technology/software/tech/oci/instantclient/index.html
下载需要oracle用户,可免费注册
2.绿色版无需安装,将此下载解压至某处,并在其下建立一network目录,目录下再建admin目录,结构如下
<客户端目录>/network/admin,在admin目录中建立tnsnames.ora文件,内容大致如下:
demo1 = #oracle服务名
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.100)(PORT = 1521)) #oracle服务器地址与端口
)
(CONNECT_DATA =
(SERVICE_NAME = demo1)
)
)
三、在PL/SQL developer中配置客户端信息。
打开PL/SQL developer,暂不登录,选择菜单tools->preferences->connection,设置如下两项:
Oracle Home: D:\Program Files\instantclient_11_1 #客户端解压目录
OCI library: D:\Program Files\instantclient_11_1\oci.dll #oci库文件路径,oci.dll应该在客户端目录下。
保存,重启PL/SQL developer,些时应可看到登录框中Database下拉选项里有你刚刚配置的远程服务器上的服务实例demo1了