The rlwrap (readline wrapper) utility provides a command history and editing of keyboard input for any other command. This is a really handy addition to SQL*Plus and RMAN on Linux.
而rlwrap会用到readline包,首先要安装readline,然后安装rlwrap。
一、下载
二、安装(使用root登陆,平台是Solaris,其它类似)
install readline:
# gunzip readline-5.0.tar.gz
# tar xvf readline-5.0.tar
# cd readline-5.0
# ./configure
# make
# make install
install rlwrap:
# gunzip rlwrap-0.30.tar.gz
# tar xvf rlwrap-0.30.tar
# cd rlwrap-0.30
# ./configure
# make
# make check
# make install
三、使用
# rlwrap sqlplus user/pwd@testdb
# rlwrap rman target user/pwd@testdb
可以设别名放到.profile里,然后直接使用别名即可。
alias rlsqlplus='rlwrap sqlplus'
alias rlrman='rlwrap rman'
四、注意
rlwrap only supports interactive sessions, so scripts like the following may not work as expected:
sqlplus <

