CentOS系统升级SQL*Plus的详细步骤
~/.bashrc中相关环境变量设置)、自定义脚本及数据库连接文件(如tnsnames.ora),避免升级丢失关键信息。sudo yum install -y libaio libaio-devel glibc glibc-devel gcc zlib-devel
wget https://download.oracle.com/otn_software/linux/instantclient/211000/instantclient-basic-linux.x64-21.1.0.0.0.zip
wget https://download.oracle.com/otn_software/linux/instantclient/211000/instantclient-sqlplus-linux.x64-21.1.0.0.0.zip
/u01/app/oracle/product/21c/client_1),并创建软链接简化路径:sudo unzip instantclient-basic-linux.x64-21.1.0.0.0.zip -d /u01/app/oracle/product/21c/client_1
sudo unzip instantclient-sqlplus-linux.x64-21.1.0.0.0.zip -d /u01/app/oracle/product/21c/client_1
sudo ln -s /u01/app/oracle/product/21c/client_1 /u01/app/oracle/instantclient
~/.bashrc),添加以下内容(替换为实际路径):export ORACLE_HOME=/u01/app/oracle/instantclient
export LD_LIBRARY_PATH=$ORACLE_HOME:$LD_LIBRARY_PATH
export PATH=$ORACLE_HOME:$PATH
export NLS_LANG=AMERICAN_AMERICA.AL32UTF8 # 可选,设置字符集
执行source ~/.bashrc使变量生效。sqlplus -v
输出应显示新版本号(如“SQL*Plus: Release 21.1.0.0.0 Production”)。tnsnames.ora):sqlplus username/password@tns_alias
login.sql(SQL*Plus启动脚本)或自定义快捷键设置,将其复制至新版本的$ORACLE_HOME/sqlplus/admin目录。rlwrap工具,支持SQL*Plus历史命令查询(上下箭头)、命令补全等功能(参考CentOS 6.3下的安装教程,适用于高版本CentOS)。