Linux命令行中,上下键能调出命令执行的历史,sqlplus却不行。rlwrap就是这样一个软件,能使sqlplus拥有linux命令行的功能
http://utopia.knoware.nl/~hlub/rlwrap/
rlwrap
rlwrap
is a wrapper that uses the GNU readline library to allow the editing of keyboard input for any other command. Input history is kept between invocations, separately for each command; history completion and search work as in bash
and completion word lists can be specified on the command line.
rlwrap
compiles and runs on most Unix(-like) systems, including cygwin.
-
rlwrap-0.37.tar.gz (248 k)
wget http://utopia.knoware.nl/~hlub/rlwrap/rlwrap-0.37.tar.gz
tar -zxvf rlwrap-0.37.tar.gz
cd rlwrap-0.37
yum -y install readline-devel
./configure && make && make install
cat >> ~oracle/.bash_profile << eof
alias sqlplus='rlwrap sqlplus'
alias rman='rlwrap rman'
alias rman='rlwrap lsnrctl'
eof
su - oracle
sqlplus / as sysdba
enjoy it!!!