为了linux下的sqlplus方便调用历史命令和退格,安装下rlwrap,最新版本是0.43,貌似作者已经不更新了
下载地址 https://fossies.org/linux/privat/rlwrap-0.42.tar.gz/
下载后winscp传入到linux上,然后安装
添加一条别名sql到oracle用户的环境变量中并使之生效,测试后上下左右键在sqlplus中均良好使用,提升了一大截sqlplus中的代码体验
- [oracle@localhost ~]$ cat .bashrc|grep sql
- alias sql='rlwrap sqlplus / as sysdba'
- [oracle@localhost ~]$ . .bashrc
- [oracle@localhost ~]$ sql
-
- SQL*Plus: Release 11.2.0.1.0 Production on Tue Jul 30 09:41:05 2019
-
- Copyright (c) 1982, 2009, Oracle. All rights reserved.
-
-
- Connected to:
- Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
- With the Partitioning, OLAP, Data Mining and Real Application Testing options
-
- 09:41:05 SYS@study> select 1 from dual;
-
- 1
- ----------
- 1
-
- Elapsed: 00:00:00.00
- 09:41:11 SYS@study> select 1 from dual;