linux下sqlplus調出歷史命令--rlwrap介紹
為了在Linux中達到同樣的目的,你可以安裝rlwrap,這個程式本身是個Shell,可以執行任何你提供給它的命令包括引數,並新增命令歷史瀏覽功能。 The rlwrap program is under the GPL license。
1:安裝
rlwrap-0.28.tar.gz下載地址:
(現是已升級到0.30了)
1):解壓縮安裝檔案
[oracle@Channel-MQ3 ~]$gunzip rlwrap-0.28.tar.gz
[oracle@Channel-MQ3 ~]$tar xvf rlwrap-0.28.tar
2):切換到root使用者,執行下面的命令
[root@Channel-MQ3 ~]# cd /home/oracle/rlwrap-0.28
[root@Channel-MQ3 rlwrap-0.28]# ls
aclocal.m4 completions configure INSTALL README TODO
AUTHORS config.h configure.ac Makefile src tools
bash30-005.patch config.h.in COPYING Makefile.am stamp-h1
BUGS config.log distribution Makefile.in test
ChangeLog config.status doc NEWS test.log
[root@Channel-MQ3 rlwrap-0.28]#./configure
[root@Channel-MQ3 rlwrap-0.28]#make
[root@Channel-MQ3 rlwrap-0.28]#make install
2:使用
$ rlwrap [-options]
[oracle@Channel-MQ3 ~]$ which rlwrap
/usr/local/bin/rlwrap
[oracle@Channel-MQ3 ~]$ rlwrap sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Wed Jul 18 10:31:11 2007
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL> select * from v$sga;
NAME VALUE
-------------------- ----------
Fixed Size 1219856
Variable Size 121635568
Database Buffers 310378496
Redo Buffers 7168000
-- 使用向上鍵調回最後執行的命令,按[Enter]重新執行或修改後按[Enter]執行
SQL> select * from v$sga;
NAME VALUE
-------------------- ----------
Fixed Size 1219856
Variable Size 121635568
Database Buffers 310378496
Redo Buffers 7168000
另外rlwrap還有很多選項可以設定
eg:
−l, −−logfile file
Append command’s output (including echo’ed user input) to file (creating file when it doesn’t exist).
測試如下
[oracle@Channel-MQ3 ~]$ rlwrap -l benbotest.log sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Wed Jul 18 10:34:50 2007
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL> select * from v$version;
BANNER
----------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod
PL/SQL Release 10.2.0.1.0 - Production
CORE 10.2.0.1.0 Production
TNS for Linux: Version 10.2.0.1.0 - Production
NLSRTL Version 10.2.0.1.0 - Production
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
[oracle@Channel-MQ3 ~]$ cat benbotest.log
[rlwrap] Wed Jul 18 10:34:50 2007
SQL*Plus: Release 10.2.0.1.0 - Production on Wed Jul 18 10:34:50 2007
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL> select * from v$version;
BANNER
----------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod
PL/SQL Release 10.2.0.1.0 - Production
CORE 10.2.0.1.0 Production
TNS for Linux: Version 10.2.0.1.0 - Production
NLSRTL Version 10.2.0.1.0 - Production
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
[oracle@Channel-MQ3 ~]$
其它選擇輕參考manpage.
相關資源:
rlwrap-0.28.tar.gz (150 k)
The manpage
The README file
CHANGES
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/271283/viewspace-1007570/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- rlwrap - 支援oracle下sqlplus歷史命令的回撥功能OracleSQL
- rlwrap實現鍵盤上下箭頭,調出歷史執行的SQL命令SQL
- Linux系統的病毒歷史介紹Linux
- linux 下sqlplus 歷史記錄問題LinuxSQL
- rlwrap sqlplus in linuxSQLLinux
- linux歷史命令Linux
- 在linux下使SQLPLUS歷史回撥功能LinuxSQL
- 在Linux下使用SQLPLUS歷史回撥功能LinuxSQL
- MySQL發展歷史介紹MySql
- LINUX下SQLPLUS等工具的歷史記錄功能LinuxSQL
- rhel5利用別名alias指向rlwrap啟用oracle sqlplus歷史列表OracleSQL
- Linux下快速執行歷史命令的方法Linux
- MySQL版本發展歷史介紹MySql
- oracle中使用rlwrap,將命令列歷史的檢視變為可能Oracle命令列
- uniread,讓你的sqlplus在LINUX下也能用箭頭回撥歷史命令SQLLinux
- rlwrap的安裝介紹
- rlwrap sqlplus下的回顯工具SQL
- Linux系統的發展歷史和學習前景介紹Linux
- Linux是什麼作業系統?發展歷史介紹Linux作業系統
- rlwrap 的安裝使用(實現sqlplus下命令列history編輯)SQL命令列
- Shell歷史命令
- Oracle中檢視sql命令歷史,檢視rman命令歷史OracleSQL
- Linux下ulimit命令的詳細使用介紹LinuxMIT
- Linux xargs命令介紹Linux
- linux xhost命令介紹Linux
- linux ps命令介紹Linux
- Linux yum 命令介紹Linux
- Linux top命令介紹Linux
- Linux make命令介紹Linux
- 【rlwrap】Linux上實現Windows的SQL*Plus儲存SQL歷史記錄功能LinuxWindowsSQL
- Linux中禁用命令歷史記錄Linux
- 從頭來之【iOS及歷史版本特性介紹】iOS
- Linux上實現Windows的SQL*Plus儲存SQL歷史記錄功能---rlwrap(轉)LinuxWindowsSQL
- Linux useradd 命令介紹Linux
- Linux重啟命令介紹Linux
- Linux系統調優介紹Linux
- solaris下配置使用SQL*Plus歷史命令記錄SQL
- Linux下mysql的歷史操作記錄LinuxMySql