oracle中快速实现命令记录与删除键,以及使用脚本快速配置

环境:centos6

一:命令记录

1.使用yum安装readline-devel

yum install readline-devel

2.源码编译安装rlwrap

# wget http://utopia.kNoware.nl/~hlub/rlwrap/rlwrap-0.37.tar.gz
# tar -xf rlwrap-0.37.tar.gz
# cd rlwrap-0.37/
# ./configure
# make && make install

3.设置sqlplus的系统别名:
# vim /home/oracle/.bash_profile
在头部或尾部添加

alias sqlplus='rlwrap sqlplus'
alias rman='rlwrap rman'

二:删除

sqlplus下使用Backspace来删除字符,使用stty命令重新定义^H,可以在使用sqlplus之前执行stty erase ^H,也可以把这一句放到oracle用户的.bash_profile文件里。


三:脚本快速配置

#/bin/bash

#description:quick configure the oracle del and history command record

PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin

export PATH

#the centos6 has already installed the readline,so we needn't to install the readline again

#yum install readline

#use the yum to install readline-devel

yum install readline-devel

#use the tar file to install rlwrap

cd /usr/local/src

wget http://utopia.kNoware.nl/~hlub/rlwrap/rlwrap-0.37.tar.gz
tar -xf rlwrap-0.37.tar.gz
cd rlwrap-0.37/
./configure
make && make install


#configure the .bash_profile


cat >> /home/oracle/.bash_profile <<EOF

alias sqlplus='rlwrap sqlplus'
alias rman='rlwrap rman'

stty erase ^H #it used to configure the delete of configure

EOF


参考网址:

http://www.ha97.com/4856.html

相关文章

这篇文章主要介绍“hive和mysql的区别是什么”,在日常操作中...
这篇“MySQL数据库如何改名”文章的知识点大部分人都不太理解...
这篇文章主要介绍“mysql版本查询命令是什么”的相关知识,小...
本篇内容介绍了“mysql怎么修改字段的内容”的有关知识,在实...
这篇文章主要讲解了“mysql怎么删除unique约束”,文中的讲解...
今天小编给大家分享一下mysql怎么查询不为空的字段的相关知识...