Category Archives: Geek Stuff

Computers, Linux, Oracle, whatever I happen to be working on at the moment.

SQLPlus Command Line History


Wow, I can’t believe I’ve not considered this before! SQLPlus is a great tool, I use it all the time as it’s great for doing little bits and pieces where you don’t need the tools in SQL Developer (which is my preferred client for most big stuff) or you don’t want to go to the trouble of starting up a GUI. My major gripe with it has always been it’s almost complete lack of a command line history feature which is astounding considering how long that kind of feature has been available for other shells (bash, psql, mysql, even the Windows Command Prompt since XP).
Anyway there is a workaround to ‘add’ the feature! You’ll need to install the ‘rlwrap’ package which is a

…wrapper that uses the GNU readline library to allow the editing of keyboard input for any other command. Input history is kept between invocations, separately for each command; history completion and search work as in bash and completion word lists can be specified on the command line.

You can get that from Sourceforge or in my case I found it in the Ubuntu Universe repository (there’s rpm’s on Sourceforge) so I just did:

$ sudo apt-get install rlwrap

You can call SQLPlus from rlwrap like this:

$ rlwrap sqlplus user@database

or to make things simpler use alias:

$ alias sqlplus='rlwrap sqlplus'

all done.

Oracle SQL Developer 3.0 on Ubuntu


This was one of my early posts and it seems the instructions work the same for the new October 2010 early release version of SQL Developer. (it was pretty straight forward anyway).

Grab the SQL Developer 3.0 RPM from Oracle (registration required):

You’ll need the Alien package to convert the SQL Developer .rpm to a .deb package and the Linux Standard Base (lsb) package and a Java Runtime in order to run the application.

$ sudo apt-get install lsb java-6-jre alien

Build the .deb package using alien:

$ sudo alien --scripts sqldeveloper-3.0.02.37-1.noarch.rpm

I did get one error doing the build but it completed successfully anyway:

error: incorrect format: unknown tag
sqldeveloper_3.0.02.37-2_all.deb generated

Install the .deb package:
sudo dpkg -i sqldeveloper_3.0.02.37-2_all.deb

And run the application for the first time, it should ask you where your JRE is, mine was in

/usr/lib/jvm/java-6-sun-1.6.0.22/

SQL Developer should now be installed in the Applications menu under Programing.

Broken Support


I love the way that the shiny new Flash based Oracle support site crashes silently at 96% loaded while I’m trying to log a service request on a production system, all the while telling me about the benefits of using ‘My Oracle Support’. One of which is allegedly ‘Improved System Stability’ Anyone fancy starting a ‘Bring Back Metalink’ campaign? It was clunky and awkward but at least it worked most of the time, or is that just my rose-tinted glasses?