Tuesday, 20 August 2013

How to use rlwrap(read line wrapper) to get command line history in sqlplus .

Manual Installation.

Download the latest rlwrap software from the following url

Copy the downloaded file to the /tmp or some other location

root@localhost oracle]# ls rlwrap-0.37\ \(2\).tar.gz 
rlwrap-0.37 (2).tar.gz

[root@localhost oracle]# tar -xvf rlwrap-0.37\ \(2\).tar.gz 

[root@localhost # cd rlwrap-0.37

[root@localhost rlwrap-0.37]# ls
AUTHORS  ChangeLog    Makefile.in  README      completions  configure.ac  src
BUGS INSTALL      NEWS   TODO        config.h.in  doc   test
COPYING  Makefile.am  PLEA   aclocal.m4  configure    filters   tools

[root@localhost rlwrap-0.37]# ./configure 

[root@localhost rlwrap-0.37]# make

[root@localhost rlwrap-0.37]# make install

oracle@localhost ~]$ rlwrap sqlplus

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

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

Pressing upper arrow in keyboard will get the past history in sqlplus...