签到成功

知道了

CNDBA社区CNDBA社区

rlwap的安装

2016-09-02 10:34 3865 0 原创 Linux
作者: Expect-乐

在Linux下使用sqlplus就不像windows那么上下键翻命令了。可以通过插件来解决rlwrap。

1.首先安装readline

http://www.cndba.cn/Expect-le/article/119

[root@rac2 opt]#  wget ftp://ftp.gnu.org/gnu/readline/readline-6.2.tar.gz
[root@rac2 opt]# tar -xzvf readline-6.2.tar.gz
[root@rac2 opt]# cd readline-6.2
[root@rac2 opt]# ./configure
[root@rac2 opt]#  make
[root@rac2 opt]#  make install

2.安装rlwrap

http://www.cndba.cn/Expect-le/article/119

[root@rac2 opt]#wget http://utopia.knoware.nl/~hlub/uck/rlwrap/rlwrap-0.42.tar.gz
[root@rac2 opt]# tar -xzvf rlwrap-0.42
[root@rac2 opt]# cd rlwrap-0.42
[root@rac2 opt]# ./configure
configure: error:

 http://www.cndba.cn/Expect-le/article/119http://www.cndba.cn/Expect-le/article/119

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

this program!

解决办法:

安装这个包

[root@rac2 opt]#
 yum install libtermcap-devel


下面继续安装rlwrap

http://www.cndba.cn/Expect-le/article/119

[root@rac2 rlwrap-0.42]# make
[root@rac2 rlwrap-0.42]# make install

搞定了。

http://www.cndba.cn/Expect-le/article/119

3.bash_profile中进行设置。http://www.cndba.cn/Expect-le/article/119

#vi .bash_profile
alias sqlplus="rlwrap sqlplus"
alias rman="rlwrap rman"

可能还会出现下面的错误

[oracle@rac2 ~]$ rlwrap sqlplus / as sysdba
rlwrap: error while loading shared libraries: libreadline.so.6: cannot open shared object file: No such file or directory

若没有安装readline则安装。要是安装了则修改一下http://www.cndba.cn/Expect-le/article/119

[root@rac2 readline-6.2]# cp /etc/ld.so.conf /etc/ld.so.conf.bak
[root@rac2 readline-6.2]# vi /etc/ld.so.conf

添加一行

/usr/local/lib


然后使其生效

[root@rac2 readline-6.2]# ldconfig


如果出现: 

http://www.cndba.cn/Expect-le/article/119

bash: ldconfig: command not found


则:root环境变量中加export PATH=/sbin

[oracle@rac2 ~]$ sqlplus / as sysdba 
SQL*Plus: Release 11.2.0.3.0 Production on Sat Sep 19 14:55:03 2015
Copyright (c) 1982, 2011, Oracle.  All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
SQL> dfsdf
SP2-0042: unknown command "dfsdf" - rest of line ignored.
SQL> dfsdf



http://www.cndba.cn/Expect-le/article/119

版权声明:本文为博主原创文章,未经博主允许不得转载。

用户评论
* 以下用户言论只代表其个人观点,不代表CNDBA社区的观点或立场
Expect-乐

Expect-乐

关注

Without the continuous bitter cold, there can be no fragrant plum blossom

  • 336
    原创
  • 6
    翻译
  • 100
    转载
  • 41
    评论
  • 访问:1566985次
  • 积分:1957
  • 等级:核心会员
  • 排名:第4名
精华文章
    最新问题
    查看更多+
    热门文章
      热门用户
      推荐用户
        Copyright © 2016 All Rights Reserved. Powered by CNDBA · 皖ICP备2022006297号-1·

        QQ交流群

        注册联系QQ