oracle 不能删除记录,Oracle下sqlplus无法使用命令退格删除和历史记录的解决方法--使用rlwrap...

一般通过SecureCRT或putty等SSH客户端远程登录Linux下oracle的时候,使用sqplus连接数据库,输错字符后按Backspace键或Del键删除时,会出现^H或其他乱七八糟的的字符,会感觉非常别扭不习惯,而且影响使用效率。针对此问题,小结了一下。

一、安装相应的软件包

首先配置本地YUM源

然后

yum -y install readline*

Running Transaction

Installing : ncurses-devel-5.7-3.20090208.el6.x86_64                               1/2

Installing : readline-devel-6.0-4.el6.x86_64                                       2/2

Installed products updated.

Verifying  : readline-devel-6.0-4.el6.x86_64                                       1/2

Verifying  : ncurses-devel-5.7-3.20090208.el6.x86_64                               2/2

等待安装完成

然后从网上下载rlwrap-0.37.tar包

[root@rac1 home]#tar -xvf  rlwrap-0.37.tar

[root@rac1 home]# cd rlwrap-0.37

[root@rac1 rlwrap-0.37]# ls -l

总用量 472

-rw-rw-r-- 1  500  500  35029 4月  30 2010 aclocal.m4

-rw-r--r-- 1  500  500    638 8月  15 2006 AUTHORS

-rw-r--r-- 1  500  500   4267 5月   5 2010 BUGS

-rw-r--r-- 1  500  500    105 8月  10 2003 ChangeLog

drwxrwxr-x 2  500  500   4096 5月   5 2010 completions

-rw-rw-r-- 1  500  500   7042 4月  30 2010 config.h.in

-rw-r--r-- 1 root root  67839 9月   1 17:00 config.log

-rwxr-xr-x 1  500  500 222847 4月  30 2010 configure

-rw-r--r-- 1  500  500  11521 4月  30 2010 configure.ac

-rw-r--r-- 1  500  500  17992 8月   8 2006 COPYING

drwxrwxr-x 2  500  500   4096 5月   5 2010 doc

drwxrwxr-x 2  500  500   4096 5月   5 2010 filters

-rw-r--r-- 1  500  500   2019 11月 23 2009 INSTALL

-rw-r--r-- 1  500  500   1272 1月  23 2010 Makefile.am

-rw-rw-r-- 1  500  500  28316 4月  30 2010 Makefile.in

-rw-r--r-- 1  500  500  16788 4月  30 2010 NEWS

-rw-r--r-- 1  500  500   1394 10月 24 2007 PLEA

-rw-r--r-- 1  500  500   3070 1月   8 2010 README

drwxrwxr-x 2  500  500   4096 5月   5 2010 src

drwxrwxr-x 2  500  500   4096 5月   5 2010 test

-rw-r--r-- 1  500  500    310 4月  16 2010 TODO

drwxrwxr-x 2  500  500   4096 5月   5 2010 tools

[root@rac1 rlwrap-0.37]# ./configure

checking build system type... x86_64-unknown-linux-gnu

checking host system type... x86_64-unknown-linux-gnu

checking for a BSD-compatible install... /usr/bin/install -c

checking whether build environment is sane... yes

checking for a thread-safe mkdir -p... /bin/mkdir -p

[root@rac1 rlwrap-0.37]# make

[root@rac1 rlwrap-0.37]# make install

二:配置使用rlwrap

[root@oracle11g rlwrap-0.30]# vi /home/oracle/.bash_profile

在首部或尾部添加

alias  sqlplus='rlwrap sqlplus'

alias  lsnrctl='rlwrap lsnrctl'

alias  rman='rlwrap rman'

stty erase ^h

如果出现rlwrap命令找不到,请配置PATH

PATH=$PATH:$HOME/bin:/home/rlwrap-0.37/src

使修改的变量执行生效

# source .bash_profile

三.进入oracle连接用户测试

#su - oracle

sqlplus / as sysdba

SQL> show user

之后再用命令sqlplus / as sysdba 连接数据库时就会调用rlwrap这个工具,使得Linux下的SQL Plus可以像Windows下的那样使用了。

补充:如果sqlplus命令用不了,可以做如下设置

[oracle@rac1 ~]$ sqlplus /nolog

bash: sqlplus: command not found

[oracle@rac1 ~]$ ln -s $ORACLE_HOME/bin/sqlplus /usr/bin

ln: creating symbolic link `/usr/bin/sqlplus' to `/bin/sqlplus': Permission deni ed

[oracle@rac1 ~]$ su - root

Password:

[root@rac1 ~]# ln -s $ORACLE_HOME/bin/sqlplus  /usr/bin

[root@rac1 ~]# su - oracle

[oracle@rac1 ~]$ sqlplus /nolog

SQL> conn / as sysdba

Connected to an idle instance.

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值