- 下载 依赖软件 下载页链接 https://www.oracle.com/database/technologies/instant-client/linux-x86-64-downloads.html
wget https://download.oracle.com/otn_software/linux/instantclient/215000/instantclient-basiclite-linux.x64-21.5.0.0.0dbru.zip
wget https://download.oracle.com/otn_software/linux/instantclient/215000/instantclient-sqlplus-linux.x64-21.5.0.0.0dbru.zip
- 解压移动所有文件到目录 /usr/local/sqlplus
unzip instantclient-basiclite-linux.x64-21.5.0.0.0dbru.zip -d /usr/local
unzip instantclient-sqlplus-linux.x64-21.5.0.0.0dbru.zip -d /usr/local
mv /usr/local/instantclient_21_5 /usr/local/sqlplus
cd /usr/local/sqlplus
mkdir lib
mv *.so* lib
chmod +x sqlplus
ln -s /usr/local/sqlplus/sqlplus /usr/local/bin/sqlplus
设置环境变量
.bash_profile
加入
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/sqlplus/lib
使生效
source .bash_profile
- 执行测试
root@deb10:~# sqlplus /nolog
SQL*Plus: Release 21.0.0.0.0 - Production on Tue Feb 22 10:44:55 2022
Version 21.5.0.0.0
Copyright (c) 1982, 2021, Oracle. All rights reserved.
SQL> conn system/szoscar55@10.1.1.66:1521/ora
Connected.
SQL>