bash-like features in sqlplus, rman and other Oracle command line tools

As far as I can remember, I have always been complaining about the lack of “recall last command” from within sqlplus. Such a basic thing, available in any bash shell or windows cmd terminal, remains missing with Oracle command lines tools.

Thanks to Arnaud who published a post in the french blog EASYTEAM, it is now possible to use a simple rpm package rlwrap to enhance sqlplus, dgmgrl, rman, … tools and give them bash “recall/completion” capabilities.

I installed it in a few minutes and I am already wondering how can people work without it.

The steps are here :

  • Get the rpm file from sites like RPM PBone.
  • AS root, install the package
    • rpm -ivh rlwrap-0.37-1.el5.x86_64.rpm
  • As Oracle, create a dictionnary file (for autocompletion) . This file is made of a series of words to be used for autocompletion. Put in it the list of dictionary tables, the list of sql commands, the list of sqlplus commands… whatever your like. And use the <tab> key as you would in a bash shell.
    • $HOME/.oracle_keywords
  • Create an alias for sqlplus
    • alias sqlplus='/usr/bin/rlwrap -if $HOME/.oracle_keywords $ORACLE_HOME/bin/sqlplus'

And enjoy it !!!

Thank you Arnaud.
Add:  One can find specific Oracle extension for databases 9i, 10g and 11g (keyword textfile) over here. 

This will avoid you the need to create this .oracle_keywords file.
Thank you Michael for this info.
Gilles Haro 
      
Technical Expert - Core Technology, Oracle Consulting 

IronManSignature_thumb

Technorati Tags:
Comments:

I used rlwrap long before the post on the french blog. This feature is already explained in dozens of other blogposts. Also, i wouldnt advise this to use on production environments.

Posted by Informize this on March 16, 2011 at 10:36 AM CET #

Thank you for you reply. I surely think rlwrap is not a brand new thing. The fact is I did not know about it before and so might a lot of other people. Therefore, sharing the info is worth the value, not matter what it is not a fresh one. I am more interested by the second part of your comment and your advise. Can I ask you to be more precise and explain the reasons that make you say that ? Regards, Gilles

Posted by Gilles Haro on March 16, 2011 at 02:48 PM CET #

this helps me a lot http://www.linuxification.at/rlwrap_ext.html.en

Posted by heimich on March 17, 2011 at 03:23 AM CET #

Post a Comment:
  • HTML Syntax: NOT allowed
About

This blog presents my personal thoughts and findings around the Oracle Database. These entries present the outcomes from experiences and testing regarding various technological aspects of the Oracle database. Opinions are my own and not necessarily those of Oracle Corporation.

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today