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';