oracle day 1: first steps with oracle

recently I am familiarizing myself with the Oracle Database and I want to share my first impressions with you.

A good start seemed to me the free oracle-xe version. I started the install with this tutorial and everything worked quite straight-forward.

http://www.oracle.com/technology/software/products/database/xe/files/install.102/b25144/toc.htm

first error

I only got this error executing . /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin/oracle_env.sh

/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin/nls_lang.sh: 114: [[: not found

in the web I found the solution, the nls_lang.sh Skript uses bash-Commands, but the shebang tells “#!/bin/sh”, so just change the first line of the file nls_lang.sh to “#!/bin/bash”

/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin/nls_lang.sh

#!/bin/bash
....

commandline history for sqlplus

The first thing I recognized using the oracle-client sqlplus was, it had no command-history. Coming from mysql I really missed this, but a friend of mine Boris just told me the solution. Use rlwrap. This little magic tool adds command-line history to every program you like. To use it install it and then just call sqlplus like this:

rlwrap sqlplus

et voila. that’s all.

increasing linewidth

on a regular big screen you want to increase displayed linewidth to prevent automatic linebreaks scattering the data. Just enter this command on you sql-plus shell:

set lin 300;

this sets the linewidth to 300 chars which in my case was perfect.