SolveItproblems

SolveITProblems is a project of QFormat.net intellectual club

SolveITProblems это проект интеллектуального клуба QFormat.net

четверг, 2 октября 2014 г.

Up arrow & down arrow keys issue SQL Plus commands

Installing rlwrap

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.


Download the freeware rlwrap utility here

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


Also you can try using 'yum' command under Red Hat Linux OS. You should have Epel repository installed first:

yum install rlwrap

The rlwrap utility is a nice utility for command-line editing and an easy display of SQL*Plus command history.

Using rlwrap

After installation is complete you can use shown below command to launch SQL PLus:

rlwrap sqlplus


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'

For example for my own purposes i've edited .bashrc file of oracle's user in /home/oracle directory.

You may change alias to this one:

alias rlsqlplus='rlwrap sqlplus'

Or as i did:
alias sqlplus='rlwrap sqlplus'

So now the issue of "up arrow" and "down arrow" keys is solved (and instead of viewing such symbol as "^[[A") and history of commands in SQL PLus works fine. Good luck!


Комментариев нет:

Отправка комментария