It is nice to have up arrow key working in sqlplus, rman, dgmgrl, adrci. But can this work.
YES !!! of course it can, I have tried it on Redhat.
Below are the steps to do this.
- Download the rlwrap package
- Install the package
- Create the .aliases file
- Modify .bashrc
- WALLAH !!!
Download the rlwrap package
Install the package
the installation is done using
su -
gunzip rlwrap*.gz
tar -xvf rlwrap*.tar
cd rlwrap*
./configure
make
make check
make install
Create the .aliases file
Added below lines in .aliases at oracle home directory in my case it was /home/oracle
alias adrci='/usr/local/bin/rlwrap $ORACLE_HOME/bin/adrci'
alias sqlplus='/usr/local/bin/rlwrap $ORACLE_HOME/bin/sqlplus'
alias dgmgrl='/usr/local/bin/rlwrap $ORACLE_HOME/bin/dgmgrl'
alias rman='/usr/local/bin/rlwrap $ORACLE_HOME/bin/rman'
Modify .bashrc
Modified the .bashrc file so that new .aliases is there. My file is
[oracle@o12c (cdb1) ~]$ cat .bashrc
# .bashrc
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
# User specific aliases and functions
if [ -f $HOME/.aliases ]
then
. $HOME/.aliases
fi
[oracle@o12c (cdb1) ~]$
WALLAH !!!
Once above is done then create a new oracle connection to unix server and you are done. The up arrow key will start working.