方法一sql
在Linux下面使用sqlplus默认不能够使用上下键查找历史命令,使用起来很不方便,影响效率。不过,能够经过第三方工具rlwrap来解决这个问题。vim
rlwrap下载:http://utopia.knoware.nl/~hlub/uck/rlwrap/bash
1、安装readlineoracle
能够经过yum这个工具来完成工具
[root@rhel6 ~]# yum -y install readline*spa
若是没有源,能够本身下载相关的安装包,而后经过rpm安装.net
[root@rhel6 ~]# rpm -Uvh readline* error: Failed dependencies: libtermcap-devel is needed by readline-devel-5.1-1.1.i386.rpm [root@rhel6 ~]# rpm -Uvh libtermcap-devel-2.0.8-46.1.i386.rpm [root@rhel6 ~]# rpm -Uvh readline* package readline-5.1-1.1 is already installed [root@rhel6 ~]# rpm -Uvh readline-devel-5.1-1.1.i386.rpm
2、安装rlwrapcode
下载安装包rlwrap-0.37.tar.gz到~目录下orm
[root@rhel6 ~]# tar -zxvf rlwrap-0.37.tar.gzci
[root@rhel6 ~]# cd rlwrap-0.37
[root@rhel6 rlwrap-0.37]# ./configure
[root@rhel6 rlwrap-0.37]# make
[root@rhel6 rlwrap-0.37]# make install
[root@rhel6 rlwrap-0.37]# man rlwrap
到这里rlwrap就装好了。。。
3、设置rlwrap
[root@rhel6 rlwrap-0.37]# vim /home/oracle/.bash_profile
添加
stty erase ^H #解决backspace删除键出现^H的问题 alias sqlplus='/usr/local/bin/rlwrap sqlplus' alias rman='/usr/local/bin/rlwrap rman'
OK,如今Linux下的SQL Plus能够像Windows下的那样使用了