记住该记住的,忘记该忘记的。改变能改变的,接受不能改变的! 本站域名:www.xyzlotus.cn

在Linux下使用SQLPLUS历史回调功能

上一篇 / 下一篇  2008-04-05 10:14:31 / 个人分类:ORACLE

在Linux中使用SQL*PLUS的时候,并不提供历史回调功能,有时候不太方便。为了能使用向上向下箭调用历史命令,可以安装rlwrap这个软件。
rlwrap,这个程式本身是个Shell,可以运行任何你提供给它的命令包括参数,并添加命令历史浏览功能。 The rlwrap program is under the GPL license。
1、安装
rlwrap-0.28.tar.gz下载地址:http://utopia.knoware.nl/~hlub/uck/rlwrap/
1):解压缩安装文件
$gunzip rlwrap-0.28.tar.gz
$tar xvf rlwrap-0.28.tar
2):切换到root用户,执行下面的命令
# cd /home/oracle/rlwrap-0.28
# ls
#./configure
#make
#make install
2、使用
[oracle@localhost ~]$ rlwrap sqlplus /nolog

SQL*Plus: Release 10.2.0.1.0 - Production on Sat Apr 5 10:01:29 2008

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


SQL> conn / as sysdba                                                                                         
Connected to an idle instance.

然后就可以使用向上、向下键来调用已经执行过的命令了。
如果嫌每次敲rlwrap不爽,可以修改Oracle用户的.bash_profile文件

[oracle@localhost ~]$ vi .bash_profile
加上:
alias sqlplus="rlwrap sqlplus"
alias rman="rlwrap rman"

之后就跟直接使用SQL*PLUS没什么区别了,唯一的好处就是多历史回调功能,方便吧,呵呵。
$ sqlplus /nolog


TAG:

引用 删除 Guest   /   2008-06-23 16:23:59
-5
 

评分:0

我来说两句

显示全部

:loveliness: :handshake :victory: :funk: :time: :kiss: :call: :hug: :lol :'( :Q :L ;P :$ :P :o :@ :D :( :)

日历

« 2008-07-24  
  12345
6789101112
13141516171819
20212223242526
2728293031  

数据统计

  • 访问量: 1992
  • 日志数: 28
  • 文件数: 3
  • 建立时间: 2007-12-17
  • 更新时间: 2008-05-24

RSS订阅

Open Toolbar