Linux中Oracle的sqlplus下退格和Del键无效的问题解决
利用rlwrap工具解决方法
1、安装rlwrap和readline库
CentOS下可以用EPEL的yum源直接安装,步骤如下:
(1)RHEL/CentOS/SL Linux 6.x 下安装 EPEL6 yum源:
32位系统选择: | # rpm -ivh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm |
64位系统选择: | # rpm -ivh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm |
导入key: | # rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6 |
默认会在/etc/yum.repos.d/下创建epel.repo和epel-testing.repo两个配置文件。
(2)安装rlwrap和readline:
# | yum install rlwrap readline readline-devel |
readline在系统里有就不用另外下载了
# | tar zxvf readline-6.2.tar.gz |
# | cd readline-6.2/ |
# | ./configure |
# | make |
# | make install |
rlwrap的下载地址:https://files.cnblogs.com/killkill/rlwrap-0.30.tar.gz.zip
# | tar zxvf rlwrap-0.37.tar.gz |
# | cd rlwrap-0.37/ |
# | ./configure |
# | make |
# | make install |
(3)设置sqlplus的系统别名:
# | vim /home/oracle/.bash_profile |
| 在头部或尾部添加: alias sqlplus='rlwrap sqlplus' |
# | source /home/oracle/.bash_profile |
退出oracle用户再重新登录就ok。