openGauss的gsql需要加参数"-r"才能支持上下翻命令和自动补全。
gsql -d postgres -p 15400 -r
oracle的sqlplus也不支持上下翻命令和自动补全。
使用rlwrap可以实现上下翻命令,但是还是不能实现自动补全功能。
1、安装rlwrap,使oracle支持上下翻滚
root@node1 \~\]# yum install -y rlwrap Repository epel is listed more than once in the configuration 上次元数据过期检查:1:53:17 前,执行于 2023年08月23日 星期三 16时58分47秒。 依赖关系解决。 ===================================================================================================================================================================== 软件包 架构 版本 仓库 大小 ===================================================================================================================================================================== 安装: rlwrap x86_64 0.46.1-1.el8 epel 139 k 安装依赖关系: perl-File-Slurp noarch 9999.19-19.el8 AppStream 47 k 事务概要 ===================================================================================================================================================================== 安装 2 软件包 总下载:185 k 安装大小:426 k 下载软件包: (1/2): perl-File-Slurp-9999.19-19.el8.noarch.rpm 363 kB/s \| 47 kB 00:00 (2/2): rlwrap-0.46.1-1.el8.x86_64.rpm 952 kB/s \| 139 kB 00:00 --------------------------------------------------------------------------------------------------------------------------------------------------------------------- 总计 1.1 MB/s \| 185 kB 00:00 运行事务检查 事务检查成功。 运行事务测试 事务测试成功。 运行事务 准备中 : 1/1 安装 : perl-File-Slurp-9999.19-19.el8.noarch 1/2 安装 : rlwrap-0.46.1-1.el8.x86_64 2/2 运行脚本: rlwrap-0.46.1-1.el8.x86_64 2/2 /sbin/ldconfig: /usr/local/lib64/libstdc++.so.6.0.26-gdb.pyc 不是 ELF 文件 - 起始处的魔数有误。 /sbin/ldconfig: /usr/local/lib64/libstdc++.so.6.0.26-gdb.pyo 不是 ELF 文件 - 起始处的魔数有误。 验证 : perl-File-Slurp-9999.19-19.el8.noarch 1/2 验证 : rlwrap-0.46.1-1.el8.x86_64 2/2 Installed products updated. 已安装: perl-File-Slurp-9999.19-19.el8.noarch rlwrap-0.46.1-1.el8.x86_64 完毕!
2、测试
oracle@node1 \~\]$ rlwrap sqlplus /nolog SQL\*Plus: Release 19.0.0.0.0 - Production on 星期三 8月 23 18:53:27 2023 Version 19.3.0.0.0 Copyright (c) 1982, 2019, Oracle. All rights reserved. SQL\> connect sys as sysdba 输入口令: 已连接到空闲例程。 SQL\> select \* from zzy; select \* from zzy \* 第 1 行出现错误: ORA-01034: ORACLE not available