Linux系統下SQL*Plus方向鍵沒法使用的解決

來源:互聯網
上載者:User

在Linux作業系統下使用Oracle的SQL*Plus工具有一個比較麻煩的地方:通過sqlplus命令進入到SQL*Plus控制台後,我們在Bash中已經習以為常的上下左右鍵突然變成了^[[A^[[B^[[D^[[C這樣的"亂碼"。熟悉ksh的朋友肯定要說我們這是大驚小怪了,不過對於從Windows平台轉過來的一般使用者而言,不小心按錯一下就是4個錯誤的字元,而且曆史命令也無法方便的回查了,確實挺鬱悶的。

別著急,如果你的Linux是Debian或者Ubuntu/Kubuntu,直接sudo apt-get install rlwrap安裝這個小巧的readline擴充,然後就可以以rlwrap sqlplus的方式進入方向鍵"正常"的SQL*Plus了。當然,如果嫌每次敲rlwrap不爽,可以在/etc/profile或者自己的~/.bashrc裡面添加alias sqlplus='rlwrap sqlplus'。其他發行版的朋友可以選擇rpm包或者乾脆從源碼自己編譯。

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.