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.
SQL*Plus is a command-line tool that provides access to the Oracle RDBMS. SQL*Plus enables you to: Enter SQL*Plus commands to configure the SQL*Plus environment. Startup and shutdown an Oracle database.
SQL statements are used to perform tasks such as update data on a database, or retrieve data from a database. SQL*Plus is a command line SQL and PL/SQL language interface and reporting tool that ships with the Oracle Database Client and Server software. It can be used interactively or driven from scripts.
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/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With