ITPub博客

首页 > 应用开发 > IT综合 > rlwrap

rlwrap

原创 IT综合 作者:wmlm 时间:2012-05-15 11:21:46 0 删除 编辑

rlwrap for Command Line History and Editing in SQL*Plus and RMAN on Linux.

linux下安装后,用着确实方便。AIX下能用吗?

[@more@]

http://www.oracle-base.com/articles/linux/rlwrap.php

The rlwrap (readline wrapper) utility provides a command history and editing of keyboard input for any other command. This is a really handy addition to SQL*Plus and RMAN on Linux. This article explains how to install rlwrap and set it up for SQL*Plus and RMAN. Thanks for Lutz Hartmann for reminding me of this utility.

Download the latest rlwrap software from the following URL.

Unzip and install the software using the following commands.

gunzip rlwrap*.gz
tar -xvf rlwrap*.tar
cd rlwrap*
./configure
make
make check
make install

Run the following commands, or better still append then to the ".bash_profile" of the oracle software owner.

alias rlsqlplus='rlwrap sqlplus'
alias rlrman='rlwrap rman'

You can now start SQL*Plus or RMAN using "rlsqlplus" and "rlrman" respectively, and you will have a basic command history and the current line will be editable using the arrow and delete keys.

Thanks to Laurent Schneider for pointing out the potential dangers of using alias names of "sqlplus" and "rman", which include:

  • rlwrap may affect the behaviour of CTRL+C during interactive sessions. I've done a few tests on this and I can't see a difference in behavior of CTRL+C with or without rlwrap. Perhaps this was a problem with earlier versions.
  • rlwrap only supports interactive sessions, so scripts like the following may not work as expected.

    sqlplus <

    From what I can see the alias doesn't seem to work from within a shell script (bash, ksh or csh), so it doesn't really present a danger. Thanks Maxim for putting me on to this.

  • rlwrap is not an Oracle tool! I guess it's best to leave the sqlplus and rman commands clean and alias using a different name, just in case.

Hope this helps. Regards Tim...

----------------------------------------------------------------------------------------------
AIX6.1下的安装比较简单
[node1:root:/tmp/rpms]rpm -ivh gettext-0.10.40-1.aix5.1.ppc.rpm
gettext ##################################################
[node1:root:/tmp/rpms]rpm -ivh info-4.13a-2.aix5.1.ppc.rpm
warning: /opt/freeware/info/dir created as /opt/freeware/info/dir.rpmnew
info ##################################################
Please check that /etc/info-dir does exist.
You might have to rename it from /etc/info-dir.rpmsave to /etc/info-dir.
[node1:root:/tmp/rpms]
[node1:root:/tmp/rpms]
[node1:root:/tmp/rpms]rpm -ivh readline-6.2-3.aix5.1.ppc.rpm
readline ##################################################
[node1:root:/tmp/rpms]rpm -ivh rlwrap-0.37-1.aix5.1.ppc.rpm
rlwrap ##################################################
[node1:root:/tmp/rpms]


----------------------------------------------------------------------------------------------

AIX5.3下的安装稍微麻烦
需要以下18个rpm
gcc-4.6.3-2.aix5.3.ppc.rpm libffi-3.0.10-1.aix5.1.ppc.rpm
gcc-c++-4.6.3-2.aix5.3.ppc.rpm libgcc-4.6.3-2.aix5.3.ppc.rpm
gcc-cpp-4.6.3-2.aix5.3.ppc.rpm libgomp-4.6.3-2.aix5.3.ppc.rpm
gcc-gfortran-4.6.3-2.aix5.3.ppc.rpm libmpc-0.9-1.aix5.1.ppc.rpm
gettext-0.17-1.aix5.1.ppc.rpm libstdc++-4.6.3-2.aix5.3.ppc.rpm
glib2-2.30.3-1.aix5.1.ppc.rpm libstdc++-devel-4.6.3-2.aix5.3.ppc.rpm
gmp-5.0.5-1.aix5.1.ppc.rpm mpfr-3.1.0-1.aix5.1.ppc.rpm
info-4.13a-2.aix5.1.ppc.rpm expat-2.1.0-1.aix5.1.ppc.rpm
rlwrap-0.37-1.aix5.1.ppc.rpm readline-6.2-3.aix5.1.ppc.rpm

[ora:root:/tmp/rpms] oslevel -s
5300-11-01-0944

[ora:root:/tmp/rpms] ls
bash-4.2-6.aix5.1.ppc.rpm libgcc-4.6.3-2.aix5.3.ppc.rpm
expat-2.1.0-1.aix5.1.ppc.rpm libgomp-4.6.3-2.aix5.3.ppc.rpm
gcc-4.6.3-2.aix5.3.ppc.rpm libmpc-0.9-1.aix5.1.ppc.rpm
gcc-c++-4.6.3-2.aix5.3.ppc.rpm libstdc++-4.6.3-2.aix5.3.ppc.rpm
gcc-cpp-4.6.3-2.aix5.3.ppc.rpm libstdc++-devel-4.6.3-2.aix5.3.ppc.rpm
gcc-gfortran-4.6.3-2.aix5.3.ppc.rpm mpfr-3.1.0-1.aix5.1.ppc.rpm
gettext-0.17-1.aix5.1.ppc.rpm readline-6.2-3.aix5.1.ppc.rpm
glib2-2.30.3-1.aix5.1.ppc.rpm readline-devel-6.2-3.aix5.1.ppc.rpm
gmp-5.0.5-1.aix5.1.ppc.rpm rlwrap-0.37-1.aix5.1.ppc.rpm
info-4.13a-2.aix5.1.ppc.rpm xpdf-1.00-1.aix4.3.ppc.rpm.old
libffi-3.0.10-1.aix5.1.ppc.rpm


[ora:root:/tmp/rpms] ls gcc*.rpm lib*.rpm gmp*.rpm mpf*.rpm info*.rpm gettext*.rpm glib2*.rpm expat*.rpm
gcc-4.6.3-2.aix5.3.ppc.rpm libffi-3.0.10-1.aix5.1.ppc.rpm
gcc-c++-4.6.3-2.aix5.3.ppc.rpm libgcc-4.6.3-2.aix5.3.ppc.rpm
gcc-cpp-4.6.3-2.aix5.3.ppc.rpm libgomp-4.6.3-2.aix5.3.ppc.rpm
gcc-gfortran-4.6.3-2.aix5.3.ppc.rpm libmpc-0.9-1.aix5.1.ppc.rpm
gettext-0.17-1.aix5.1.ppc.rpm libstdc++-4.6.3-2.aix5.3.ppc.rpm
glib2-2.30.3-1.aix5.1.ppc.rpm libstdc++-devel-4.6.3-2.aix5.3.ppc.rpm
gmp-5.0.5-1.aix5.1.ppc.rpm mpfr-3.1.0-1.aix5.1.ppc.rpm
info-4.13a-2.aix5.1.ppc.rpm expat-2.1.0-1.aix5.1.ppc.rpm

[ora:root:/tmp/rpms] rpm -ivh expat-2.1.0-1.aix5.1.ppc.rpm
expat ##################################################

[ora:root:/tmp/rpms] rpm -Uvh gcc*.rpm lib*.rpm gmp*.rpm mpf*.rpm info*.rpm gettext*.rpm glib2*.rpm --nodeps
libgcc ##################################################
libffi ##################################################
glib2 ##################################################
gettext ##################################################
warning: /opt/freeware/info/dir created as /opt/freeware/info/dir.rpmnew
info ##################################################
Please check that /etc/info-dir does exist.
You might have to rename it from /etc/info-dir.rpmsave to /etc/info-dir.
gcc ##################################################
gcc-c++ ##################################################
gcc-cpp ##################################################
gcc-gfortran ##################################################
libgomp ##################################################
libmpc ##################################################
libstdc++ ##################################################
libstdc++-devel ##################################################
gmp ##################################################
mpfr ##################################################
[ora:root:/tmp/rpms]

[ora:root:/tmp/rpms] rpm -ivh rlwrap-0.37-1.aix5.1.ppc.rpm readline-6.2-3.aix5.1.ppc.rpm
rlwrap ##################################################
readline ##################################################
[ora:root:/tmp/rpms]

找不到需要的包,看这里:
http://www.perzl.org/aix/index.php?n=Main.Gettext

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/271063/viewspace-1058222/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: extend root dir
下一篇: plsql tnsnames
请登录后发表评论 登录
全部评论

注册时间:2008-04-08

  • 博文量
    398
  • 访问量
    3716772