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:
|
|
Get the Complete
Oracle SQL Tuning Information
The landmark book
"Advanced Oracle
SQL Tuning The Definitive Reference" is
filled with valuable information on Oracle SQL Tuning.
This book includes scripts and tools to hypercharge Oracle 11g
performance and you can
buy it
for 30% off directly from the publisher.
|