1 下载安装包rlwrap: rlwrap-0.30.tar.gz
http://utopia.knoware.nl/~hlub/uck/rlwrap/
2 install rlwrap:
# tar -xzvf rlwrap-0.30.tar.gz
# cd rlwrap-0.30
# ./configure
# make
# make check
# make install
# cd rlwrap-0.30
# ./configure
# make
# make check
# make install
(如果提示You need the GNU readline library (ftp://ftp.gnu.org/gnu/readline/ ) to build this program 说明需要安装readline, readline-devel和 libtermcap-devel)
3 使用
切换到oracle用户,编辑.bash_profile文件,
#su - oracle
#vi .bash_profile
在后边加上如下内容:
alias sqlplus='rlwrap sqlplus'
alias rman='rlwrap rman'
alias rman='rlwrap rman'
stty erase ^h