oracle linux 退格,oracle database for linux 不能使用退格键

本文介绍了如何通过rlwrap工具增强Oracle SQL*Plus的交互,包括使用Ctrl+Backspace解决退格键问题,添加rlwrap到PATH并创建命令别名,实现历史命令回退和更便捷的命令行操作。
摘要由CSDN通过智能技术生成

方法一:要使用退格键的时候,同时按住ctrl+backspace

方法二:在任意一个启动脚本中添加如下内容

[oracle@night ~]$ tail -1 .bash_profile

stty erase ^H

stty的意思是set tty,主要是用来检查和修改当前注册的终端的通信参数

如上两种方法只是单一的解决了退格键的问题,如果我想回调sqlplus中执行过的命令 还是不行

方法三:可以使用退格键,可以回调sqlplus中执行过的命令

使用第三方工具rlwrap

解压安装完毕之后

[oracle@night u01]$ ls

app install rlwrap

[oracle@night u01]$ cd rlwrap/

[oracle@night rlwrap]$ ls

bin share

[oracle@night rlwrap]$

[oracle@night rlwrap]$ cd bin/

[oracle@night bin]$ ll

总计 168

-rwxr-xr-x 1 oracle oinstall 165717 07-25 23:33 rlwrap

[oracle@night bin]$

添加到PATH中

[oracle@night ~]$ vim .bash_profile

export PATH=$PATH:$ORACLE_BASE:$ORACLE_HOME/bin:/u01/rlwrap/bin

立即生效[oracle@night ~]$ source .bash_profile

[oracle@night ~]$ echo $PATH

/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/home/oracle/bin:/u01/app/oracle:/u01/app/oracle/product/bin:/home/oracle/bin:/u01/app/oracle:/u01/app/oracle/product/bin:/u01/rlwrap/bin

[oracle@night ~]$[oracle@night ~]$ rl

rlatopam rletopnm rlog rlogin rlwrap

[oracle@night ~]$ rl

使用[oracle@night ~]$ rlwrap sqlplus /nolog

SQL*Plus: Release 11.2.0.1.0 Production on Thu Jul 25 23:37:55 2013

Copyright (c) 1982, 2009, Oracle. All rights reserved.

SQL> conn sys/ as sysdba

Enter password:

Connected.

SQL>

也可以使用命令别名[oracle@night ~]$ alias sqlplus='rlwrap sqlplus'

[oracle@night ~]$ alias

alias l.='ls -d .* --color=tty'

alias ll='ls -l --color=tty'

alias ls='ls --color=tty'

alias sqlplus='rlwrap sqlplus'

alias vi='vim'

alias which='alias | /usr/bin/which --tty-only --read-alias --show-dot --show-tilde'

[oracle@night ~]$ sqlplus /nolog

SQL*Plus: Release 11.2.0.1.0 Production on Thu Jul 25 23:39:36 2013

Copyright (c) 1982, 2009, Oracle. All rights reserved.

SQL> conn / as sysdba

Connected.

SQL> exit

Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

如果想下次生效,可添加到启动脚本内

随笔记录

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值