RLWRAP SQL*PLUS to have BASH like Functionality in SQLPLUS

So you are an Oracle DBA and have got used to the luxury of BASH shell in nix systems. Where you can scroll up and down and commands from a time long forgotten magically appear. Wouldn’t it be wonderful to have a similar thing for good ole sqlplus. Well here’s how you do it, via an excellent utility on linux called rlwrap.
1. Download rlwrap from this location : http://utopia.knoware.nl/~hlub/uck/rlwrap/
Incase above URL is not available, you can refer the steps in this link to install rlwrap
https://www.pythian.com/blog/rlwrap-utility-dba/
2. untar to a directory and compile the utility

tar xvf rlwrap-0.42.tar.gz

cd rlwrap-0.42

./configure

make

make install

3. Login with Oracle user and add the below alias to your bash profile

alias sqld='rlwrap sqlplus "/as sysdba"'

4. Login with sqld command (which is an alias by wrapping sqlplus using rlwrap, you can do this manually as well)

And happily scroll up and down through the sqlplus command line.

 For manually doing it

$ rlwrap sqlplus

Enjoy !

Category: BashLinux

Tags:

Leave a Reply

Article by: Shadab Mohammad