在sqlplus中實現命令的上翻下翻功能
在linux下使用Oracle的sqlplus時,預設情況下箭頭鍵不起到左右移動游標,上下翻動命令的作用。導致使用很不方便。這裡我要介紹一 個小工具軟體rlwrap(軟體解除安裝地址:),這是一個“readline wrapper”工具,可以使用左右箭頭在一行中左右移動游標,還可以用上下箭頭來上翻和下翻回撥命令,甚是好用。
下載地址:
[@more@]
我用的是0.24原始碼版。安裝和簡單:
./configure
make
make install
其他一些安裝的情況比如用非root使用者安裝,看看readme和install檔案就行了,也非常簡單。(這個我沒有測試過,大家動手學習吧!)
而且現在已經有rpm版的了。安裝後在Oracle使用者的.bash_profile檔案中加上兩句話:
alias sqlplus="rlwrap sqlplus"
alias rman="rlwrap rman"
重新用Oracle使用者登入或執行. /home/oracle/.bash_profile,使修改生效。下面就可以在sqlplus和rman中按想象的方式使用箭頭鍵了。
我的測試過程:
將rlwrap-0.37.tar.gz包上傳至Linux伺服器。
[root@study setup]# rz
rz waiting to receive.
Starting zmodem transfer. Press Ctrl+C to cancel.
100% 245 KB 245 KB/s 00:00:01 0 Errors
將rlwrap-0.37.tar.gz包解壓
[root@study setup]# tar -zxvf rlwrap-0.37.tar.gz
rlwrap-0.37/
rlwrap-0.37/completions/
rlwrap-0.37/completions/testclient
rlwrap-0.37/completions/coqtop
rlwrap-0.37/doc/
rlwrap-0.37/doc/rlwrap.man.in
rlwrap-0.37/doc/Makefile.am
rlwrap-0.37/doc/Makefile.in
rlwrap-0.37/filters/
.......
進入到解壓後目錄
[root@study setup]# cd rlwrap-0.37
執行編譯,安裝,過程如下:
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
.......
config.status: executing depfiles commands
Now do:
make (or gmake) to build rlwrap
make check for instructions how to test it
make install to install it
[root@study rlwrap-0.37]# make
make all-recursive
make[1]: Entering directory `/home/setup/rlwrap-0.37'
Making all in doc
make[2]: Entering directory `/home/setup/rlwrap-0.37/doc'
sed -e 's#@DATADIR@#/usr/local/share#' rlwrap.man > rlwrap.1
make[2]: Leaving directory `/home/setup/rlwrap-0.37/doc'
Making all in src
make[2]: Entering directory `/home/setup/rlwrap-0.37/src'
.......
make[2]: Entering directory `/home/setup/rlwrap-0.37'
make[2]: Nothing to be done for `all-am'.
make[2]: Leaving directory `/home/setup/rlwrap-0.37'
make[1]: Leaving directory `/home/setup/rlwrap-0.37'
[root@study rlwrap-0.37]#
[root@study rlwrap-0.37]# make install
Making install in doc
make[1]: Entering directory `/home/setup/rlwrap-0.37/doc'
.......
make[1]: Leaving directory `/home/setup/rlwrap-0.37'
切換至oracle使用者,修改配置檔案.bash_profile
[oracle@study ~]$ vi .bash_profile
在檔案最後新增
alias sqlplus="rlwrap sqlplus"
alias rman="rlwrap rman"
儲存並是配置生效
[oracle@study ~]$ source .bash_profile
這時,我們在登入sqlplus 就是可以使用左右上下鍵了。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/271283/viewspace-1058832/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 在linux上用dd命令實現ghost功能Linux
- 水煮oracle-十八《linux下oracle中sqlplus的上翻功能設定OracleLinuxSQL
- 在vSphere中實現複製貼上功能
- sqlplus 中設定命令回顯功能SQL
- 在Swift中實現撤銷功能Swift
- 奇怪 sqlplus中 host命令出現lsSQLSQL
- 在java中實現對FORM的列印功能 (轉)JavaORM
- Android實現翻頁功能原理Android
- 在Asp.Net中實現類似DWR的功能ASP.NET
- Python在類中實現swith case功能Python
- sqlplus中change命令的用法SQL
- 移動端上滑實現翻頁功能
- vim中翻頁的命令
- linux平臺實現sqlplus中為edit命令配置編輯器LinuxSQL
- cmd_sqlplus 中的break命令SQL
- linux上的sqlplus支援命令回顯LinuxSQL
- 在 oracle 中實現 sql server 中的在 create object 時的判斷與刪除功能OracleSQLServerObject
- Rust中實現使用者上傳功能的開源專案Rust
- sqlplus & rman 命令下,使用上下翻動鍵,呼叫之前執行過的命令SQL
- 選單中的命令的實現
- Oracle SQLPLUS中DEFINE在SHELL中的呼叫OracleSQL
- 在sqlplus中插入字元&SQL字元
- [譯] Story 中 Type Mode 在 iOS 和 Android 上的實現iOSAndroid
- rlwrap 的安裝使用(實現sqlplus下命令列history編輯)SQL命令列
- rlwrap - 支援oracle下sqlplus歷史命令的回撥功能OracleSQL
- 在Unity實現遊戲命令模式Unity遊戲模式
- sqlplus 中exit 命令的隱式commitSQLMIT
- [翻譯] PHP 7.2 中棄用的功能PHP
- 用CSS實現類似導航翻轉功能例子CSS
- 【翻譯】Chrome 43 部分更新:現在 DOM 的屬性將會在原型鏈上Chrome原型
- Fluwx:微信SDK在Flutter上的實現Flutter
- 在 Redis 上實現的分散式鎖Redis分散式
- random_device在windows上的實現randomdevWindows
- JSP中實現遮蔽次的功能JS
- 四個 Python 庫,實現超實用的命令列功能Python命令列
- 利用HTML5定位功能,實現在百度地圖上定位HTML地圖
- “彌補”sqlplus的游標移動與命令回顯功能SQL
- 線上教育平臺開發中,作業功能中的圖片上傳是如何實現的