oracle sqlplus不支持上下键查看历史记录问题

我们需要安装rlwrap软件

系统采样:

[root@rac-2 src]# su - oracle
Last login: Fri Mar 18 23:36:25 CST 2022 on pts/0

oracle@prd:/home/oracle$cat /etc/redhat-release 
CentOS Linux release 7.2.1511 (Core) 

oracle@prd:/home/oracle$rpm -qa |grep rlwrap
rlwrap-0.42-1.el6.x86_64

如果没有安装rlwrap

//安装,我这里下载的针对centos6的,但是向下兼容,安装后没有问题 
[root@rac-2 src]# rpm -ivh rlwrap-0.42-1.el6.x86_64.rpm

 
 //执行下面操作
[root@rac-2 src]#  su - oracle 

 //修改oracle用户的 .bash_profile环境变量文件
oracle@prd: vi .bash_profile   
  //最后一行增加
   alias sqlplus='rlwrap sqlplus' 
   alias rman='rlwrap rman' 
   alias lsnrctl='rlwrap lsnrctl'
//让环境变量生效
oracle@prd: source .bash_profile

使用方法:

oracle@prd:/home/oracle$rlwrap sqlplus / as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Sat Mar 19 00:05:24 2022
Copyright (c) 1982, 2013, Oracle.  All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> 
//安装之后,你exit退出之后,再进入利用上下键还能看到之前输入的命令。
//直接sqlplus / as sysdba 也没有问题

也这个也是,提高你操作的效率,也不能一直对付。否则会影响你的操作。
环节还是挺多的,包括xshell使用的时候,你最好在选项卡里面设置快捷方式,比如:ctrl+c ,ctrl+v等设置为复制粘贴
这样可以提高你的操作效率。有的时候你的键盘,可能还有Fn键也会影响你的操作,有必要都进行一些设置,以便提高你的操作效率。

 

posted @ 2022-03-19 00:22  jinzi  阅读(226)  评论(0编辑  收藏  举报