Question: I’ve been told that I need
to use the rlwrap utility with SQL*Plus. What is rlwrap and
how does it help me in SQL*Plus?
Answer:
One nice features of using SQL*Plus in Windows is that you can use
the
“up arrow” and down arrow” keys to display the command line history
for all SQL*Plus commands.
It's also possible to do this in Linux and UNIX (AIX, Solaris,
HP/UX) with the freeware rlwrap utility.
You can
download the
freeware rlwrap utility at this link.
The readline wrapper (rlwrap) utility uses the GNU readline library.
Hence, rlwrap is not Oracle-centric, it’s a standard OS utility
available for all flavors of UNIX, Linux and even Windows. The
rlwrap software installs easily on UNIX/Linux with these standard GNU unzip
and make commands:
gunzip rlwrap*.gz
tar -xvf rlwrap*.tar
cd rlwrap*
./configure
make
make check
make install
Aliasing rlwrap
Following the install, you use a standard UNIX alias in your
shell signon file (.cshrc for S shell, .bashrc for Bourne shell, or
.profile for Korn shell) to source-in the rlwrap utility, using a
different command name:
alias rl_sqlplus='rlwrap
sqlplus'
alias
rl_rman='rlwrap rman'
alias rl_asmcmd='rlwrap asmcmd'
Rampant author Laurent Schneider notes why you should never
use an alias over-ride of the default Oracle names of "sqlplus",
"asmcmd" or "rman":
Using rlwrap may affect the behavior 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. Note that rlwrap only supports
interactive sessions, so scripts like the following may not work as
expected.
sqlplus alias: 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.
Remember, 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.
Using rlwrap
The rlwrap utility is a nice utility for command-line editing
and an easy display of SQL*Plus command history.
Rampant
author Kamran Agayev Agamehdi shows how to install and use rlwrap on
Linux:
|
|
|
|
Guarantee your Success!
Oracle is the
world's most complex, robust and flexible database, considered
impossible to master without a mentor.
That's why all BC
Oracle trainers are working professionals, experts in Oracle who
share their tips and secrets. |
|
| |
|
Burleson is the American Team

Note:
This Oracle
documentation was created as a support and Oracle training reference for use by our
DBA performance tuning consulting professionals.
Feel free to ask questions on our
Oracle forum.
Verify
experience!
Anyone
considering using the services of an Oracle support expert should
independently investigate their credentials and experience, and not rely on
advertisements and self-proclaimed expertise. All legitimate Oracle experts
publish
their Oracle
qualifications.
Errata?
Oracle technology is changing and we
strive to update our BC Oracle support information. If you find an error
or have a suggestion for improving our content, we would appreciate your
feedback. Just
e-mail:
and include the URL for the page.
Copyright ? 1996 - 2012
All rights reserved.
Oracle ?
is the registered trademark of Oracle Corporation.
|
|