可以使用ctrl + r快捷键进行历史搜索或者使用rlwrap工具可解决。
(1)下载http://utopia.knoware.nl/~hlub/uck/rlwrap
(2)解压
#tar -zxvf rlwrap-0.41.tar.gz
#cd rlwrap-0.41
# ./configure
如果最后提示 You need the GNU readline library(ftp://ftp.gnu.org/gnu/readline/ ) to build this program!
则还需要安装:readline
readline-devel-6.0-4.el6.i686.rpm
readline-6.0-4.el6.i686.rpm
ncurses-devel-5.7-3.20090208.el6.i686.rpm
(3)安装
#./configure
#make
#make check
reboot
环境变量添加
alias sqlplus='rlwrap sqlplus'
alias rman='rlwrap rman'
完成后 source ~oracle/.bash_profile
解决在sqlplus下输错命令后正常删除的方法
[oracle@oracle11g ~]$ vi /home/oracle/.bash_profile
添加stty erase ^h