成都网站建设设计

将想法与焦点和您一起共享

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

环境:centos6

我们提供的服务有:网站建设、成都网站制作、微信公众号开发、网站优化、网站认证、二道江ssl等。为近1000家企事业单位解决了网站和推广的问题。提供周到的售前咨询和贴心的售后服务,是有科学管理、有技术的二道江网站制作公司

一:命令记录

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 <

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

另外有需要云服务器可以了解下创新互联cdcxhl.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。


标题名称:oracle中快速实现命令记录与删除键,以及使用脚本快速配置-创新互联
浏览路径:http://chengdu.cdxwcx.cn/article/disshs.html