红联Linux门户
Linux帮助

使sqlplus/rman可以直接修改命令和查看命令历史

发布时间:2008-02-04 01:10:28来源:红联作者:qtsmy
使Unix下的sqlplus/rman也像windows下sqlplus/rman命令一样,可以通过左右箭头修改命令,通过上下箭头查看命令历史。
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 <End
文章评论

共有 0 条评论