您好,登錄后才能下訂單哦!
一、下載
oracle linux_x86-64客戶端下載地址:http://www.oracle.com/technetwork/topics/linuxx86-64soft-092277.html
根據(jù)需要下載客戶端的組件,通常我們?cè)诳蛻舳松现恍枰玫絪qlplus連接和查詢命令,所以只需要下載basic和sqlplus兩個(gè)rpm包即可,這里安裝的是11.2.0.3版本在redhat linux7下
二、以root用戶安裝
rpm -ivh oracle-instantclient11.2-basic-11.2.0.3.0-1.x86_64.rpm
rpm -ivh oracle-instantclient11.2-sqlplus-11.2.0.3.0-1.x86_64.rpm
添加oracle用戶和目錄
[chenyj@backup-server home]$ su -
Password:
[root@app-server ~]#
[root@app-server ~]# groupadd oinstall
[root@app-server ~]# groupadd dba
[root@app-server ~]# useradd -g oinstall -G dba oracle
[root@app-server ~]# passwd oracle
Changing password for user oracle.
New password:
BAD PASSWORD: it is based on a dictionary word
BAD PASSWORD: is too simple
Retype new password:
passwd: all authentication tokens updated successfully.
[root@app-server ~]# mkdir -p /usr/lib/oracle/11.2/client64/network/admin
[root@app-server ~]# chown -R oracle:oinstall /usr/lib/oracle/
[root@app-server ~]# chmod -R 755 /usr/lib/oracle/
三、配置
[root@app-server ~]# su - oracle
[oracle@app-server ~]$ vi .bash_profile
umask 022
ORACLE_BASE=/usr/lib/oracle
export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/11.2/client64
export ORACLE_HOME
PATH=$ORACLE_HOME/bin:/usr/lib/oracle:$PATH
export PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib
export LD_LIBRARY_PATH
SQLPATH=/usr/lib/oracle
TNS_ADMIN=/usr/lib/oracle/11.2/client64/network/admin
NLS_LANG="SimplifiedChinese_China.ZHS16GBK"
export SQLPATH TNS_ADMIN NLS_LANG
四、創(chuàng)建配置文件tnsname.ora和libs
前面已經(jīng)在ORACLE_HOME目錄下創(chuàng)建好目錄network/admin,把數(shù)據(jù)庫服務(wù)器上的tnsnames.ora拷貝過來即可
[oracle@app-server admin]$ su
密碼:
[root@app-server admin]# vi /etc/ld.so.conf
include ld.so.conf.d/*.conf
/usr/lib/oracle/11.2/client64/lib/ //添加此行
[root@app-server admin]# ldconfig
五、測試
[oracle@app-server admin]$ sqlplus test/123456@MYDATA
SQL*Plus: Release 10.2.0.1.0 - Production on 星期三 1月 4 10:18:48 2017
Copyright (c) 1982, 2005, Oracle. All rights reserved.
連接到:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Data Mining
and Real Application Testing options
SQL>
測試成功!
注:
如果出現(xiàn)以下錯(cuò)誤:
sqlplus: error while loading shared libraries: libsqlplus.so: cannot open shared object file: No such file or directory
說明環(huán)境變量沒有生效!
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請(qǐng)聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。