一、 配置 Linux 中Sqlplus 的 Backspace 删除
在linux环境下使用sqlplus,在回删(backspace)时往往会出现 一串的乱码 。若想正常删除,需要一定的配置。
根据shell版本的不同,配置方式略有差异。
1.显示shell版本
[oracle@oradb01 ~]$ echo $0
-bash
2. 编辑.bash_profile 设定环境变量
[oracle@oradb01 ~]$ vi /home/oracle/.bash_profile
bash下:添加 stty erase ^? 到.bash_profile中。
csh下: 添加 stty erase ^H 到.cshrc中
二上下翻看查询历史记录
下载 :http://utopia.knoware.nl/~hlub/uck/rlwrap/rlwrap-0.37.tar.gz
1.上传rlwrap-0.37.tar.gz
2.解压rlwrap-0.37.tar.gz
[oracle@oradb01 ~]$ tar zxvf rlwrap-0.37.tar.gz
3.进入到rlwrap-0.37的解压目录
[oracle@oradb01 ~]$ cd rlwrap-0.37
4.执行configure命令
[oracle@oradb01 ~]$./configure
5.执行make命令
[oracle@oradb01 ~]$make
6.切换到root用户
[oracle@oradb01 ~]$ su - root
7.执行make install命令
[root@oradb01 rlwrap-0.37]# make install
8.切换到oracle用户
[root@oradb01 rlwrap-0.37]# su - oracle
9.进入到/home/oralce编辑.bash_profile
vi /home/oracle/.bash_profiel
添加如下内容:
alias sqlplus='rlwrap sqlplus' # oracle sqlpls
alias rman='rlwrap rman' # oracle rman
alias ggsci='rlwrap ggsci' # oracle goldengate
11. 保存退出重新登录 或运行 source .bash_profile使修改生效