Linux下面Sqlplus左右键乱码的问题

在WINDOS下面操作Sqlplus下面可以很方便的进行左右键,上下键的操作。但是在Linux下面这样操作就会乱码,一旦输入错误就很麻烦,虽然可以安装Ctrl+Backspace可以实现后退删除的功能,但始终不方便;

通过rlwrap可以很方便的实现,上下查看历史命令,左右修改的问题。

1、安装步骤如下:

1.1 安装libtermcap-devel和readline-devel两个包

yum install -y readline-devel libtermcap-devel

 

1.2 安装rlwrap

wget "http://utopia.knoware.nl/~hlub/rlwrap/rlwrap-0.37.tar.gz"
tar -xvf rlwrap-0.37.tar.gz
cd rlwrap-0.37
./configure

&& make

&& make install

 

1.3 命令的使用

[oracle@ekpjdbtest ~]$ rlwrap
Usage: rlwrap [options] command ...

Options:
  -a[password:]              --always-readline[=password:]
  -A                         --ansi-colour-aware
  -b  <chars>                --break-chars=<chars>
  -c                         --complete-filenames
  -C  <name|N>               --command-name=<name|N>
  -D  <0|1|2>                --history-no-dupes=<0|1|2>
  -f  <completion list>      --file=<completion list>
  -g  <regexp>               --forget-matching=<regexp>
  -h                         --help
  -H  <file>                 --history-filename=<file>
  -i                         --case-insensitive
  -I                         --pass-sigint-as-sigterm
  -l  <file>                 --logfile=<file>
  -n                         --no-warnings
  -N                         --no-children
  -o                         --one-shot
  -O  <regexp>               --only-cook=<regexp>
  -p[colour]                 --prompt-colour[=colour]
  -P  <input>                --pre-given=<input>
  -q  <chars>                --quote-characters=<chars>
  -m[newline substitute]     --multi-line[=newline substitute]
  -r                         --remember
  -R                         --renice
  -v                         --version
  -s  <N>                    --histsize=<N> (negative: readonly)
  -S  <prompt>               --substitute-prompt=<prompt>
  -t  <name>                 --set-term-name=<name>
  -w  <N>                    --wait-before-prompt=<N> (msec, <0  : patient mode)
  -z  <filter command>       --filter=<filter command>

 

2、设置的方法

切换到oracle用户的目录下面,

vi /home/oracle/.bash_profile

ORACLE_BASE=/oracle
ORACLE_HOME=$ORACLE_BASE/oracle11
alias sqlplus='rlwrap sqlplus' 

配置文件生效后,便可以很便捷的使用sqlplus了。

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/12679300/viewspace-1976640/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/12679300/viewspace-1976640/

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值