# Installing Oracle Instant Client 11.2.0.4 on RHEL 7.4

  1. Download instant client RPMs on Instant Client Download Page.

    ~]# ll /soft
    total 59872
    -r-xr-x---. 1 root root 59865008 Oct 15 17:40 oracle-instantclient11.2-basic-11.2.0.4.0-1.x86_64.rpm
    -r-xr-x---. 1 root root   610222 Oct 15 17:40 oracle-instantclient11.2-devel-11.2.0.4.0-1.x86_64.rpm
    -r-xr-x---. 1 root root   828333 Oct 15 17:40 oracle-instantclient11.2-sqlplus-11.2.0.4.0-1.x86_64.rpm
  2. Install RPMs.

    soft]# rpm -ivh oracle-instantclient11.2-basic-11.2.0.4.0-1.x86_64.rpm
    Preparing...                          ################################# [100%]
    Updating / installing...
       1:oracle-instantclient11.2-basic-11################################# [100%]
    soft]# rpm -ivh oracle-instantclient11.2-devel-11.2.0.4.0-1.x86_64.rpm
    Preparing...                          ################################# [100%]
    Updating / installing...
       1:oracle-instantclient11.2-devel-11################################# [100%]
    soft]# rpm -ivh oracle-instantclient11.2-sqlplus-11.2.0.4.0-1.x86_64.rpm
    Preparing...                          ################################# [100%]
    Updating / installing...
       1:oracle-instantclient11.2-sqlplus-################################# [100%]
  3. Configuring the environment variable.

    cat >>/root/.bash_profile <<"EOF"
    # oracle instant client enviroment variable
    export ORACLE_HOME=/usr/lib/oracle/11.2/client64/
    export LD_LIBRARY_PATH=:$ORACLE_HOME/lib:/usr/local/lib
    export TNS_ADMIN=$ORACLE_HOME/network/admin
    export PATH=$PATH:$ORACLE_HOME/bin
    export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
    EOF
  4. Create tnsnames.ora file.

    mkdir -p $ORACLE_HOME/network/admin
    cat >>$ORACLE_HOME/network/admin/tnsnames.ora <<EOF
    COCO =
      (DESCRIPTION =
        (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.184.149)(PORT = 1521))
        (CONNECT_DATA =
          (SERVER = DEDICATED)
          (SERVICE_NAME = coco)
        )
      )
    EOF
  5. Verify.

    ~]# sqlplus -v
    SQL*Plus: Release 11.2.0.4.0 Production
    ~]# sqlplus sys/oracle@COCO as sysdba
    SQL*Plus: Release 11.2.0.4.0 Production on Sun Oct 15 22:20:36 2023
    Copyright (c) 1982, 2013, Oracle.  All rights reserved.
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    SQL> exit
    Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
Edited on