Installation
See the Instant Client Home Page for more information.
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
6. Start your application.
Installation of RPMs:
1. Download the desired Instant Client RPM packages. All installations require the Basic or Basic Lite RPM.
2. As the root user, install the packages with "rpm". For example:
rpm -ivh oracle-instantclient12.1-basic-12.1.0.2.0-1.i386.rpm
3. Set the environment variable LD_LIBRARY_PATH to the appropriate directory for the Instant Client version, for example:
export LD_LIBRARY_PATH=/usr/lib/oracle/12.1/client/lib:$LD_LIBRARY_PATH
Alternatively, add this path to an ldconfig configuration file if there is no other Oracle software that will be impacted.
4. To use supplied binaries such as SQL*Plus, update your PATH environment variable, for example:
export PATH=/usr/lib/oracle/12.1/client/bin:$PATH
5. Start your application.
author:skate
time:2012/08/08
centos安装instantclient(oracle精简客户端)步骤
环境
os版本:centos5.5
kernel: 2.6.18-194.el5
下载软件包:
oracle-instantclient-basic-10.2.0.5-1.x86_64.rpm
oracle-instantclient-devel-10.2.0.5-1.x86_64.rpm
oracle-instantclient-sqlplus-10.2.0.5-1.x86_64.rpm
下载地址:
http://www.oracle.com/technetwork/database/features/instant-client/index-097480.html
指定rpm包的安装路径
1. 查看rpm包的默认安装路径
[root@localhost tmp]# rpm -qpl oracle-instantclient-sqlplus-10.2.0.5-1.x86_64.rpm
/usr/bin/sqlplus64
/usr/lib/oracle/10.2.0.5/client64/bin/sqlplus
/usr/lib/oracle/10.2.0.5/client64/lib/glogin.sql
3个包都需要检测,为了以后便于维护,可以把instantclient都装在目录"/oracle"
[root@localhost tmp]# rpm -ivh --relocate /usr=/oracle oracle-instantclient-basic-10.2.0.5-1.x86_64.rpm
[root@localhost tmp]# rpm -ivh --relocate /usr=/oracle oracle-instantclient-devel-10.2.0.5-1.x86_64.rpm
[root@localhost tmp]# rpm -ivh --relocate /usr=/oracle oracle-instantclient-sqlplus-10.2.0.5-1.x86_64.rpm
2.sqlnet.ora和tnsnames.ora创建
这两个文件默认是不存在,所以要手工创建
[root@localhost tmp]# mkdir -p /oracle/lib/oracle/10.2.0.5/client64/network/admin
然后在admin目录下创建这两个文件
3.配置环境变量
session级别设置
export LD_LIBRARY_PATH=/oracle/lib/oracle/10.2.0.5/client64/lib
export TNS_ADMIN=/oracle/lib/oracle/10.2.0.5/client64/network/admin
export ORACLE_HOME=/oracle/lib/oracle/10.2.0.5/client64
把如下内容放在环境变量文件中
[root@localhost ~]# vi /root/.bash_profile
.....
TNS_ADMIN=/oracle/lib/oracle/10.2.0.5/client64/network/admin
LD_LIBRARY_PATH=/oracle/lib/oracle/10.2.0.5/client64/lib
PATH=$PATH:$HOME/bin:/oracle/lib/oracle/10.2.0.5/client64/bin
......
4.测试
[root@localhost ~]# sqlplus "/@tns"
SQL*Plus: Release 10.2.0.5.0 - Production on Thu Aug 9 03:03:26 2012
Copyright (c) 1982, 2010, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL>
------end----
1、用root账号创建Oracle用户
# /usr/sbin/groupadd oinstall
# /usr/sbin/groupadd dba
# /usr/sbin/useradd -m -g oinstall -G dba oracle
# id oracle ( 检查用户名)
# passwd oracle (设置Oracle用户的密码)
2、切换到Oracle账号
.su - oracle
编辑 ~/.bash_profile文件。
umask 022
ORACLE_BASE=/usr/lib/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/12.1/client; export ORACLE_HOME
PATH=$ORACLE_HOME/bin:$PATH; export PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib; export LD_LIBRARY_PATH
3、切换到root账号
su - root
在/usr/lib/oracle/11.2/client目录下创建network/admin目录,在此目录下添加tnsnames.ora文件。