安装rlwrap工具方便sqlplus下调用历史命令

 伤脑筋   2014-05-11 02:04   1771 人阅读  0 条评论

安装rlwrap工具可以在linux下sqlplus 使用↑↓箭头浏览历史命令行,和删除先前输入错误的字母 

1.下载安装文件:

wget -c http://https://www.clrun.com//soft/rlwrap-0.37.tar.gz

2.解压: 

[root@ora ~]# tar -zxvf rlwrap-0.37.tar.gz

[root@ora ~]# cd rlwrap-0.37

[root@ora rlwrap-0.37]# ls

aclocal.m4  BUGS       completions  configure     COPYING  filters  Makefile.am  NEWS  README  test  tools AUTHORS     ChangeLog  config.h.in  configure.ac  doc      INSTALL  Makefile.in  PLEA  src     TODO

3.开始安装:

[root@ora rlwrap-0.37]# ./configure

.... configure: error: You need the GNU readline library(ftp://ftp.gnu.org/gnu/readline/ ) to build this program!

[root@ora rlwrap-0.37]# make make: *** No targets specified and no makefile found.  Stop.

出现上面错误是因为缺少三个安装包:
libtermcap-devel-2.0.8-46.1.i386.rpm
readline-5.1-3.el5.i386.rpm
readline-devel-5.1-3.el5.i386.rpm

以上安装包在安装光盘中可以找到。 

4.安装以上rpm包后重新执行安装

[root@ora rlwrap-0.37]# ./configure

[root@ora rlwrap-0.37]# make

[root@ora rlwrap-0.37]# make install

[root@ora ~]# 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/

5.编辑oracle用户下的.bash_profile 增加下边两行 alias sqlplus='rlwrap sqlplus' alias rman='rlwrap rman'  


本文地址:https://www.clrun.com/2014/05/136.html
版权声明:本文为原创文章,版权归 伤脑筋 所有,欢迎分享本文,转载请保留出处!

 发表评论


表情

还没有留言,还不快点抢沙发?