SQL*Plus history under Linux

Aleksey Otrubennikov picture Aleksey Otrubennikov · Aug 11, 2010 · Viewed 7k times · Source

How to make sqlplus in Linux to maintain history of my queries? So that I could use up/down arrows to get my previous query.

Answer

Aleksey Otrubennikov picture Aleksey Otrubennikov · Aug 11, 2010

rlwrap package is needed. Used like this:

$ rlwrap sqlplus user/password@sid

Nice to place alias to .bashrc:

alias sqlplus="rlwrap sqlplus"

Found answer here:

http://sysdba.wordpress.com/2006/10/08/how-to-use-rlwrap-to-get-a-command-history-in-sqlplus/