June 8th, 2008


8
Jun 08

Install Oracle 10g Express Edition in Ubuntu Hardy

Oracle 10g Express Edition is one of the best ways to learn Oracle SQL and the ‘Oracle Architecture’ without much consumption of your system resources and space unlike an Enterprise Edition.

Installing Express Edition in Linux is fast and easy unlike that in Windows.Guess, that is what makes Linux so efficient and robust.

First download the debian package from Oracle after accepting the license agreement. If you would be using Oracle 10g XE on your personal computer or laptop, you should go about downloading the Oracle Database 10g Express Edition (Universal) debian package (*.deb).

When the download is complete, open a terminal window and issue the command:
sudo dpkg -i oracle-xe-universal_10.2.0.1-1.0_i386.deb

Once the installation is done, it is required to configure the XE server by issuing the command: sudo /etc/init.d/oracle-xe configure

During configuration, you are prompted to enter information for the following:
1. A valid HTTP port for the Oracle XE graphical user interface/database homepage (default port is 8080)
2. A valid port for the Oracle database listener (default is 1521)
3. Password for the administrative accounts sys and sysdba and
4. If you want the database to start automatically at system start-up

With appropriate responses for the above prompts, the configuration is complete and you have a fully functioning ORDBMS on your system.

Working on Oracle is fun, when you key in queries at the command line rather than using a graphical user interface. You can access the SQL Command Line interface from Applications -> Oracle Database 10g Express Edition -> Run SQL Command Line.

There’s yet another way to access the SQL command line, which is from the terminal session. To fire up an SQL session from the terminal window, you have to set up a few environment variables in the /etc/bash.bashrc file. Add the following lines at the end of the file:

<span style="font-size:100%;">ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/server<br />PATH=$PATH:$ORACLE_HOME/bin<br />export ORACLE_HOME<br />export ORACLE_SID=XE<br />export PATH</span><br />
Save the file, fire up a terminal session and issue the command sqlplus which will prompt for a database user name and password, which should give a SQL prompt on successful login.

As a superuser, you can start, stop, restart and check status of the Oracle XE service from the CLI using:
/etc/init.d/oracle-xe {start|stop|restart|forcereload|configure|status|enable|disable}

To check the version of SQL*Plus: sqlplus -V
For help on usage: sqlplus -H

To view a list of features that are enabled and disabled in the express edition, use select * from v$option order by parameter;

Please drop in a comment, if there is any ambiguity in the procedure described above.