After running SQL statements in Linux sqlplus, you can use the up and down keys to find out the historical commands.
Follow the steps below to set
1. Download rlwrap from http://download.csdn.net/user/kkdelta
2. Install rlwrap
[root@localhost]# tar -zxvf rlwrap-0.30.tar.gz[root@localhost]# cd rlwrap-0.30[root@localhost rlwrap-0.30]# ./configure[root@localhost rlwrap-0.30]# make[root@localhost rlwrap-0.30]# make install[root@localhost rlwrap-0.30]# rlwrap
If you have the GNU Readline Library (ftp://ftp.gnu.org/gnu/readline/) to build this program! Error. You must install Yum-y install Readline *
3. Use rlwrap, rlwrap sqlplus/As sysdba
At this time, the familiar up/down key function is back.
4. Set the alias so that sqlplus runs in rlwrap by default.
[Root @ localhost
Rlwrap-0.30] # vi/home/Oracle/. bash_proFile
Add the following content
Alias sqlplus = 'maid sqlplus'
The alias definition uses single quotes instead of the one on the tab./home/Oracle/is the Oracle user's home directory.
The preceding settings require oracle users to log on again,
If the above settings do not work, you can set them in/home/Oracle/. bashrc so that alias will be set every time you change to bash.
Type
Sqlplus verification. If the following information is displayed, it indicates that the alias settings are successful.
Sqlplus
Is aliased to 'rlwrap sqlplus'