The Dutch Prutser's Blog

By: Harald van Breederode

  • Disclaimer

    The views expressed on this blog are my own and do not necessarily reflect the views of Oracle.
  • Subscribe

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 309 other followers

Command Line Tools and History

Posted by Harald van Breederode on January 17, 2009

While teaching an Oracle Data Guard course last week one of my students asked me how it was possible that I could recall commands in command line tools such as DGMGRL, SQL*Plus and RMAN. I told him that I use rlwrap For this purpose. I was quite surprised that he didn’t knew this because I wrote an article about this for the October 2008 issue of the Oracle University Technology Newsletter. In SQL*Plus’s Forgotten History I explain everything you need to know about this little but very useful utility. Personally I feel disabled when rlwrap is not available on systems I have to work on and it is usually the first thing I recommend to install. Besides making my life easier it also leaves a trail behind with the actions I performed.


13 Responses to “Command Line Tools and History”

  1. Surachart said

    that’s a great tool…
    thank you

  2. Martijn said

    Nice handy tool! Did not know it until now.


  3. jarneil said

    Is there any mileage in saying that maybe sqlplus should have some developer love and come with command history/completion by default, rather than the poor dba having to add a 3rd party piece of software?



  4. Harald van Breederode said


    Thank you. Yes there is but this sounds easier than it is. SQL*Plus runs on many different platforms and on some of them adding command line editing and history would be quite a challenge. And if SQL*Plus would have this feature, we want this on all command line tools wouldn’t we? With all focus on GUI tools I don’t expect this will change soon if at all.

  5. Robert Klemme said

    For the record: the Windows version of SQL Plus *does* have command line history – albeit no completion. You need to use the shell version though and not the Windows program.



  6. Harald van Breederode said


    Thank you for this addition. Starting with Oracle11g the Windows SQL*Plus (sqlplusw.exe) is no longer available, only the shell version (sqlplus.exe) is included. Although sqlplus.exe does have history it is not persistent across sessions.


  7. KC said

    Hi Harald,

    I installed it on our Linux part of my MOT software. Works nice.

  8. Dik Pater said

    on hpux unix you have ied.
    if you type
    $ ied sqlplus
    you also have a history, you can even use a histfile.

    Thanks for the tip.


  9. Dik Pater said

    from windows commandtool :
    sqlPlus >
    sql > select * from dual ;
    F7 for the history
    F8 for completion of your statement.
    Linux of windows….that’s the question…

  10. KC said

    And of course, I had some problems with Linux, 32 or 64 bit version.
    The rlwrap 64 version didn’t work on OS 32: cannot execute [Exec format error]
    The rlwrap 32 version didn’t work on OS 64: Floating point exception

    by checking OS version (uname -m) I can decide what rlwrap to install on OS:
    unix_version=`uname -m`
    case “$unix_version” in
    ‘i386’|’i686’) bit_version=32
    *) bit_version=64

  11. […] “Command Line Tools and History” – by Harald van Breederode […]

  12. […] More good news as Harald van Breederode tells us it is possible to recall command line history in tools such as SQL*Plus. […]

  13. Chakrit said

    Thank you!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: