rlwrap 的安装使用

来源:互联网 发布:没什么用网络语怎么说 编辑:程序博客网 时间:2024/06/06 20:30

在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                  --break-chars=
  -c                         --complete-filenames
  -C                 --command-name=
  -D                  --history-no-dupes=
  -f        --file=
  -F          --history-format=
  -h                         --help
  -H                   --history-filename=
  -i                         --case-insensitive
  -l                   --logfile=
  -n                         --no-warnings
  -p[ANSI colour spec]       --prompt-colour[=ANSI colour spec]
  -P                  --pre-given=
  -q                  --quote-characters=
  -m[newline substitute]     --multi-line[=newline substitute]
  -r                         --remember
  -v                         --version
  -s                      --histsize= (negative: readonly)
  -t                   --set-term-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


FROM:http://linux.chinaunix.net/techdoc/system/2008/07/29/1021764.shtml

0 0
原创粉丝点击
热门问题 老师的惩罚 人脸识别 我在镇武司摸鱼那些年 重生之率土为王 我在大康的咸鱼生活 盘龙之生命进化 天生仙种 凡人之先天五行 春回大明朝 姑娘不必设防,我是瞎子 喜欢对象的发小怎么办 山东省直医保卡丢失怎么办 高铁票如果错过了怎么办 动车错过了时间怎么办 长途动车错过了怎么办 动车如果错过了怎么办 没有取票错过了怎么办 动车出站没检票怎么办 火车晚点耽误了下班车怎么办 动车票中途丢了怎么办 购买二手房异地铁路公积金怎么办 沈阳公积金卡丢了怎么办 住宅专项维修资金用完了怎么办 广州出租车丢了东西怎么办 广州的士丢了东西怎么办 网上找兼职被骗了怎么办 海信空调开不了机怎么办 海信空调遥控器开不了怎么办 学生遭套路贷反被仲裁怎么办 赏脸打错字尝脸怎么办 红掌的花变黑了怎么办 红掌花苞发黑了怎么办 水培植物腐根了怎么办 水培绿萝水发臭怎么办 水里养花根烂掉怎么办 桅子花叶子发黑怎么办 大株月季烂根怎么办 月季水浇多了烂根的怎么办 金桔盆栽烂根怎么办 盆栽的长寿果树烂根怎么办 家里的石榴烂根怎么办 山桔盆栽烂根怎么办 养的植物烂根怎么办 桅子花叶子长霉怎么办 紫薇花叶子干了怎么办 高层玻璃阳台往下看恐高怎么办 比熊放阳台叫怎么办 海员入职体检不合格怎么办 联币金融立案投资人怎么办 联币金融的投资怎么办 养老保险领了几个月就挂了怎么办