Linux下SQLPLUS替代工具rlwrap安装使用
rlwrap工具可以解决linux下sqlplus 提供浏览历史命令行的功能,和删除先前输入错误的字母等问题
1.安装
需要readline包 这个安装光盘就有
[root@asm RedHat]# cd RPMS/
[root@asm RPMS]# rpm -Uvh readline*
warning: readline-4.3-13.i386.rpm: V3 DSA signature: NOKEY, key ID db42a60e
error: Failed dependencies:
libtermcap-devel is needed by readline-devel-4.3-13.i386
Suggested resolutions:
/var/spool/up2datelibtermcap-devel-2.0.8-39.i386.rpm
[root@asm RPMS]# rpm -Uvh libtermcap-devel-2.0.8-39.i386.rpm
warning: libtermcap-devel-2.0.8-39.i386.rpm: V3 DSA signature: NOKEY, key ID db42a60e
Preparing... ########################################### [100%]
1:libtermcap-devel ########################################### [100%]
[root@asm RPMS]# rpm -Uvh readline*
warning: readline-4.3-13.i386.rpm: V3 DSA signature: NOKEY, key ID db42a60e
Preparing... ########################################### [100%]
package readline-4.3-13 is already installed
[root@asm RPMS]# rpm -Uvh readline-devel-4.3-13.i386.rpm
warning: readline-devel-4.3-13.i386.rpm: V3 DSA signature: NOKEY, key ID db42a60e
Preparing... ########################################### [100%]
1:readline-devel ########################################### [100%]
安装rlwrap包
rlwrap-0.28.tar.gz下载地址:http://utopia.knoware.nl/~hlub/uck/rlwrap/
[root@asm oracle]# tar -zxvf rlwrap-0.28.tar.gz
[root@asm oracle]# cd rlwrap-0.28
[root@asm rlwrap-0.28]# ls
aclocal.m4 bash30-005.patch ChangeLog config.h.in configure.ac distribution INSTALL Makefile.in README test tools
AUTHORS BUGS completions configure COPYING doc Makefile.am NEWS src TODO
[root@asm rlwrap-0.28]# ./configure
[root@asm rlwrap-0.28]# make
[root@asm rlwrap-0.28]# make install
[root@asm rlwrap-0.28]# rlwrap
Usage: rlwrap [options] command ...
Options:
-a[password:] --always-readline[=password:]
-b <chars> --break_chars=<chars>
-c --complete-filenames
-C <name|N> --command-name=<name|N>
-D <0|1|2> --history-no-dupes=<0|1|2>
-f <completion list> --file=<completion list>
-F <format string> --history-format=<format string>
-h --help
-H <file> --history-filename=<file>
-i --case-insensitive
-l <file> --logfile=<file>
-n --no-warnings
-P <input> --pre-given=<input>
-m[newline substitute] --multi-line[=newline substitute]
-r --remember
-v --version
-s <N> --histsize=<N> (negative: readonly)
bug reports, suggestions, updates:
http://utopia.knoware.nl/~hlub/uck/rlwrap/
[root@asm rlwrap-0.28]# vi /home/oracle/.bash_profile 加入下面两句
alias sqlplus='rlwrap sqlplus'
alias rman='rlwrap rman'
linux sqlplus 下就能和cmd 下sqlplus 正常操作了
------------------------------------------------
Dylan Presents.
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 【译】Visual Studio 中新的强大生产力特性
· 张高兴的大模型开发实战:(一)使用 Selenium 进行网页爬虫
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构