ITPub博客

首页 > 数据库 > Oracle > 解决Oracle Linux下SQL*Plus无法使用上下箭头显示历史命令的问题

解决Oracle Linux下SQL*Plus无法使用上下箭头显示历史命令的问题

Oracle 作者:牛肉面之歌 时间:2014-09-14 14:26:03 0 删除 编辑
1. 先到网上下载rlwrap-0.37.tar.gz安装包(不知道上哪下载,可以baidu)

#使用SecureFX将rlwrap-0.37.tar.gz以root用户上传到虚拟机的/tmp目录

# 解压,安装

[root@RH54.cuug.net:/tmp]$ tar -zxvf rlwrap-0.37.tar.gz

[root@RH54.cuug.net:/tmp]$ cd rlwrap-0.37

[root@RH54.cuug.net:/tmp/rlwrap-0.37]$ ./configure

[root@RH54.cuug.net:/tmp/rlwrap-0.37]$ make

[root@RH54.cuug.net:/tmp/rlwrap-0.37]$ make install

# 测试

[oracle@RH54.cuug.net:/home/oracle]$ rlwrap sqlplus / as sysdba

 

SQL*Plus: Release 11.2.0.3.0 Production on Tue May 6 12:36:18 2014

 

Copyright (c) 1982, 2011, Oracle.  All rights reserved.

 

 

Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - Production

With the Partitioning, Automatic Storage Management, OLAP, Data Mining

and Real Application Testing options

 

sys@TESTDB11>select * from scott.salgrade;

 

     GRADE      LOSAL      HISAL

---------- ---------- ----------

         1        700       1200

         2       1201       1400

         3       1401       2000

         4       2001       3000

         5       3001       9999

        

# 对/home/oracle/.bash_profile进行配置

[oracle@RH54.cuug.net:/home/oracle]$ vi .bash_profile

# .bash_profile

 

# Get the aliases and functions

if [ -f ~/.bashrc ]; then

        . ~/.bashrc

fi

 

# User specific environment and startup programs

 

PATH=$PATH:$HOME/bin

export PATH

export PS1=[`whoami`@`hostname`':${PWD}]$ '

export ORACLE_BASE=/u01/app/oracle

export ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1

export ORACLE_SID=TestDB11

export PATH=$PATH:$ORACLE_HOME/bin

umask=022

export LD_LIBRARY_PATH=/usr/local/lib:.

export CC=gcc

export PATH=$PATH:/usr/local/bin

alias sqlplus='rlwrap sqlplus'

alias rman='rlwrap rman'

 

# 测试

[oracle@RH54.cuug.net:/home/oracle]$ . ./.bash_profile

[oracle@RH54.cuug.net:/home/oracle]$ sqlplus / as sysdba

 

SQL*Plus: Release 11.2.0.3.0 Production on Tue May 6 12:39:14 2014

 

Copyright (c) 1982, 2011, Oracle.  All rights reserved.

 

 

Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - Production

With the Partitioning, Automatic Storage Management, OLAP, Data Mining

and Real Application Testing options

 

sys@TESTDB11>select * from scott.salgrade;

 

     GRADE      LOSAL      HISAL

---------- ---------- ----------

         1        700       1200

         2       1201       1400

         3       1401       2000

         4       2001       3000

         5       3001       9999

# 使用向上箭头,可以显示历史命令

sys@TESTDB11>select * from scott.salgrade;


来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/29424472/viewspace-1269439/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: 减少VG空间
请登录后发表评论 登录
全部评论

注册时间:2014-01-04

  • 博文量
    76
  • 访问量
    115098