下载以下两个文件:https://www.oracle.com/database/technologies/instant-client/linux-x86-64-downloads.html

 instantclient-basic-linux.x64-11.2.0.4.0.zip
 instantclient-sqlplus-linux.x64-11.2.0.4.0.zip

解压生成

instantclient_11_2

cd instantclient_11_2

mkdir netword/admin

[esunny@localhost admin]$ pwd
/home/esunny/rpm/instantclient_11_2/network/admin
[esunny@localhost admin]$ cat 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.

orcl =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 172.19.10.7)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = htqhfz)
)
)
vim ~/.bash_profile

PATH=$PATH:$HOME/.local/bin:$HOME/bin export ORACLE_HOME=/home/esunny/rpm/instantclient_11_2 export PATH=$ORACLE_HOME:$PATH export TNS_ADMIN=$ORACLE_HOME/network/admin export LD_LIBRARY_PATH=$ORACLE_HOME:$LD_LIBRARY_PATH export PATH
12-30 16:07