【Linux】Linux环境下Oracle SqlPlus中方向键问题的解决方法

来源:互联网 发布:加密锁软件下载 编辑:程序博客网 时间:2024/06/05 14:27

问题描述:在Linux系统下安装好Oracle之后,在使用Sqlplus时发现,不能正常使用上下左右方向键及退格键了,仅在屏幕上显示^[[A^[[B^[[C^[[D。

解决方法:需要安装一个rlwrap包。 rlwrap是一个基于GNU readline library的工具,可以增强Linux中的Sqlplus命令行功能,
能够使一些普通的命令行(比如Oracle中的Sqlplus、Rman等)具有历史输入回溯和错误回退修正的增强功能。
下载完rpm安装包后,以root用户进行安装。

1、下载地址:(For CentOS7)
http://rpm.pbone.net/index.php3/stat/4/idpl/30448081/dir/centos_7/com/rlwrap-0.42-1.1.x86_64.rpm.html

选择其他适合版本:
http://rpm.pbone.net/index.php3?stat=3&search=rlwrap&srodzaj=3

基本信息如下:
rlwrap rpm build for : CentOS 7

Name : rlwrap-0.42-1.1.x86_64.rpm
Version : 0.42 Vendor : obs://build_opensuse_org/home:Ledest:misc
Release : 1.1 Date : 2015-01-11 17:25:51
Group : Productivity/Other Source RPM : rlwrap-0.42-1.1.src.rpm
Size : 0.17 MB
Packager : (none)
Summary : A Readline Wrapper
Description :
rlwrap uses the GNU readline library to allow the editing of keyboard input for
any other command. The input history is remembered across invocations, separately
for each command;history completion and search work as in bash and completion
word lists can be specified on the command line.

RPM found in directory: /mirror/ftp5.gwdg.de/pub/opensuse/repositories/home:/Ledest:/misc/CentOS_7/x86_64

Content of RPM Changelog Provides Requires
Download
ftp.gwdg.de rlwrap-0.42-1.1.x86_64.rpm
ftp.pbone.net rlwrap-0.42-1.1.x86_64.rpm

2、以root用户进行安装
此RPM 包 可以直接安装,不需要其他依赖包。
这里写图片描述

3、使用方法

rlwrap sqlplus

也可将其添加到别名中
编辑oracle用户下的.bash_profile
增加以下两行:

alias sqlplus=’rlwrap sqlplus’
alias rman=’rlwrap rman’

保存退出后执行以下命令立即启用即可。
. .bash_profile

阅读全文
0 0