在Linux下面使用sqlplus很不方便,上下键,退格键都不能用,严重降低生产效率。
而rlwrap可以解决此问题!
下载rlwrap:http://download.csdn.net/detail/sharqueen/5433087
一:安装readline(安装相应的rpm包)
OS的安装光盘里提供了readline包.
[root@oracle11g ~]# rpm -Uvh readline*
error: Failed dependencies:libtermcap-devel is needed by readline-devel-5.1-1.1.i386.rpm
[root@oracle11g ~]# rpm -Uvh libtermcap-devel-2.0.8-46.1.i386.rpm
[root@oracle11g ~]# rpm -Uvh readline*
package readline-5.1-1.1 is alreadyinstalled
[root@oracle11g ~]# rpm -Uvh readline-devel-5.1-1.1.i386.rpm
二:安装rlwrap
[root@oracle11g ~]# tar -zxvf rlwrap-0.30.tar.gz
[root@oracle11g ~]# cd rlwrap-0.30
[root@oracle11g rlwrap-0.30]# ./configure
checking build system type...x86_64-unknown-linux-gnu
checking host system type...x86_64-unknown-linux-gnu
………
configure: creating ./config.status
config.status: creating Makefile
config.status: creating doc/Makefile
config.status: creating src/Makefile
config.status: creating doc/rlwrap.man
config.status: creatingdistribution/rlwrap.spec
config.status: creating config.h
config.status: executing depfiles commands
Now do:
make (or gmake) to build rlwrap
make check for instructionshow to test it
make install to install it
[root@oracle11g rlwrap-0.30]# make
[root@oracle11g rlwrap-0.30]# make install
三:方便使用rlwrap
[root@oracle11g rlwrap-0.30]# vi /home/oracle/.bash_profile
添加
alias sqlplus='rlwrap sqlplus'
alias rman='rlwrap rman'
之后再用命令sqlplus / as sysdba 连接数据库时就会调用rlwrap这个工具,使得Linux下的SQL Plus可以像Windows下的那样使用了。