linux下sqlplus怎么使用上下键和回退

1.配置yum源:

[oracle@saperp ~]$ cat /etc/yum.repos.d/CentOS-Debuginfo.repo 
# CentOS-Debug.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client.  You should use this for CentOS updates
# unless you are manually picking other mirrors.
#

# All debug packages from all the various CentOS-7 releases
# are merged into a single repo, split by BaseArch
#
# Note: packages in the debuginfo repo are currently not signed
#

[base-debuginfo]
name=CentOS-7 - Debuginfo
baseurl=http://debuginfo.centos.org/7/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-Debug-7
enabled=1
#

2.安装rlwarp

[root@saperp ~]# yum install rlwrap*
Loaded plugins: auto-update-debuginfo, fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.bit.edu.cn
 * epel: mirrors.aliyun.com
 * epel-debuginfo: mirrors.aliyun.com
 * extras: mirror.bit.edu.cn
 * updates: mirror.bit.edu.cn
Package rlwrap-0.43-2.el7.x86_64 already installed and latest version
Resolving Dependencies
--> Running transaction check
---> Package rlwrap-debuginfo.x86_64 0:0.43-2.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

======================================================================================================================================
 Package                             Arch                      Version                        Repository                         Size
======================================================================================================================================
Installing:
 rlwrap-debuginfo                    x86_64                    0.43-2.el7                     epel-debuginfo                    149 k

Transaction Summary
======================================================================================================================================
Install  1 Package

Total download size: 149 k
Installed size: 504 k
Is this ok [y/d/N]: y
Downloading packages:
rlwrap-debuginfo-0.43-2.el7.x86_64.rpm                                                                         | 149 kB  00:00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : rlwrap-debuginfo-0.43-2.el7.x86_64                                                                                 1/1 
  Verifying  : rlwrap-debuginfo-0.43-2.el7.x86_64                                                                                 1/1 

Installed:
  rlwrap-debuginfo.x86_64 0:0.43-2.el7                                                                                                

Complete!

3.oracle环境变量添加:

[oracle@saperp ~]$ pwd
/home/oracle

[oracle@saperp ~]$ cat .bash_profile
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/.local/bin:$HOME/bin

export PATH
export ORACLE_BASE=/home/db/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1
export ORACLE_SID=erp
export LANG=en_US.UTF-8
export NLS_LANG=american_america.ZHS16GBK
export NLS_DATE_FORMAT="yyyy-mm-dd hh24:mi:ss"
export PATH=.:${PATH}:$HOME/bin:$ORACLE_HOME/bin:$ORACLE_HOME/OPatch
export PATH=${PATH}:/usr/bin:/bin:/usr/bin/X11:/usr/local/bin
export PATH=${PATH}:$ORACLE_BASE/common/oracle/bin:/home/oracle/run
export ORACLE_TERM=xterm
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$ORACLE_HOME/oracm/lib
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/lib:/usr/lib:/usr/local/lib
export CLASSPATH=$ORACLE_HOME/JRE
export CLASSPATH=${CLASSPATH}:$ORACLE_HOME/jlib
export CLASSPATH=${CLASSPATH}:$ORACLE_HOME/rdbms/jlib
export CLASSPATH=${CLASSPATH}:$ORACLE_HOME/network/jlib
export THREADS_FLAG=native
export TEMP=/tmp
export TMPDIR=/tmp
umask 022
export TMOUT=0
alias sqlplus='rlwrap sqlplus'
alias rman='rlwrap rman'
alias lsnrctl='rlwrap lsnrctl'

你可能感兴趣的:(oracle)