There was an error in this gadget

Monday, January 19, 2009

Installing Oracle 10g on Ubuntu Hardy

Now you might wonder why I would need to install Oracle on Linux, but I just wanted to see if it could be done... obviously it can be done !
Here it is :

Add the following repository to the "/etc/apt/sources.list" file using the following command to open the file in any editor:

$ gksudo gedit /etc/apt/sources.list


Goto the very end and paste the following line:

deb http://oss.oracle.com/debian unstable main non-free


Open up the terminal and paste the following lines one after the other:

$ wget http://oss.oracle.com/el4/RPM-GPG-KEY-oracle -O- | sudo apt-key add -
$ sudo apt-get update
$ sudo apt-get install oracle-xe


After installation the oracle db needs to be configured.
$ sudo /etc/init.d/oracle-xe configure


The configuration will ask you for
1. HTTP port for the application (default is 8080 which conflicts with GlassFish or Apache Tomcat, hence I chose 33333 !!!)
2. Port used for the database listener (kept the default 1521)
3. The PASSWORD for the username 'system' with which you will login (DO NOT forget this password)
4. Whether you want the database to run at startup ( I chose no)

The configuration completes (may take some time) & you are ready to go.

To start the database:
$ sudo /etc/init.d/oracle-xe start


To stop the database:
$ sudo /etc/init.d/oracle-xe stop


This installation also adds a menu under "Applications" . If you want to start/stop the database using the GUI, you will need to add your user to the usergroup 'dba'. After this the database can be started/stopped using the GUI options.

You can then run the command-line tool SQL Plus. At the prompt type:
connect username/ password

(username can be 'system' or 'sys' and password is the password specified during the configuration

OR
You can use the interface via the browser using the address:
(Use your own port number instead of 33333)
http://127.0.0.1:33333/apex
Login with the same credentials as above.


Thats it. You can run all your SQL queries now :)

EDIT:
This is where I got my howto

http://www.oracle.com/technology/tech/linux/install/xe-on-kubuntu.html

EDIT 2:

If you want to install the oracle deb file separately (offline), you will need to download & install the libaio package using the command:

$ sudo apt-get install libaio



Edit 3:

If you are having problems starting, stopping and using the web interface(http://127.0.0.1:33333/apex) as mentioned above you could follow the steps below:

To start the Database server
Applications -> Oracle 10g -> Start Database
To Stop the Database
Applications -> Oracle 10g -> Stop Database

To run SQL commands (after you have started the Database) :
Applications -> Oracle 10g -> Run SQL Command Line

Hope this helps as well !

6 comments:

  1. Hi,

    This is really an excellent post. I had been trying to figure out how to install Oracle on Ubuntu 9.1. I had used Oracle 9i on RedHat Enterprise Linux and on Windows, but that wasn't on my computer. This post has really helped me a lot in installing the software on my system. Thanks a million. But the only problem is I am not acquainted with Oracle 10g, however I think I would get familiar with this one too in due course of time.

    Keep posting!

    ReplyDelete
  2. Hi, I am trying to connect to the server, but the page shoes an error that although it seems to be a valid site, Firefox cannot establish a connection. What do I do? It is really urgent.

    ReplyDelete
  3. You mean via this link http://127.0.0.1:33333/apex ?

    Actually I have faced similar problems with the web interface a few times. What you could do is in:
    Applications -> Oracle 10g -> Start Database

    Similary to Stop the Database choose "Stop Database" in the above menu

    Also you can use the command line interface like MySQL and PostgreSQL by "Run SQL Command Line" after you have started the Database

    ReplyDelete
  4. Excellent post. I never thought oracle installation on ubuntu would be so easy.

    ReplyDelete
  5. you have a nice site. thanks for sharing this valuable resources. keep it up. anyway, various kinds of ebooks are available here

    http://feboook.blogspot.com

    ReplyDelete
  6. Excellent post. Just one question. Can I create multiple databases with this version of Oracle?

    Rochan

    ReplyDelete

Follow this blog !!!