Preface
In addition to installing the Oracle database software, we often need to install the Oracle client on a host without an Oracle database environment to access the Oracle server over the network. The steps for installing the Oracle Instant Client in RHEL 5.5x86 are as follows:
Installation environment:
In this article, RHEL 5.5 x86 is installed in a virtual machine and connected with secureCRT.
1. Download the Installation File
The installation file has the corresponding on the Oracle official website, address: http://www.oracle.com/technetwork/topics/linuxsoft-082809.html
Find the corresponding system in this article and download it. In this article, I choose to download three files:
1、instantclient-basic-linux-11.2.0.3.0.zip (58,502,865 bytes) (cksum-2164488682)
2、instantclient-sqlplus-linux-11.2.0.3.0.zip (796,570 bytes) (cksum-3693267088)
3366nstantclient-sdk-linux-11.2.0.3.0.zip (639,306 bytes) (cksum-3741058433)
2. Upload the installation file to the virtual machine where the Oracle client is to be installed.
In this article, I use secureCRT's SFTP to transmit data to RHEL 5.5 x86:
Sftp> LCD "~ /Desktop/client /"
Sftp> lls
Instantclient-basic-linux-11.2.0.3.0.zip instantclient-sdk-linux-11.2.0.3.0.zip
The instantclient-sqlplus-linux-11.2.0.3.0.zip listener. ora.
Sqlnet. ora tnsnames. ora
Sftp> cd/home/oracle/
Sftp> put instantclient-basic-linux-11.2.0.3.0.zip
Sftp> put instantclient-sdk-linux-11.2.0.3.0.zip
Sftp> put instantclient-sqlplus-linux-11.2.0.3.0.zip
Sftp> ls
Instantclient-basic-linux-11.2.0.3.0.zip instantclient-sdk-linux-11.2.0.3.0.zip
Instantclient-sqlplus-linux-11.2.0.3.0.zip
So far, the installation file has been uploaded.
3. Create a user
[Root @ frank ~] # Groupadd dba
[Root @ frank ~] # Groupadd oinstall
[Root @ frank ~] # Useradd-g oinstall-G dba oracle
[Root @ frank ~] # 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.
Iv. Configure Environment Variables
[Root @ frank ~] # Su-oracle
[Oracle @ frank ~] $ Vi. bash_profile
#. Bash_profile
# Get the aliases and functions
If [-f ~ /. Bashrc]; then
.~ /. Bashrc
Fi
# User specific environment and startup programs
PATH = $ PATH: $ HOME/bin
Export PATH
Export ORACLE_HOME =/home/oracle/instantclient_11_2
Export TNS_ADMIN = $ ORACLE_HOME
Export LD_LIBRARY_PATH = $ ORACLE_HOME:/usr/local/lib: $ {LD_LIBRARY_PATH}
Export SQLPATH = $ ORACLE_HOME
Export PATH = $ PATH: $ ORACLE_HOME:/home/oracle/instantclient_11_2
[Oracle @ frank ~] $ Source. bash_profile
Now, environment variable configuration is complete.
5. decompress the Installation File
[Oracle @ frank ~] $ Unzip instantclient-basic-linux-11.2.0.3.0.zip
[Oracle @ frank ~] $ Unzip instantclient-sdk-linux-11.2.0.3.0.zip
[Oracle @ frank ~] $ Unzip instantclient-sqlplus-linux-11.2.0.3.0.zip
[Oracle @ frank ~] $ Ls
Oradiag_oracle instantclient_11_2 instantclient-sdk-linux-11.2.0.3.0.zip
Instantclient-basic-linux-11.2.0.3.0.zip instantclient-sqlplus-linux-11.2.0.3.0.zip
6. Configure the tnsname. ora File
In this step, configure the relevant information of the database to be connected in tnsname. ora:
[Oracle @ frank ~] $ Cd instantclient_11_2/
[Oracle @ frank instantclient_11_2] $ vi tnsnames. ora
# Tnsnames. ora Network Configuration File:
/U01/app/oracle/product/11.2.0/dbhome_1/network/admin/tnsnames. ora
# Generated by Oracle configuration tools.
ENMOEDU =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.80.10) (PORT = 1521 ))
)
(CONNECT_DATA =
(SERVICE_NAME = ENMOEDU)
)
)
DUPL =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.80.10) (PORT = 1521 ))
)
(CONNECT_DATA =
(SERVICE_NAME = DUPL)
)
)
Exit and save. So far, tnsname. ora is configured successfully.
VII. test connection
[Oracle @ frank ~] $ Sqlplus sys/oracle @ ENMOEDU as sysdba
SQL * Plus: Release 11.2.0.3.0 Production on Wed Mar 5 15:44:48 2014
Copyright (c) 1982,201 1, Oracle. All rights reserved.
Connected:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0-Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL>
The test is successful.
So far, all Oracle instant clients have been configured successfully.