使用rlwrap工具解决:
1.下载安装readline和rlwrap
//安装readline
[root@oracle opt]#wget ftp://ftp.gnu.org/gnu/readline/readline-6.2.tar.gz
[root@oracle opt]# tar xvf readline-6.2.tar.gz
[root@oracle opt]# cd readline-6.2
[root@oracle readline-6.2]# ./configure && make && make install
//安装rlwrap
[root@oracle opt]# wget http://utopia.knoware.nl/~hlub/rlwrap/rlwrap-0.37.tar.gz
[root@oracle opt]# tar xvf rlwrap-0.37.tar.gz
[root@oracle opt]# cd rlwrap-0.37
[root@oracle rlwrap-0.37]# ./configure && make && make install
2.更改环境变量增加别名
[root@oracle rlwrap-0.37]# vim /home/oracle/.bash_profile