os:redhat Enterprise 5
Oracle:linux_x86_11gR1_database
在
Windows操作系统上,当在DOS命令窗口中运行
SQL*Plus的时候,可以使用向上,向下键来跳回之前已经执行过的
SQL语句.你可以根据需要修改他们,然后按Enter键重新提交执行.
然而,当在
Linux Shell中运行SQL*Plus的时候,并不提供浏览历史命令行的功能.
为了在Linux中达到同样的目的,你可以安装rlwrap,这个程式本身是个Shell,可以运行任何你提供给它的命令包括参数,并添加命令历史浏览功能.The rlwrap program is under the GPL license.
一:安装readline
OS的安装光盘里提供了readline包.
[root@oracle11g ~]# rpm -Uvh readline*
error: Failed dependencies: libtermcap-devel is needed by readline-devel-5.1-1.1.i386.rpm
[root@oracle11g ~]# rpm -Uvh libtermcap-devel-2.0.8-46.1.i386.rpm
[root@oracle11g ~]# rpm -Uvh readline*
package readline-5.1-1.1 is already installed
[root@oracle11g ~]# rpm -Uvh readline-devel-5.1-1.1.i386.rpm
二:安装rlwrap
Download:
http://utopia.knoware.nl/~hlub/uck/rlwrap/[root@oracle11g ~]# tar -zxvf rlwrap-0.30.tar.gz
[root@oracle11g ~]# cd rlwrap-0.30
[root@oracle11g rlwrap-0.30]# ./configure
[root@oracle11g rlwrap-0.30]# make
[root@oracle11g rlwrap-0.30]# make install
[root@oracle11g rlwrap-0.30]# 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>
-F <format string> --history-format=<format string>
-h --help
-H <file> --history-filename=<file>
-i --case-insensitive
-l <file> --logfile=<file>
-n --no-warnings
-p[ANSI colour spec] --prompt-colour[=ANSI colour spec]
-P <input> --pre-given=<input>
-q <chars> --quote-characters=<chars>
-m[newline substitute] --multi-line[=newline substitute]
-r --remember
-v --version
-s <N> --histsize=<N> (negative: readonly)
-t <name> --set-term-name=<name>
bug reports, suggestions, updates:
http://utopia.knoware.nl/~hlub/uck/rlwrap/[root@oracle11g rlwrap-0.30]# vi /home/oracle/.bash_profile
添加
alias sqlplus='rlwrap sqlplus'
alias rman='rlwrap rman'
三:使用rlwrap
[oracle@oracle11g ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.1.0.6.0 - Production on Tue Jul 29 21:28:30 2008
Copyright (c) 1982, 2007, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> select * from v$sga;
NAME VALUE
-------------------- ----------
Fixed Size 1299116
Variable Size 155192660
Database Buffers 79691776
Redo Buffers 2347008
使用向上键调回最后执行的命令,按Enter键重新执行或修改后按Enter键执行.
SQL> select * from v$sga;
NAME VALUE
-------------------- ----------
Fixed Size 1299116
Variable Size 155192660
Database Buffers 79691776
Redo Buffers 2347008
SQL>
Note:
解决在sqlplus下输错命令后正常删除的方法
[oracle@oracle11g ~]$ vi /home/oracle/.bash_profile
添加
stty erase ^h
相关推荐
如何在SQL-PLUS中使用方向键复用历史脚本-之rlwrap使用方法.docx
rlwrap-0.37.tar.gz 在linux中的ORACLE上下键跳SQL命令
在Linux下使用SQL*PLUS、RMAN发现无法像bush一样上下翻页,也不能退格,只要安装rlwrap即可实现以上功能, linux6 linux7下安装包
rlwrap的安装使用 [SQLPlus上下键] oracle
安装方法: 1. tar -jxvf rlwrap-0.28.tar.bz2 2. cd rlwrap-0.28 3. configure && make && make install 4. vi .bash_profile 加入下面内容 alias sqlplus='rlwrap sqlplus' rlwrap is a 'readline wrapper' that ...
Linux Oracle下sqlplus无法使用命令退格删除和历史记录的解决方法(使用rlwrap) 附件中有解决方法的具体步骤
Windows下使用sqlplus的同学们都可以调出历史命令,提高了执行效率节省时间,linux下都要重新敲命令。有这个工具后就可以调出前面敲过的命令执行。 tar -xzvf rlwrap-0.37.tar.gz make install su - oracle vi .bash...
让你的oracle也可以象在linux下一样的用上下键来查看历史记录
Oracle sqlplus工具
rlwrap解决LINUX SQLPlus不能使用上下键
Linux下增加SqlPlus上下键翻动功能,方便sql执行翻阅历史的命令记录。
rlwrap是Linux下oracle命令回调工具,安装和配置见readme
Oracle sqlplus中上下左右 退格键无法使用解决方法,解压完该包后能在Linux系统中Oracle的SQL界面使用删除按钮等操作。安装命令为检查该软件的./configure && make && make install
在Linux下使用sqlplus或者rman时,经常需要调用上次或之前运行过的命令 下载包地址: http://rpm.pbone.net/index.php3/stat/4/idpl/28195042/dir/redhat_el_7/com/rlwrap-0.42-1.el7.x86_64.rpm.html 地址2: ...
rlwrap Linux Oracle下sqlplus无法使用命令退格删除和历史记录的解决方法(使用rlwrap)
Linux 下sql*plus 实现上下键历史记录显示需要安装了两个资源包rar包中包括: rlwrap-0.37.tar.gz、readline-6.2.tar.gz。
大家在Linux主机使用sqlplus命令行工具时,经常会抱怨命令输错不好回退,或者刚输入的命令想再次执行,无法通过上下翻页切换的情况。 那么,是否有方法可以解决呢?答案是肯定的,安装配置 rlwrap 即可。 rlwrap...
绍linux下使用rlwrap调用sqlplus中历史命令
Linux Oracle下sqlplus无法使用命令退格删除和历史记录的解决方法(使用rlwrap)
在linux中oracle的sqlplus是没办法想windows下可以上下调回历史输入的。rlwrap就很好的解决了这个问题。rlwrap 可以用来支持Oracle下sqlplus历史命令的回调功能,提高效率