Last change 09.04.2013
Deutsche Version

rlwrap_ext


rlwrap-ext – an extension for rlwrap

Description

Using sqlplus, rman or any other Oracle command line tool combined with rlwrap can be even more convenient - rlwrap is full of some fancy features, e.g. command line completion. You type the keys sel and when pressing the tab key rlwrap completes it to SELECT.

Does not sound spectacular?
It isn't, anyway, but quite useful. That´s the way rlwrap can do completion on the following things:

To make it work, you have to follow those steps:

  1. provide rlwrap with a file (maybe several files) containig all those nice keywords and
  2. tell rlwrap the delimiters for words. Since the readline Library was written for bash, it acknowledges by default the characters $ and # as word delimiters - which is wrong for SQL. So I wrote a script named sql+ to repair that. It is also in each package.

Download

You can download my extensions for three Oracle Versions:

All you have to do is: untar the package into /usr/local/share/rlwrap/completionsand put the scripts sql+ and asm+ somewhere into your path, like /usr/local/bin. That's it.

Which Version?

I created rlwrap-extensions for Oracle version 9i, 10g and 11g. They differ only in view names / packages names etc in the keyword lists. Since rlwrap does not care to which Oracle version it is talking to, it does not matter to use rlwrap-extensions for a different Oracle Version.

If in doubt, take the newest version.

Using asmcmd, adrci and rman with rlwrap-extensions

When calling rman, adrci or asmcmd with rlwrap, use the switch -i to force rlwrap into case-insensitive mode. Just like sqlplus, those commands use case insensitive keywords. In case of asmcmd you might use asm+ (also supplied) to use all features of the extensions.