歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Unix知識 >> 關於Unix >> 使sqlplus/rman可以直接修改命令和查看命令歷史

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

日期:2017/2/28 11:12:35   编辑:關於Unix


使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
Copyright © Linux教程網 All Rights Reserved