20090507 sqlplus history on linux - plembo/onemoretech GitHub Wiki

title: sqlplus history on linux link: https://onemoretech.wordpress.com/2009/05/07/sqlplus-history-on-linux/ author: lembobro description: post_id: 325 created: 2009/05/07 18:34:16 created_gmt: 2009/05/07 18:34:16 comment_status: open post_name: sqlplus-history-on-linux status: publish post_type: post

sqlplus history on linux

History is important. Otherwise I wouldn’t have bothered earning an M.A. in it.

In Oracle’s sqlplus you can get your command history at any time by typing LIST and hitting return.

To get the normal “up arrow” recall of a command you’re used to from a bash shell in Linux, try this:

1. Install [rlwrap](http://utopia.knoware.nl/~hlub/rlwrap/), a utility that uses the readline library to capture and allow editing of command line input for any command invoked with it.

Note that an rlwrap rpm is available from EPEL for RHEL/CentOS Linux, making compiling from source unnecessary on those distros.

2. Add alias sqlplus="rlwrap sqlplus" to your .bashrc (not .bash_profile) if you’re using the bash shell on Linux (e.g. RHEL/CentOS or Ubuntu).

If you’ve symlinked your sqlplus executable to /usr/bin or /usr/local/bin from, say /opt/oracle/instantclient_11_1/sqlplus as I have, all you should have to do then is something like:

sqlplus ODS/mypassword@infradb

and an up arrow will recall any sqlplus command issued from that point forward.

Some references here.

Copyright 2004-2019 Phil Lembo