這裏用到的工具就是rlwrapsql
能夠在此連接進行了解http://utopia.knoware.nl/~hlub/uck/rlwrap/ bash
wget http://utopia.knoware.nl/~hlub/uck/rlwrap/rlwrap-0.42.tar.gz oracle
yum install -y readline readline-devel 這是所依賴的ide
tar xf rlwrap-0.42.tar.gz工具
cd rlwrap-0.42get
固然在編譯以前能夠查看一下readme和installit
./configure && make && make installio
而後切換到oracle用戶
編譯
su - oracleclass
[oracle@oracle alert]$ rlwrap sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Tue Oct 18 09:13:15 2016
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> show user;
USER is "SYS"
SQL> exit
爲了更好的結合使用,去掉rlwrap,直接使用sqlplus / as sysdba
因而在家目錄作個別名就行
echo "alias sqlplus='rlwrap sqlplus'" >> /home/oracle/.bash_profile
source /home/oracle/.bash_profile
至此大功告成