您的位置:首页 > 运维架构 > Linux

linux 中上下键跳SQL命令 rlwrap使用方法

2016-08-24 12:02 661 查看
Os:CentOS release 6.5 ‘
Oracle:linux_x86_11gR1_database

1。安装rlwrap
Download:http://utopia.knoware.nl/~hlub/uck/rlwrap/

[root@centos6 ~]# tar -zxvf rlwrap-0.30.tar.gz
[root@centos6 ~]# cd rlwrap-0.30
[root@centos6 rlwrap-0.42]# ./configure
[root@centos6 rlwrap-0.42]# make
[root@centos6 rlwrap-0.42]# make install
[root@centos6 rlwrap-0.42]# rlwrap
Usage: rlwrap [options] command ...

Options:
-a[password prompt] --always-readline[=password prompt]
-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>
-e <char|''> --extra-char-after-completion=<char|''>
-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>
-m[newline substitute] --multi-line[=newline substitute]
-M <.ext> --multi-line-ext=<.ext>
-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>
-r --remember
-R --renice
-s <N> --histsize=<N> (negative: readonly)
-S <prompt> --substitute-prompt=<prompt>
-t <name> --set-term-name=<name>
-U --mirror-arguments
-v --version
-w <N> --wait-before-prompt=<N> (msec, <0 : patient mode)
-W --polling
-z <filter command> --filter=<filter command> (-z listing lists installed filters)

bug reports, suggestions, updates:
http://utopia.knoware.nl/~hlub/uck/rlwrap/

2、配置rlwrap
[root@centos6 rlwrap-0.42]# vi /home/oracle/.bash_profile
添加
alias sqlplus='rlwrap sqlplus'
alias rman='rlwrap rman'

3、使用rlwrap
[oracle@centos6 ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Tue Aug 23 21:01:31 2016

Copyright (c) 1982, 2009, Oracle. All rights reserved.

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> select * from v$sga;

NAME VALUE
-------------------- ----------
Fixed Size 2215464
Variable Size 432013784
Database Buffers 138412032
Redo Buffers 3579904

使用向上键调回最后执行的命令,按Enter键重新执行或修改后按Enter键执行.
SQL> select * from v$sga;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  使用 方法 rlwrap