使用rlwrap工具实现sqlplus 上下键切换历史命令,回删字符。
1)安装依赖包
yum install ncurses-devel -y
yum install readline-devel -y
2)安装rlwrap
下载链接:https://pan.baidu.com/s/1GhVz7wK9n4A7MS4cOelqVA
提取码:1111
tar -zxvf rlwrap-0.43.tar.gz
cd rlwrap-0.43/
./configure
make
make install
3)设置用户环境变量
切换至用户,在.bash_profile文件添加以下内容
vim ~/.bash_profile
alias sqlplus='rlwrap sqlplus';
source ~/.bash_profile
4)使用sqlplus
sqlplus ora@dbServer