安装完rlwrap软件包之后,修改sqlplus命令的别名
[[email protected] ~]$ vim .bashrc
alias sqlplus=‘rlwrap sqlplus‘
alias sql=‘rlwrap sqlplus‘
alias lsnrctl=‘rlwrap lsnrctl‘
alias rman=‘rlwrap rman‘
登录数据库无法登录
[[email protected] ~]$ 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
安装库文件
[[email protected] Packages]# yum install compat-readline5 -y
安装之后再登录数据库
[[email protected] ~]$ 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包:
[[email protected] Packages]# yum install compat-libtermcap -y
安装完之后,再次登录
[[email protected] Packages]# su - oracle
[[email protected] ~]$ 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>
登录成功