linux下oracle客户端安装
-
下载安装包
zip包(免安装):
instantclient-sqlplus-linux.x64-11.2.0.4.0.zip
instantclient-basic-linux.x64-11.2.0.4.0.zip
instantclient-sdk-linux.x64-11.2.0.4.0.zip
instantclient-precomp-linux-11.2.0.4.0.zip PRO*C程序开发用到的预编译工具,即proc程序; -
安装解压缩到/home/oracle目录
unzip instantclient-sqlplus-linux.x64-11.2.0.4.0.zip
unzip instantclient-basic-linux.x64-11.2.0.4.0.zip
unzip instantclient-sdk-linux.x64-11.2.0.4.0.zip
unzip instantclient-precomp-linux-11.2.0.4.0.zip
- 创建文件夹
#切换到目录:
cd /home/oracle/instantclient_11_2
#创建目录
mkdir -p ./network/admin
- 新建tnsnames.ora文件
#新建tnsnames.ora文件
vi tnsnames.ora
#history_162:数据库sid,host:oracle数据库ip,port:oracle数据库端口,SID:数据库的sid
history_162 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.1.197.1)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SID =xxx)
)
)
- 配置环境变量
vi .bash_profile
export ORACLE_HOME=/home/oracle/instantclient_11_2
export TNS_ADMIN=$ORACLE_HOME/network/admin
#export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
export NLS_LANG=AMERICAN_AMERICA.AL32UTF8
export LD_LIBRARY_PATH=$ORACLE_HOME
export PATH=$ORACLE_HOME:$PATH
#刷新
source .bash_profile
- 测试数据库连接
sqlplus username/passwd@sid

浙公网安备 33010602011771号