利用Uniread 解决 Linux下的SQL*Plus 命令行历史回调功能
2008-04-08 21:27
751 查看
大家知道, 在 windows 平台 命令行中的 sql*plus 有命令行历史回调的功能,在sql*plus工具下面,能够利用键盘的
"向上向下"箭头键对命令行的进行回调.而在linux上则没有该功能(虽然 shell 能够做到这一点,但是 sql*plus 不能够).
而该功能对于cli爱好者来说几乎是不可缺的,不知道为什么 oracle 不把这个功能加进来.不得而知了.
一些sql*plus 的替代产品(如 gqlplus 连同yasql)具备command-line editing 和command history的功能, 但是这
些产品的研发进度较慢--有的甚至已停止了更新.
(参见: gqlplus http://sourceforge.net/projects/gqlplus 连同 yasql http://sourceforge.net/projects/yasql/ 等 sql*plus 替代工具 ).
在网络上闲逛的时候, 发现了一个在linux下面的解决办法, 现在和大家共享.
该工具叫做uniread ( http://sourceforge.net/projects/uniread/ ) ,熟悉linux下变成的朋友可能看到这个名字已
想起了一些东西:readline . 不错,该工具就是利用gnu的readline库来完成我们的需求的.
我们先看一下对该工具的介绍:
uniread - universal readline - adds full readline support (command editing, history, etc.) to any existing
interactive command-line program. common examples are oracles sqlplus or jython. uniread will work
on any posix platform with perl.
能够看出,该工具能够对任何既有的交互命令行程式都可提供完备的readline支持.
从该站点下载源程式.现在的稳定版本是1.01.
在安装该工具之前系统必须安装好perl, 此外还必须要三个工具包:
gnu readline http://cnswww.cns.cwru.edu/php/chet/readline/rltop.html
term::readline::gnu http://search.cpan.org/dist/term-readline-gnu/
io::tty http://search.cpan.org/dist/io-tty/
其中gnu readline 上面的网页在我的机器上打不开(不可访问?),假如您也是同样情况,能够到 http://www.gnu.org/directory/readline.html 这个页面下载.
下载后,首先解压缩:
# tar -xzvf readline-4.3.tar.gz
进入进入到该目录中编译并安装:
# ./configure
# make
# make install
后面两个的安装: tar -zxvf ....
进入到该目录中:
# perl makefile.pl
# make
# make install
都安装完了之后,进行 uniread 的安装:
#tar -xzvf uniread-1.01.tar.gz
#cd uniread-1.01
#./configure
#make
#make install
注: 以上的命令行操作所在绝对路径为了方便而省略,您的环境肯定会和我的不同,此外,建议使用普通用户编译,然后用 root 进行
make install .
都安装完了之后
转换到oracle用户下:
$ uniread sqlplus /nolog
输出类似如下:
[uniread] loaded history (12 lines) //我的已运行一次了,uniread 缓冲了12行history
sql*plus: release 10.1.0.2.0 - production on sat mar 6 00:23:05 2004
copyright (c) 1982, 2004, oracle. all rights reserved.
sql>
查看uniread的manual:
$man uniread
您能够做个sqlplus 的别名 ,uniread的使用是透明的,是不是很方便了? 不要忘了:这个工具是有通用性的,不止是 sql*plus
能够这样用,其他类似的命令行程式也能如此的.
参考内容:
uniread的站点 http://sourceforge.net/projects/uniread
gnu readline http://www.gnu.org/directory/readline.html "the readline library provides a set of functions for use by applications that allow users to edit
command lines as they are typed in."
现在还算万能的google http://www.google.com
原文出处:
<a href="http://www.dbanotes.net/oracle/uniread-howto.htm">http://www.dbanotes.net/oracle/uniread-howto.htm</a>
"向上向下"箭头键对命令行的进行回调.而在linux上则没有该功能(虽然 shell 能够做到这一点,但是 sql*plus 不能够).
而该功能对于cli爱好者来说几乎是不可缺的,不知道为什么 oracle 不把这个功能加进来.不得而知了.
一些sql*plus 的替代产品(如 gqlplus 连同yasql)具备command-line editing 和command history的功能, 但是这
些产品的研发进度较慢--有的甚至已停止了更新.
(参见: gqlplus http://sourceforge.net/projects/gqlplus 连同 yasql http://sourceforge.net/projects/yasql/ 等 sql*plus 替代工具 ).
在网络上闲逛的时候, 发现了一个在linux下面的解决办法, 现在和大家共享.
该工具叫做uniread ( http://sourceforge.net/projects/uniread/ ) ,熟悉linux下变成的朋友可能看到这个名字已
想起了一些东西:readline . 不错,该工具就是利用gnu的readline库来完成我们的需求的.
我们先看一下对该工具的介绍:
uniread - universal readline - adds full readline support (command editing, history, etc.) to any existing
interactive command-line program. common examples are oracles sqlplus or jython. uniread will work
on any posix platform with perl.
能够看出,该工具能够对任何既有的交互命令行程式都可提供完备的readline支持.
从该站点下载源程式.现在的稳定版本是1.01.
在安装该工具之前系统必须安装好perl, 此外还必须要三个工具包:
gnu readline http://cnswww.cns.cwru.edu/php/chet/readline/rltop.html
term::readline::gnu http://search.cpan.org/dist/term-readline-gnu/
io::tty http://search.cpan.org/dist/io-tty/
其中gnu readline 上面的网页在我的机器上打不开(不可访问?),假如您也是同样情况,能够到 http://www.gnu.org/directory/readline.html 这个页面下载.
下载后,首先解压缩:
# tar -xzvf readline-4.3.tar.gz
进入进入到该目录中编译并安装:
# ./configure
# make
# make install
后面两个的安装: tar -zxvf ....
进入到该目录中:
# perl makefile.pl
# make
# make install
都安装完了之后,进行 uniread 的安装:
#tar -xzvf uniread-1.01.tar.gz
#cd uniread-1.01
#./configure
#make
#make install
注: 以上的命令行操作所在绝对路径为了方便而省略,您的环境肯定会和我的不同,此外,建议使用普通用户编译,然后用 root 进行
make install .
都安装完了之后
转换到oracle用户下:
$ uniread sqlplus /nolog
输出类似如下:
[uniread] loaded history (12 lines) //我的已运行一次了,uniread 缓冲了12行history
sql*plus: release 10.1.0.2.0 - production on sat mar 6 00:23:05 2004
copyright (c) 1982, 2004, oracle. all rights reserved.
sql>
查看uniread的manual:
$man uniread
您能够做个sqlplus 的别名 ,uniread的使用是透明的,是不是很方便了? 不要忘了:这个工具是有通用性的,不止是 sql*plus
能够这样用,其他类似的命令行程式也能如此的.
参考内容:
uniread的站点 http://sourceforge.net/projects/uniread
gnu readline http://www.gnu.org/directory/readline.html "the readline library provides a set of functions for use by applications that allow users to edit
command lines as they are typed in."
现在还算万能的google http://www.google.com
原文出处:
<a href="http://www.dbanotes.net/oracle/uniread-howto.htm">http://www.dbanotes.net/oracle/uniread-howto.htm</a>
相关文章推荐
- 利用uniread 解决 Linux下的SQL*Plus 命令行历史回调功能
- 利用uniread 解决 Linux下的SQL*Plus 命令行历史回调功能
- 利用uniread 解决 Linux下的SQL*Plus 命令行历史回调功能
- [Oracle] 利用Uniread 解决 Linux下的SQL*Plus 命令行历史回调功能
- 利用uniread解决下的SQL*Plus命令行历史回调功能
- 解决Linux下Oracle SQL*Plus命令行历史回调功能
- 解决Linux下SQL*Plus命令行历史回调功能
- 解决Linux下Oracle SQL*Plus命令行历史回调功能
- 解决Linux下SQL*Plus历史回调功能
- 安装rlwrap解决linux下sqlplus提供浏览历史命令行的功能
- rlwrap: command not found和解决linux下sqlplus 提供浏览历史命令行的功能
- 解决Linux下SQL*Plus历史回调功能
- 让Linux下的SQL*Plus具有历史回调功能
- 转:linux下sqlplus的历史sql回调功能实现方法
- 配置linux下oracle sqlplus/rman等历史记录回调功能
- 利用rlwrap配置linux下oracle sqlplus 历史记录回调
- 配置linux下oracle sqlplus/rman等历史记录回调功能
- 在linux下使SQLPLUS历史回调功能
- 配置linux下oracle sqlplus/rman等历史记录回调功能
- 让Linux下的SQL*Plus具有历史回调功能