1. 程式人生 > >centos安裝instantclient(oracle精簡客戶端)步驟

centos安裝instantclient(oracle精簡客戶端)步驟

分享一下我老師大神的人工智慧教程!零基礎,通俗易懂!http://blog.csdn.net/jiangjunshow

也歡迎大家轉載本篇文章。分享知識,造福人民,實現我們中華民族偉大復興!

               

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包的預設安裝路徑
[[email protected] 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"

[[email protected] tmp]# rpm -ivh --relocate /usr=/oracle oracle-instantclient-basic-10.2.0.5-1.x86_64.rpm
[[email protected] tmp]# rpm -ivh --relocate /usr=/oracle oracle-instantclient-devel-10.2.0.5-1.x86_64.rpm
[[email protected] tmp]# rpm -ivh --relocate /usr=/oracle oracle-instantclient-sqlplus-10.2.0.5-1.x86_64.rpm

2.sqlnet.ora和tnsnames.ora建立
這兩個檔案預設是不存在,所以要手工建立
[[email protected] 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

把如下內容放在環境變數檔案中
[[email protected] ~]# 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.測試

[[email protected] ~]# 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----

 

 

           

給我老師的人工智慧教程打call!http://blog.csdn.net/jiangjunshow

這裡寫圖片描述