为了账号安全,请及时绑定邮箱和手机立即绑定

oracle sqlplus 回退键以及上下键

标签:
Oracle

Linux中安装完Oracle后,默认的 sqlplus 上下键是不能用的,安装了 rlwrap 之后就能通过上下键翻回历史命令了

  1. 下载地址

    https://github.com/hanslub42/rlwrap/releases

  2. 安装步骤

  • 安装readline 及 依赖

[root@ogg1 rlwrap-0.43]# yum install readline*已加载插件:fastestmirror, refresh-packagekit, security
设置安装进程
Loading mirror speeds from cached hostfile
包 readline-6.0-4.el6.x86_64 已安装并且是最新版本
解决依赖关系
--> 执行事务检查
---> Package readline-devel.x86_64 0:6.0-4.el6 will be 安装
---> Package readline-static.x86_64 0:6.0-4.el6 will be 安装
--> 完成依赖关系计算

依赖关系解决

===============================================================================================================================================================
 软件包                                      架构                               版本                                    仓库                              大小
===============================================================================================================================================================
正在安装: readline-devel                              x86_64                             6.0-4.el6                               base                             134 k readline-static                             x86_64                             6.0-4.el6                               base                             113 k

事务概要
===============================================================================================================================================================
Install       2 Package(s)

总下载量:248 k
Installed size: 790 k
确定吗?[y/N]:y
下载软件包:
(1/2): readline-devel-6.0-4.el6.x86_64.rpm                                                                                              | 134 kB     00:00     
(2/2): readline-static-6.0-4.el6.x86_64.rpm                                                                                             | 113 kB     00:00     ---------------------------------------------------------------------------------------------------------------------------------------------------------------
总计                                                                                                                           231 kB/s | 248 kB     00:01     运行 rpm_check_debug 
执行事务测试
事务测试成功
执行事务
  正在安装   : readline-devel-6.0-4.el6.x86_64                                                                                                             1/2 
  正在安装   : readline-static-6.0-4.el6.x86_64                                                                                                            2/2 
  Verifying  : readline-static-6.0-4.el6.x86_64                                                                                                            1/2 
  Verifying  : readline-devel-6.0-4.el6.x86_64                                                                                                             2/2 已安装:  readline-devel.x86_64 0:6.0-4.el6                                             readline-static.x86_64 0:6.0-4.el6                                            

完毕!
  • 上传、解压、编译、安装rlwrap

[root@ogg1 ~]# tar -zxvf rlwrap-0.43.tar.gz[root@ogg1 ~]# cd rlwrap-0.43[root@ogg1 rlwrap-0.43]# ./configure && make && make install
  • 配置shell

[root@ogg1 rlwrap-0.43]# su - oracle [oracle@ogg1 ~]$ vim .bash_profile

最后增加以下配置,使oracle相关命令都支持回退和上下键

alias sqlplus='rlwrap sqlplus'alias rman='rlwrap rman'alias lsnrctl='rlwrap lsnrctl'
  1. 其它问题

  • checking build system type...
    Invalid configuration x86_64-unknown-linux-': machinex86_64-unknown-linux'not recognized
    configure: error: /bin/sh tools/config.sub x86_64-unknown-linux- failed
    解决:需要安装GCC,执行命令:yum install -y gcc

  • You need the GNU readline library(ftp://ftp.gnu.org/gnu/readline/) to build this program!
    解决:需要安装libtermcap-devel,执行命令:yum install -y libtermcap-devel 实际上RLwrap的安装需要两个依赖包:readline和libtermcap-devel readline一般都会集成在Linux里,所以这里直接安装libtermcap-devel

  • bash: make: command not found
    解决:需要安装make,执行命令:yum install -y make*

 作者:每日懂一点

原文链接:https://www.cnblogs.com/lzxianren/p/oralce-sqlplus-backspace.html


点击查看更多内容
TA 点赞

若觉得本文不错,就分享一下吧!

评论

作者其他优质文章

正在加载中
  • 推荐
  • 评论
  • 收藏
  • 共同学习,写下你的评论
感谢您的支持,我会继续努力的~
扫码打赏,你说多少就多少
赞赏金额会直接到老师账户
支付方式
打开微信扫一扫,即可进行扫码打赏哦
今天注册有机会得

100积分直接送

付费专栏免费学

大额优惠券免费领

立即参与 放弃机会
意见反馈 帮助中心 APP下载
官方微信

举报

0/150
提交
取消