sqlplus + rlwrap 实现上下键功能

-- sqlplus 实现上下键功能

1  下载
wget "http://utopia.knoware.nl/~hlub/rlwrap/rlwrap-0.37.tar.gz"

 

2 编译
tar -xvf rlwrap-0.37.tar.gz
cd rlwrap-0.37
./configure && make && make check && make install

如果遇到报错信息:

checking for pty/tty type... checking pty.h usability... yes
checking pty.h presence... yes
checking for pty.h... yes
OPENPTY
configure: checking for pty ranges...
checking for tgetent... no
checking for tgetent in -lcurses... no
checking for tgetent in -lncurses... no
checking for tgetent in -ltermcap... no
configure: WARNING: No termcap nor curses library found
checking for readline in -lreadline... no
configure: error: 

You need the GNU readline library(ftp://ftp.gnu.org/gnu/readline/ ) to build
this program!

就需要安装2个rpm包,如下:

libtermcap-devel-2.0.8-46.1.i386.rpm
readline-devel-5.1-3.el5.i386.rpm


请去这里下载 :  http://download.csdn.net/detail/mchdba/7292927,下载完后rpm方式安装

rpm -ivh libtermcap-devel-2.0.8-39.x86_64.rpm  --nodeps --force

rpm -ivh readline-devel-4.3-13.x86_64.rpm  --nodeps --force


[root@localhost rlwrap-0.37]# oracle
[root@localhost rlwrap-0.37]# su - oracle

 

3  登陆需要加前缀
[oracle@localhost ~]$ rlwrap sqlplus / as sysdba
SQL>
select instance_name from v$instance;

你可能感兴趣的:(sqlplus + rlwrap 实现上下键功能)