Beruflich Dokumente
Kultur Dokumente
A colleague of mine just asked me how do you get history in SQLPlus on Linux the same way
you get by default in windows, e.g. when you press the up key you see the previous commands
executed. I have never really given it much thought in the past, but there must be a way. After a
quick Google search I found a solution. This blog is really for my future reference as the
examples I found on the net required a bit of thought.
The post assumes you are using RedHat or OEL, It will work for other Linux OS but you will
need to source the right application. I'm installing on OEL 5.7 64 bit.
The key behind this solution is the utility call rlwrap which is a read line wrapper. It maintains a
separate input history which can be edited.
2. Download the rlwrap utility using the appropriate link below and save it to a staging area
on the Linux machine:
rlwrap 32Bit
rlwrap 64Bit
3. From the staging area install the rlwrap utility, e.g.:
4. Connect as the oracle user (or the user you connect to SQLPlus)
5. Edit the .bashrc file ($HOME/.bashrc) and add the following line in the aliases
section.
. .bashrc
sqlplus scott/tiger@orcl
COUNT(*)
----------
15