Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SQL*Plus history under Linux

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.

like image 277
Aleksey Otrubennikov Avatar asked Aug 11 '10 07:08

Aleksey Otrubennikov


People also ask

Which is an SQL*Plus command?

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.

What is difference between SQL Plus and SQL*Plus?

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.


1 Answers

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/

like image 58
Aleksey Otrubennikov Avatar answered Sep 27 '22 21:09

Aleksey Otrubennikov