萬盛學電腦網

 萬盛學電腦網 >> 服務器教程 >> linux安裝oracle客戶端

linux安裝oracle客戶端

  1、准備好所需要的安裝包

  oracle-instantclient-basic-10.2.0.5-1.i386.rpm

  oracle-instantclient-devel-10.2.0.5-1.i386.rpm

  oracle-instantclient-jdbc-10.2.0.5-1.i386.rpm

  oracle-instantclient-sqlplus-10.2.0.5-1.i386.rpm

  先安裝oracle-instantclient-basic-10.2.0.5-1.i386.rpm,其他依次安裝

  2、創建用戶、組和目錄

  [root@wxcs-2 oracle]# groupadd oinstall

  [root@wxcs-2 oracle]# groupadd dba

  [root@wxcs-2 oracle]# useradd -g oinstall -G dba oracle

  [root@wxcs-2 oracle]# passwd oracle

  Changing password for user oracle.

  New UNIX password:

  BAD PASSWORD: it is based on a dictionary word

  Retype new UNIX password:

  passwd: all authentication tokens updated successfully.

  [root@wxcs-2 oracle]# mkdir -p /home/oracle/network/admin

  [root@wxcs-2 oracle]# chown -R oracle:oinstall /home/oracle

  [root@wxcs-2 oracle]# chmod -R 755 /home/oracle

  3、將oracle服務器上面的tnsnames.ora拷貝出來,放到/home/oracle/network/admin目錄下面。

  4、修改環境變量

  [oracle@wxcs-2 ~]$ vi .bash_profile

  export ORACLE_HOME=/home/oracle

  export SQLPATH=/home/oracle/network/admin

  export TNS_ADMIN=/home/oracle/network/admin

  export NLS_LANG="SIMPLIFIED CHINESE_CHINA.ZHS16GBK"

  export LD_LIBRARY_PATH=/usr/lib/oracle/10.2.0.5/client/lib/:/usr/lib/oracle/10.2.0.5/client/lib:$LD_LIBRARY_PA

  TH

  export PATH=$PATH:$ORACLE_HOME:$LD_LIBRARY_PATH

  [oracle@wxcs-2 ~]$ source .bash_profile 環境變量立即生效

  5、可以正常連接oracle服務器了

copyright © 萬盛學電腦網 all rights reserved