Linux命令行中,上下键能调出命令执行的历史,sqlplus却不行。rlwrap就是这样一个软件,能使sqlplus拥有linux命令行的功能
http://utopia.knoware.nl/~hlub/rlwrap/
rlwrap
rlwrap is a wrapper that uses the GNU readline library to allow the editing of keyboard input for any other command. Input history is kept between invocations, separately for each command; history completion and search work as in bash and completion word lists can be specified on the command line.
rlwrap compiles and runs on most Unix(-like) systems, including cygwin.
-
rlwrap-0.37.tar.gz (248 k)
wget http://utopia.knoware.nl/~hlub/rlwrap/rlwrap-0.37.tar.gz
tar -zxvf rlwrap-0.37.tar.gz
cd rlwrap-0.37
yum -y install readline-devel
./configure && make && make install
cat >> ~oracle/.bash_profile << eof
alias sqlplus='rlwrap sqlplus'
alias rman='rlwrap rman'
alias rman='rlwrap lsnrctl'
eof
su - oracle
sqlplus / as sysdba
enjoy it!!!

本文介绍了如何通过安装rlwrap软件来增强SQLPLUS的命令行功能,使其具备Linux命令行中常见的历史命令调用、编辑输入、历史完成和搜索等功能。详细步骤包括使用root用户登录,下载并安装rlwrap,配置.bash_profile文件以实现别名,最后以oracle用户登录并使用SQLPLUS体验增强后的功能。
1万+

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



