понедельник, 5 ноября 2012 г.

Install instant Oracle client on Centos 64

Downloads from http://www.oracle.com/technetwork/topics/linuxx86-64soft-092277.html
oracle-instantclient11.2-basic-11.2.0.3.0-1.x86_64.rpm
oracle-instantclient11.2-sqlplus-11.2.0.3.0-1.x86_64.rpm
and setup this.
Create /etc/profile.d/oracle.sh with:
export ORACLE_HOME="/usr/lib/oracle/11.2/client64"
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export TNS_ADMIN=$ORACLE_HOME
export PATH=$PATH:$ORACLE_HOME/bin
create "tnsnames.ora" file in $TNS_ADMIN folder, with:
ORCL =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.5)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = orcl)
    )
  )
Setup rlwrap:
sudo yum install rlwrap
and add this line to ~/.bashrc
alias sqlplus="rlwrap sqlplus"
Test:
sqlplus user_name@orcl
If you get error:
sqlplus: error while loading shared libraries: libsqlplus.so: cannot
open shared object file: No such file or directory
then check $ORACLE_PATH and $LD_LIBRARY_PATH and grants:
chmod -R 755 $ORACLE_HOME
If you get this error:
sqlplus: error while loading shared libraries: libsqlplus.so: cannot
open shared object file: No such file or directory
then add local machine to /etc/hosts :
127.0.0.1   localhost [machine_name]

Комментариев нет:

Отправить комментарий