1.首先到官网下载文件:http://www.oracle.com/technetwork/database/features/instant-client/index-097480.html?ssSourceSiteId=ocomen
需要用到的文件(64位系统):(32位系统对应下载32位客户端)
解压缩文件到同一目录
2.配置sqlplus
root用户登录,创建目录:
# mkdir -p /opt/oracle
将所有软件包解压缩至/opt/oracle/下,所有文件将自动释放至目录/opt/oracle/instantclient_10_2/下
创建文件/opt/oracle/instantclient_10_2/tnsnames.ora
格式如下:
ORA16 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.21.16)(PORT = 1521))
)
(CONNECT_DATA =
(SID = orcl)
(SERVER = DEDICATED)
)
)
在需要使用oracle功能的测试用户环境变量中,添加如下配置:
export ORACLE_HOME=/opt/oracle
export LANG="zh_CN.GBK"
export NLS_LANG="SIMPLIFIED CHINESE_CHINA.ZHS16GBK"
ORACLE_IC_HOME=/opt/oracle/instantclient_10_2
ORACLE_HOME=$ORACLE_IC_HOME
TNS_ADMIN=$ORACLE_IC_HOME
PATH=$PATH:$ORACLE_IC_HOME
LD_LIBRARY_PATH=$ORACLE_IC_HOME
export ORACLE_IC_HOME ORACLE_HOME TNS_ADMIN PATH LD_LIBRARY_PATH
生效后,测试sqlplus:
$ sqlplus scott/tiger@ora215
SQL*Plus: Release 10.2.0.4.0 - Production on 星期五 8月 3 10:41:44 2012
Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
连接到:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options
SQL>
Ok, sqlplus工具可以使用了;
---------------------------------------------------------------------------------------------------------------------------------
PL/SQL配置(32位和64位一样配置)
打开Pl/SQL,首选项-Oracle-连接-OCI库-里面输入oracle_instance客户端oci.dll详细路径