Oracle Instant Client11.2.0.3.0安装配置过程

操作系统环境:CentOS release 6.4 (Final)
下载基本包:
下载以下三个压缩包:
instantclient-basic-linux.x64-11.2.0.3.0.zip
instantclient-sdk-linux.x64-11.2.0.3.0.zip
instantclient-sqlplus-linux.x64-11.2.0.3.0.zip

参考官网的安装简介:

Installation of ZIP files: 

1. Download the desired Instant Client ZIP files. All installations require the Basic or Basic Lite package. 

2. Unzip the packages into a single directory such as "/opt/oracle/instantclient_12_1" that is accessible to your application.

3. Create the appropriate libclntsh.so and libocci.so links for the version of Instant Client. For example:

cd /opt/oracle/instantclient_12_1
ln -s libclntsh.so.12.1 libclntsh.so
ln -s libocci.so.12.1 libocci.so

4. Set the environment variable LD_LIBRARY_PATH to the directory created in Step 2, for example:

export LD_LIBRARY_PATH=/opt/oracle/instantclient_12_1:$LD_LIBRARY_PATH

Alternatively, add this path to an ldconfig configuration file if there is no other Oracle software that will be impacted.

5. To use supplied binaries such as SQL*Plus, update your PATH environment variable, for example:

export PATH=/opt/oracle/instantclient_12_1:$PATH
 
本地操作记录为:
解压至一目录,设为/opt/oracle/instantclient_11_2
ln -s libocci.so.11.1 libocci.so
ln -s libclntsh.so.11.1 libclntsh.so
设置环境变量:vi /etc/profile
export ORACLE_HOME=/opt/oracle/instantclient_11_2
export LD_LIBRARY_PATH=/opt/oracle/instantclient_11_2:$LD_LIBRARY_PATH
export PATH=/opt/oracle/instantclient_11_2:$PATH
export SQLPATH=/opt/oracle/instantclient_11_2
export TNS_ADMIN=/opt/oracle/instantclient_11_2
保存退出,运行 source /etc/profile
编辑tnsnames.ora
cd /opt/oracle/instantclient_11_2
vi tnsnames.ora
# tnsnames.ora Network Configuration File: 
# Generated by Oracle configuration tools.
test =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.11)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SID = test)
    )
  )
根据实际需要手动修改HOST(192.168.1.11),SID(实例名),以及服务名值(这里是test)。
测试连接:
[root@hadoop001 instantclient_11_2]# sqlplus test/test123@test
SQL*Plus: Release 11.2.0.3.0 Production on Tue Mar 24 00:20:02 2015
Copyright (c) 1982, 2011, Oracle.  All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL>

 

posted @ 2015-03-24 15:32  /HOME/北北  阅读(2288)  评论(0编辑  收藏  举报