解決Oracle Linux下SQL*Plus無法使用上下箭頭顯示歷史命令的問題

LuiseDalian發表於2014-05-15
1. 先到網上下載rlwrap-0.37.tar.gz安裝包(不知道上哪下載,可以baidu)

#使用SecureFXrlwrap-0.37.tar.gzroot使用者上傳到虛擬機器的/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部落格 ” ,連結:http://blog.itpub.net/17013648/viewspace-1161539/,如需轉載,請註明出處,否則將追究法律責任。

相關文章