- 背景:oracle的sqlplus还是那么难用,不知道为什么不打包解决这个上下键出不来历史命令的问题,留给用户,内核硬,就是猖狂。废话不多说。
- 20250318update:19C后sqlplus听来自Oracle的同事说有set history on, 就这。。。
- 安装rlwrap:
- 在线安装:sudo yum install rlwrap readline-devel.x86_64
- 离线安装:
- 下载解压rlwrap-0.46.1.tar.gz;
- 进入/tmp/database/rlwrap-0.46.1源码包
- /configure
checking for pty/tty type... checking for pty.h... yes
OPENPTY
configure: checking for pty ranges
checking for tgetent... no
checking for tgetent in -ltinfo... no
checking for tgetent in -lcurses... no
checking for tgetent in -lncurses... no
checking for tgetent in -ltermcap... no
configure: WARNING: No termcap nor curses library found
checking for readline in -lreadline... no
configure: error:
You need the GNU readline library(ftp://ftp.gnu.org/gnu/readline/ ) to build
this program!
出现缺少依赖库readline的错误,
解决方法:----》》》》》
首选 yum install readline-devel.x86_64
其次可以下载readline包进行编译,个人没有尝试。
接下来:----》》》》》
./configure
make
make install
然后设置环境变量----》》》》》
3, vi .bash_profile
#readline
alias sqlplus='rlwrap sqlplus'
alias rman='rlwrap rman'
alias lsnrctl='rlwrap lsnrctl'
. .bash_profile
可以上下翻飞了: