Oracle使用sqlplus工具,很不方便,现使用rlwrap工具实现上下键切换历史命令,方便实用。
一、安装所需要包
yum install ncurses-devel -y
yum install readline-devel -y
二、解压及安装
tar -zxvf rlwrap-0.42.tar.gz
cd rlwrap-0.42/
./configure
如果出现以下提示,则configure成功:
Now do:
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
三、编辑用户环境变量
切换至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';
转载于:https://blog.51cto.com/chenchunjia/1966150
本文介绍如何通过rlwrap工具改善Oracle SQLPlus的用户体验,实现历史命令的上下键快速切换。首先安装所需依赖包ncurses-devel和readline-devel,然后解压并配置rlwrap。最后设置用户环境变量,通过alias命令将rlwrap与SQLPlus等工具关联起来。

1115

被折叠的 条评论
为什么被折叠?



