Tuesday, April 27, 2010

Installing Oracle 10g database on Ubuntu 10.04 AMD 64

I am setting up my computer to be the development platform for the grep-i product. Though grep-i is open source, i still do believe that Oracle database is absolutely top of the line and offers a rich set of features missing in most open source databases. The most important of those is the pl/sql engine. I have coded in pl/sql for over 7 years now and I am not about to change now ;)


Oracle has the express edition which would have been my DB of first choice, except that there is no 64 bit version of this database. You can still install it if you are that keen with the following steps.



  1. Download the database 10g XE (universal) manually from http://www.oracle.com/technology/software/products/database/xe/htdocs/102xelinsoft.html
  2. Install using dpkg using the following command:


sudo dpkg -i --force-architecture /MY_DOWNLOAD_DIRECTORY/oracle-xe-universal_10.2.0.1-1.0_i386.deb
 I didn't want to do the force architecture part, so I decided to do this there hard way. The problem with direct installation of 10g on ubuntu64 is that even  though we have the 64 bit DB, by default Oracle doesnt support the debian architecture. I am documenting this as I am installing and hence I do not know how long this is going to be.

First things first, Oracle 10g requires your OS to be one of the following versions of linux:


redhat-3, SuSE-9, redhat-4, UnitedLinux-1.0, asianux-1 or asianux-2
For this verification it checks the following file /etc/redhat-release. This file simply doesn't exist in ubuntu. So create one and put redhat-3 in it.

Also, you need to have the following installed libaio1


sudo apt-get install libaio1

Now create a user oracle using the command :


adduser oracle
Download the Oracle 10g db files and gunzip and cpio -idmv < to get a directory called database. Move this directory to /opt

Give the ownership of that directory to the user oracle using the following command:


sudo chown -R oracle /opt/oracle/database
now log into the user account of oracle from gdm and run the executable /opt/oracle/database/runInstaller

and Voilah! the installer pops up. When you get an error just click "Continue".

We have some gcc incompatibilities with the ubuntu 10.04, bleeding edge that it is. But you might be able to fix most of these issues manually using this file:

/opt/oracle/product/10.2.0/db_1/cfgtoollogs/configToolFailedCommands
(I didn't do the above)

Now we need to set the paths.
Open up your /etc/profile file and  add the following lines to the bottom of the file:

#Oracle Library Paths
export ORACLE_BASE=/opt/oracle
export ORACLE_HOME=/opt/oracle/product/10.2.0
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib
export LD_LIBRARY_PATH
Now more config details:

Create the tnsnames.ora file at $ORACLE_HOME/network/admin as the following:


ORCL=
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1512))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = ORCL)
    )
  )
and the also create the listener.ora file (get a default listener.ora and edit to fill in your host specs.)

 Now bring up the listener using lsnctrl start


Now connect as sysdba and startup the database!


UPDATE: aargh! forgot that the kernel needs to have to have some parameters enabled as well. so i am back to force-architecture!! this does not work!!

No comments:

Post a Comment