rlwrap解决 Oracle sqlplus 在linux 上下文切换乱码问题

本文谢绝转载原文来自http://990487026.blog.51cto.com



rlwrap官网:

http://utopia.knoware.nl/~hlub/uck/rlwrap/


wKioL1fGkiTC9ymmAAClyF2GjdY178.png



开始干活吧!


系统属性:

CentOS 6.8_X64,基于桌面,附加开发工具包安装.



下载源码,编译,安装:

[oracle@oracle11~]$mkdir/tmp/mytest
[oracle@oracle11~]$cd/tmp/mytest
[oracle@oracle11mytest]$wgethttp://utopia.knoware.nl/~hlub/uck/rlwrap/rlwrap-0.42.tar.gz
[oracle@oracle11mytest]$echo$?
0
[oracle@oracle11mytest]$tarxfrlwrap-0.42.tar.gz
[oracle@oracle11mytest]$cdrlwrap-0.42
[oracle@oracle11rlwrap-0.42]$./configure
YouneedtheGNUreadlinelibrary(ftp://ftp.gnu.org/gnu/readline/)tobuild
thisprogram!
[oracle@oracle11rlwrap-0.42]$echo$?
1
提示我缺readlinelibrary,切换到root下
[root@oracle11~]#yuminstall-yreadline-devel
[oracle@oracle11rlwrap-0.42]$./configure
[oracle@oracle11rlwrap-0.42]$echo$?
0
编译环境检查通过!


那么久开始编译吧:
[oracle@oracle11rlwrap-0.42]$make
[oracle@oracle11rlwrap-0.42]$echo$?
0

root权限来安装
[root@oracle11~]#cd/tmp/mytest/rlwrap-0.42
[root@oracle11rlwrap-0.42]#makeinstall
[root@oracle11rlwrap-0.42]#echo$?
0


测试:

[root@oracle11rlwrap-0.42]#rlwrap
Usage:rlwrap[options]command...

Options:
-a[passwordprompt]--always-readline[=passwordprompt]
-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>
-e<char|''>--extra-char-after-completion=<char|''>
-f<completionlist>--file=<completionlist>
-g<regexp>--forget-matching=<regexp>
-h--help
-H<file>--history-filename=<file>
-i--case-insensitive
-I--pass-sigint-as-sigterm
-l<file>--logfile=<file>
-m[newlinesubstitute]--multi-line[=newlinesubstitute]
-M<.ext>--multi-line-ext=<.ext>
-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>
-r--remember
-R--renice
-s<N>--histsize=<N>(negative:readonly)
-S<prompt>--substitute-prompt=<prompt>
-t<name>--set-term-name=<name>
-U--mirror-arguments
-v--version
-w<N>--wait-before-prompt=<N>(msec,<0:patientmode)
-W--polling
-z<filtercommand>--filter=<filtercommand>(-zlistinglistsinstalledfilters)

bugreports,suggestions,updates:
http://utopia.knoware.nl/~hlub/uck/rlwrap/


设置别名:

[oracle@oracle11rlwrap-0.42]$echo"aliassqlplus='rlwrapsqlplus'">>/home/oracle/.bashrc
[oracle@oracle11rlwrap-0.42]$cd
[oracle@oracle11~]$source.bashrc

测试我的上下左右键:

[oracle@oracle11~]$sqlplus/nolog

SQL*Plus:Release11.2.0.1.0ProductiononWedAug3116:08:432016

Copyright(c)1982,2009,Oracle.Allrightsreserved.

SQL>conn/assysdba
Connectedtoanidleinstance.
SQL>

SQL>connassysdba


上下左右键回来了


wKioL1fGkxOxOKBFAABhhlU2P_w505.png

相关文章

文章浏览阅读773次,点赞6次,收藏9次。【代码】c# json字符...
文章浏览阅读8.7k次,点赞2次,收藏17次。此现象一般定位到远...
文章浏览阅读2.8k次。mysql脚本转化为oracle脚本_mysql建表语...
文章浏览阅读2.2k次。cx_Oracle报错:cx_Oracle DatabaseErr...
文章浏览阅读1.1k次,点赞38次,收藏35次。本文深入探讨了Or...
文章浏览阅读1.5k次。默认自动收集统计信息的时间为晚上10点...