linux 回退乱码,如何在linux sqlplus 下实现方向健和回退键操作而避免乱码
在window下的sqlplus可以通過(guò)箭頭鍵,來(lái)回看歷史命令,用起來(lái)非常的方便。但是在linux里就沒(méi)有這么方面了,錯(cuò)了一個(gè)命令,我們必須重新敲一次,辛苦了手指頭。
通過(guò)rlwrap包實(shí)現(xiàn)linux里的sqlplus歷史命令的功能:
第一步:下載安裝包
在http://rpm.pbone.net/?? 網(wǎng)站搜索以下包,并下載后上傳到服務(wù)器
rlwrap-0.42-1.el6.x86_64.rpm
readline-devel-6.0-4.el6.x86_64.rpm
ncurses-devel-5.7-4.20090207.el6.x86_64.rpm
第二步:在root 用戶下,rpm -ivh 安裝下載的包??;如果配置yum resporitory ,可通過(guò)yum install直接安裝
[root@localhost Downloads]# rpm -ivh ncurses-devel-5.7-4.20090207.el6.x86_64.rpm
Preparing...??????????????? ########################################### [100%]
1:ncurses-devel????????? ########################################### [100%]
[root@localhost Downloads]# rpm -ivh readline-devel-6.0-4.el6.x86_64.rpm
Preparing...??????????????? ########################################### [100%]
1:readline-devel???????? ########################################### [100%]
[root@localhost Downloads]# rpm -ivh rlwrap-0.42-1.el6.x86_64.rpm
Preparing...??????????????? ########################################### [100%]
1:readline-devel???????? ########################################### [100%]
第三步:切換至oracle 用戶,在oracle 下 .bash_profile 文件中添加
alias sqlplus='rlwrap sqlplus'
alias rman='rlwrap rman'
如下示例:
[oracle@localhost ~]$?vi .bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
alias sqlplus='rlwrap sqlplus'
alias rman='rlwrap rman'
PATH=$PATH:$HOME/bin
umask 022
TMP=/tmp;
export TMP
TMPDIR=$TMP;
export TMPDIR export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/oracle/product/12.2.0/db_1
export PATH=$ORACLE_HOME/Apache/perl/bin:$ORACLE_HOME/bin:$ORACLE_HOME/Apache/Apache/bin:$PATH
export ORACLE_OWNER=oracle
export ORACLE_SID=emrs
export ORACLE_TERM=xterm
unset USERNAME
總結(jié)
以上是生活随笔為你收集整理的linux 回退乱码,如何在linux sqlplus 下实现方向健和回退键操作而避免乱码的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 远程定位gps linux,GPS(NM
- 下一篇: linux与w7之间的切换,w7系统切换