Search This Blog

Tuesday, January 5, 2016

rlwrap

rlwrap = ReadLine Wrapper

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.

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:

We can download rlwrap from the below link:

http://utopia.knoware.nl/~hlub/uck/rlwrap/

save the .gz file into /tmp folder
$cd /tmp

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


Now to use the rlwrap utility:

$rlwrap sqlplus / as sysdba

now up arrow and down arrow link work.



If we want to set this concept permanently in bash_profile, do the following:

vi /home/oracle/.bash_profile
alias rlsqlplus='rlwrap sqlplus / as sysdba'

now to execute the above full command just type:

$rlsqlplus

1 comment: