作用
sqlplus 操作自如
防止文章被销,不再上上传任何连接。。。。。。。。
安装
- 解压、执行、配置 ,只需要三步
[root@oracle vmwareshare]# tar -xzf rlwrap-0.45.1.tar.gz
[root@oracle vmwareshare]# mv rlwrap /usr/local/rlwrap
[root@oracle vmwareshare]# cd /usr/local/rlwrap/
[root@oracle rlwrap]# ./configure -q
[root@oracle ~]# make && make install
##如下添加别名即可使用,注意切换用户
[oracle@oracle ~]$ vim ~/.bash_profile
[oracle@oracle ~]$ vim ~/.bashrc
[oracle@oracle ~]$ cat .bashrc|grep sql
[oracle@oracle ~]$ source ~/.bashrc
alias sql='rlwrap sqlplus / as sysdba'
alias sqlplus='rlwrap sqlplus'
alias rman='rlwrap rman'
报错处理
- 报错1:执行configure文件报错
[root@fgedu178 rlwrap]# ./configure -q
configure: WARNING: No termcap nor curses library found
configure: error:
You need the GNU readline library(ftp://ftp.gnu.org/gnu/readline/ ) to build
this program!
[root@fgedu178 rlwrap]# yum -yq install readline*
##报错:(如果成功是可以往下走的)
Total download size: 850 k
Installed size: 2.4 M
Downloading packages:
Error downloading packages:
ncurses-devel-5.9-14.20130511.el7_4.x86_64: [Errno 256] No more mirrors to try.
readline-devel-6.2-11.el7.x86_64: [Errno 256] No more mirrors to try.
##这种情况检查yum的挂载、清理yum
[root@fgedu178 rlwrap]# yum clean all
- 报错2:不存在configure文件
##INSTALL 文件里有说明:
##autoreconf --install # only needed if there is no ./configure script
[root@oracle rlwrap]# autoreconf --install
configure.ac:32: installing `tools/config.guess'
configure.ac:32: installing `tools/config.sub'
configure.ac:34: installing `tools/install-sh'
configure.ac:34: installing `tools/missing'
src/Makefile.am: installing `tools/depcomp'
##之后就有configure可执行文件了
- 报错3:autoreconf命令执行报错
##在linux做编译安装时,发现没有autoreconfig。使用以下命令进行安装:
##通过拷贝来的源码,在配置文件中保留原来的配置,所以需要使用autoreconf来更新已经生成的配置文件
[root@oracle rlwrap]# yum install autoconfig automake libtool
[root@oracle rlwrap]# autoreconf -h
- 配置yum环境、挂载文件:
[root@fgedu178 ~]# mkdir /mnt/linux
[root@fgedu178 ~]# mount /dev/cdrom /mnt/linux
# 输出:mount: /dev/sr0 is write-protected, mounting read-only
# 原因是光驱没有挂载
[root@fgedu178 ~]# cd /etc/yum.repos.d
[root@fgedu178 yum.repos.d]# mkdir bk
[root@fgedu178 yum.repos.d]# mv *.repo bk/
[root@fgedu178 yum.repos.d]# echo "[EL]" >> /etc/yum.repos.d/itpux.repo
[root@fgedu178 yum.repos.d]# echo "name=Linux 7.x DVD" >> /etc/yum.repos.d/itpux.repo
[root@fgedu178 yum.repos.d]# echo "baseurl=file:///mnt/linux" >> /etc/yum.repos.d/itpux.repo
[root@fgedu178 yum.repos.d]# echo "gpgcheck=0" >> /etc/yum.repos.d/itpux.repo
[root@fgedu178 yum.repos.d]# echo "enabled=1" >> /etc/yum.repos.d/itpux.repo
[root@fgedu178 yum.repos.d]# cat /etc/yum.repos.d/itpux.repo