启用sqlplus中上下健跳SQL命令

     大家都知道在linux下可以使用上下键,查看历史命令,但是在oracle的sqlplus中确无法实现,每次都要手工输入命令,这样很麻烦,这里介绍个软件,以后就可以向使用linux一样随便跳命令了。
    软件名称:rlwrap,它的官方网站是 http://utopia.knoware.nl/~hlub/uck/rlwrap/;安装其实也很简单的,它所依赖的软件包是readline,这个在linux光盘中都能找到。
[root@server1 ~]# tar -zxvf rlwrap-0.36.tar.gz
[root@server1 ~]# cd rlwrap-0.36
[root@server1 rlwrap-0.36]# ./configure
[root@server1 rlwrap-0.36]# make
[root@server1 rlwrap-0.36]# make install
[root@server1 rlwrap-0.36]# 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  &lt;filter command>       --filter=<filter command>
向.bash_profile里加入以下内容即可:
alias sqlplus='rlwrap sqlplus'
alias rman='rlwrap rman'
下面这个网址是rpm包格式的:
http://www.rpmfind.net/linux/rpm2html/search.php?query=rlwrap

本文出自 “candon123” 博客,谢绝转载!

你可能感兴趣的:(sql,数据库,命令,sqlplus,休闲)