参考:http://blog.51cto.com/linuxguest/405374
linux下使用rlwrap回调sqlplus中执行过的命令
使用yum安装rlwrap:
yum install rlwrap -y
[root@node32 ~]# yum install rlwrap -y Loaded plugins: langpacks, ulninfo Package rlwrap-0.42-1.el7.x86_64 already installed and latest version Nothing to do You have new mail in /var/spool/mail/root [root@node32 ~]# which rlwrap /usr/bin/rlwrap [root@node32 ~]#
配置oracle用户的环境变量,添加rlwrap的路径
vim /home/oracle/.bash_profile
在尾部加入:
alias sqlplus='rlwrap sqlplus' alias rman='rlwrap rman' PATH=/usr/rlwrap/bin/:$PATH export PATH
保存退出
立即生效:
source /home/oracle/.bash_profile
切换到oracle用户,进入SQLPLUS环境测试,成功解决