安装完rlwrap软件包之后,修改sqlplus命令的别名

[oracle@up ~]$ vim .bashrc

alias sqlplus='rlwrap sqlplus'

alias sql='rlwrap sqlplus'

alias lsnrctl='rlwrap lsnrctl'

alias rman='rlwrap rman'


登录数据库无法登录

[oracle@up ~]$ sqlplus / as sysdba

rlwrap: error while loading shared libraries: libreadline.so.5: cannot open shared object file: No such file or directory


没有找到libreadline.so.5库,需安装libreadline.so.5

安装库文件

[root@up Packages]# yum install compat-readline5 -y

安装之后再登录数据库

[oracle@up ~]$ sqlplus / as sysdba

rlwrap: error while loading shared libraries: libtermcap.so.2: cannot open shared object file: No such file or directory


缺少libtermcap.so.2库,安装compat-libtermcap包:

[root@up Packages]# yum install compat-libtermcap -y


安装完之后,再次登录

[root@up Packages]# su - oracle

[oracle@up ~]$ sqlplus / as sysdba


SQL*Plus: Release 11.2.0.1.0 Production on Sun Nov 1 15:39:54 2015


Copyright (c) 1982, 2009, Oracle.  All rights reserved.


Connected to an idle instance.


SQL>

登录成功