免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 881 | 回复: 0
打印 上一主题 下一主题

利用Uniread 解决 Linux下的SQL*Plus 命令行历史回调功能 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-03-28 11:55 |只看该作者 |倒序浏览
通过Uniread 解决没有命令历史回调的功能

uniread - universal readline
- adds full readline support (command editing, history, etc.) to any existing interactive command-line program. Common examples are Oracle's sqlplus or jython. uniread will work on any POSIX platform with Perl.
可以看出,该工具可以对任何既有的交互命令行程序都可提供完备的readline支持.
一下载工具
1、readline-5.2.tar.gz
wget -c
ftp://ftp.cwru.edu/pub/bash/readline-5.2.tar.gz
2、IO-Tty-1.07.tar.gz
wget -c
http://ftp.cuhk.edu.hk/pub/packages/perl/CPAN/authors/id/H/HA/HAYASHI/Term-ReadLine-Gnu-1.17a.tar.gz
3、Term-ReadLine-Gnu-1.17a.tar.gz
wget -c
http://ftp.cuhk.edu.hk/pub/packages/perl/CPAN/authors/id/R/RG/RGIERSIG/IO-Tty-1.07.tar.gz
4、uniread-1.01.tar.gz
wget -c
http://downloads.sourceforge.net/uniread/uniread-1.01.tar.gz?modtime=1052179200&big_mirror=0
二安装:
1、 tar -zxvf readline-5.2.tar.gz
./configure
make
make install
2、tar -zxvf IO-Tty-1.07.tar.gz
cd IO-Tty-1.07
perl Makefile.PL
make
make install
3、tar -zxvf Term-ReadLine-Gnu-1.17a.tar.gz
cd Term-ReadLine-Gnu-1.17
perl Makefile.pl
make
make install
4、tar -zxvf uniread-1.01.tar.gz
cd uniread-1.01
perl Makefile.pl
make
make install
安装前要有perl 编译器
三使用
su - oracle
[oracle@rac1 ~]$ uniread sqlplus /nolog
[uniread] Loaded history (6 lines)
SQL*Plus: Release 11.1.0.6.0 - Production on Fri Mar 28 11:53:17 2008
Copyright (c) 1982, 2007, Oracle.  All rights reserved.
SQL>
SQL> conn /as sysdba
Connected.
SQL> show parameter sga
SQL> show parameter sga 通过上下键实现回调
这个工具是有通用性的,不止是 SQL*Plus 可以这样用,其他类似的命令行程序也能如此的.
四 FQA
如果要删除命令行历史,可以简单的用如下操作即可:
  rm -rf .uniread/



本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/21174/showart_510537.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP