前言
在linux上安装oracle客户端之后就能通过sqlplus连接oracle服务器了,而且比较轻量级
安装步骤
1、下载依赖包
instantclient-sdk-linux-x86-64-11.2.0.2.0.zipinstantclient-sqlplus-linux-x86-64-11.2.0.2.0.zipinstantclient-basic-linux-x86-64-11.2.0.2.0.zipinstantclient_11_2.zip2、解压到oracle的安装路径下,如:oracle安装在/opt/oracle下,那么把下载的4个文件放入
cd /opt/oracleunzipinstantclient-basic-linux-x86-64-11.2.0.2.0.zipunzipinstantclient-sdk-linux-x86-64-11.2.0.2.0.zipunzipinstantclient-sqlplus-linux-x86-64-11.2.0.2.0.zipunzip instantclient_11_2.zip
3、环境变量的配置
vi /etc/profileexport ORACLE_HOME=/opt/oracle/instantclient_11_2export PATH=$ORACLE_HOME:$PATHexport TNS_ADMIN=$ORACLE_HOME/network/adminexport LD_LIBRARY_PATH=$ORACLE_HOME:$LD_LIBRARY_PATHexport NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
配置完,生效:source /etc/profile
4、创建监听文件
mkdir -p /opt/oracle/11.2/client64/network/admincd/opt/oracle/11.2/client64/network/adminvi tnsnames.oratest_db =(DESCRIPTION =(ADDRESS_LIST =(ADDRESS = (PROTOCOL = TCP)(HOST = 1.1.1.1)(PORT = 1521)))(CONNECT_DATA =(SERVER = DEDICATED)(SERVICE_NAME = test_db)))
5、测试
sqlplus /nolog
小编在使用oracle时,随手做个记录,希望对大家有所帮助,如还有疑问可留言~
如果觉得《linux系统下安装oracle客户端》对你有帮助,请点赞、收藏,并留下你的观点哦!