ITPub博客

首页 > 数据库 > Oracle > Linux下面Sqlplus左右键乱码的问题

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

原创 Oracle 作者:wzq609 时间:2016-01-14 17:31:01 0 删除 编辑

在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博客 ” ,链接:https://blog.itpub.net/12679300/viewspace-1976640/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2013-06-16

  • 博文量
    173
  • 访问量
    3083836