您好,登錄后才能下訂單哦!
一、下載
oracle linux_x86-64客戶端下載地址:http://www.oracle.com/technetwork/topics/linuxx86-64soft-092277.html
根據需要下載客戶端的組件,通常我們在客戶端上只需要用到sqlplus連接和查詢命令,所以只需要下載basic和sqlplus兩個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
四、創建配置文件tnsname.ora和libs
前面已經在ORACLE_HOME目錄下創建好目錄network/admin,把數據庫服務器上的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>
測試成功!
注:
如果出現以下錯誤:
sqlplus: error while loading shared libraries: libsqlplus.so: cannot open shared object file: No such file or directory
說明環境變量沒有生效!
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。