在linux上使用sqlplus命令的时候,上下键、空格键、删除键都不能使用,非常麻烦。安装了rlwrap之后,这一问题得到解决
在安装rlwrap之前需要安装readline
yum install readline
接着安装rlwrap
可以使用rlwrap的rpm包安装
本次使用源码包
使用root上传源码包rlwrap-0.37.tar.gz
tar -zxvf rlwrap-0.37.tar.gz
cd rlwrap-0.37
[root@oracle11gr203db rlwrap-0.37]# ./configure
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make sets $(MAKE)... (cached) yes
checking whether build environment is sane... yes
………
checking for tgetent in -lcurses... no
checking for tgetent in -lncurses... no
checking for tgetent in -ltermcap... no
configure: WARNING: No termcap nor curses library found
checking for readline in -lreadline... no
configure: error:
You need the GNU readline library(ftp://ftp.gnu.org/gnu/readline/ ) to build
this program!
(上述命令执行后检查配置出错)
检查是否已经安装下面的三个安装包:
libtermcap-devel-2.0.8-39.i386.rpm
readline-4.3-13.i386.rpm
readline-devel-4.3-13.i386.rpm
以上安装包在安装光盘中可以找到
[root@oracle11gr203db Packages]# rpm -qa|grep readline
readline-devel-6.0-4.el6.x86_64
readline-6.0-4.el6.i686
readline-6.0-4.el6.x86_64
重新安装:
[root@oracle11gr203db rlwrap-0.37]# ./configure
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make sets $(MAKE)... (cached) yes
………
checking for tgetent... no
checking for tgetent in -lcurses... yes
checking for readline in -lreadline... yes
checking whether your readline headers know about rl_set_screen_size... yes
checking whether your readline library knows about rl_set_screen_size... checking for rl_set_screen_size... yes
checking whether your readline knows about rl_variable_value... yes
checking whether your readline knows about rl_readline_version... yes
Will rlwrap find command's working directory under /proc/<commands pid>/cwd? let's see...
checking for /proc/4018/cwd/configure.ac... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating filters/Makefile
config.status: creating doc/Makefile
config.status: creating src/Makefile
config.status: creating doc/rlwrap.man
config.status: creating config.h
config.status: executing depfiles commands
Now do:
make (or gmake) to build rlwrap
make check for instructions how to test it
make install to install it
[root@oracle11gr203db rlwrap-0.37]#
[root@oracle11gr203db rlwrap-0.37]# make
[root@oracle11gr203db rlwrap-0.37]# make install
验证安装结果
[root@oracle11gr203db rlwrap-0.37]# su - oracle
[oracle@oracle11gr203db ~]$ rlwrap
Usage: rlwrap [options] command ...
Options:
-a[password:] --always-readline[=password:]
-A --ansi-colour-aware
-b <chars> --break-chars=<chars>
-c --complete-filenames
-C <name|N> --command-name=<name|N>
-D <0|1|2> --history-no-dupes=<0|1|2>
-f <completion list> --file=<completion list>
-g <regexp> --forget-matching=<regexp>
-h --help
-H <file> --history-filename=<file>
-i --case-insensitive
-I --pass-sigint-as-sigterm
-l <file> --logfile=<file>
-n --no-warnings
-N --no-children
-o --one-shot
-O <regexp> --only-cook=<regexp>
-p[colour] --prompt-colour[=colour]
-P <input> --pre-given=<input>
-q <chars> --quote-characters=<chars>
-m[newline substitute] --multi-line[=newline substitute]
-r --remember
-R --renice
-v --version
-s <N> --histsize=<N> (negative: readonly)
-S <prompt> --substitute-prompt=<prompt>
-t <name> --set-term-name=<name>
-w <N> --wait-before-prompt=<N> (msec, <0 : patient mode)
-z <filter command> --filter=<filter command>
bug reports, suggestions, updates:
http://utopia.knoware.nl/~hlub/uck/rlwrap/
[oracle@oracle11gr203db ~]$
编辑oracle用户下的.bash_profile
增加
alias sqlplus='rlwrap sqlplus'
alias rman='rlwrap rman'
参考文档:
Linux 安装 rlwrap工具
http://blog.csdn.net/xiegh2014/article/details/52202516
linux上 rlwrap安装
http://blog.csdn.net/qdseashore/article/details/52534388
RedHat Enterprise Linux下安装rlwrap工具
如何安装rlwrap
http://jingyan.baidu.com/article/90808022edddf0fd91c80fdd.html