Oracle使用sqlplus工具,很不方便,現使用rlwrap工具實現上下鍵切換歷史命令,方便實用。sql
1、安裝所須要包數據庫
yum install ncurses-devel -yvim
yum install readline-devel -ybash
2、解壓及安裝oracle
tar -zxvf rlwrap-0.42.tar.gz ide
cd rlwrap-0.42/
工具
./configureui
若是出現如下提示,則configure成功:spa
Now do:orm
make (or gmake) to build rlwrap
make check for instructions how to test it
make install to install it
make
make check
make install
# which rlwrap
/usr/local/bin/rlwrap
3、編輯用戶環境變量
切換至oracle用戶,在.bash_profile文件添加如下內容
su - oracle
vim ~/.bash_profile
alias sqlplus='rlwrap sqlplus';
alias rman='rlwrap rman';
使配置生效
source ~/.bash_profile
鏈接數據庫:sqlplus "/as sysdba"
便可使用
切換至grid用戶,在.bash_profile文件添加如下內容
su - grid
vim ~/.bash_profile
alias asmcmd='rlwrap asmcmd';