文档课题:安装rlwrap实现sql语句上下翻页左右移动功能.
系统:centos 7.9
数据库:oracle 11.2.0.4
安装包:rlwrap-0.42.tar.gz
1、安装包处理
sftp> lcd F:\package
sftp> cd /root
sftp> put rlwrap-0.42.tar.gz
# tar -zxf rlwrap-0.42.tar.gz
2、readline-devel
readline-devel包检查.
# yum -y install readline*
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
Package readline-6.2-11.el7.x86_64 already installed and latest version
Package readline-devel-6.2-11.el7.x86_64 already installed and latest version
Nothing to do
# yum list all|grep readline
readline.x86_64 6.2-11.el7 @anaconda
readline-devel.x86_64 6.2-11.el7 @local
3、安装rlwrap
# cd /root/rlwrap-0.42
# ./configure
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
……(省略若干)
# make
make all-recursive
make[1]: Entering directory `/root/rlwrap-0.42'
Making all in doc
make[2]: Entering directory `/root/rlwrap-0.42/doc'
sed -e 's#@DATADIR@#/usr/local/share#' rlwrap.man > rlwrap.1
make[2]: Leaving directory `/root/rlwrap-0.42/doc'
Making all in src
……(省略若干)
# make install
[oracle@hisdb1 ~]$ vi .bash_profile
按如下命名别名.
alias sas='rlwrap sqlplus / as sysdba'
alias rman='rlwrap rman'
[oracle@hisdb1 ~]$ source .bash_profile
4、验证结果
如下所示,sql语句使用左右键移动光标.