Hey all, Having been using Ubuntu on my home PC for about 18 months I’ve finally switched my work PC too, There’s a load of stuff I need from Windows so I have a VM of XP running too but I want as much as possible in the host Ubuntu system. I looked high and low for a how-to for the Oracle client tools to no avail so I adapted this how-to on installing the Oracle Database 10g on Ubuntu 5.10. Note that I’m using the 10g r2 Oracle tools as I’m only working on 10g r2 databases for the moment:
Activate the root account:
First off, as the installer and other steps are required to be done as root I suggest you unlock the root account. You can just use sudo but I found it easier this way
$ sudo passwd root
Install required packages:
You’ll need all of these to get the installer to work properly:
# apt-get install gcc make binutils lesstif2 libc6 libc6-dev rpm libmotif3 libaio libstdc++5 gawk alien libg++2.8.1.3-glibc2.2 ksh gcc-3.3 g++-3.3 libstdc++5
You’ll also need to add the /etc/redhat-release file to trick the installer into thinking that you’re running a supported OS.
echo "Red Hat Linux release 4" > /etc/redhat-release
Directories, users and groups:
create the ORACLE_BASE directory where you want the installation to go
# mkdir -p /u01/app/oracle
then create the oracle user, the dba and oinstall groups and change the owner of the target directory. We’ll also need to add the nobody group because Ubuntu sets the nobody user as a member of nogroup but the installer expects it to be a member of the nobody group.
# addgroup oinstall
# addgroup dba
# addgroup nobody
# useradd -g oinstall -G dba -p password -d /home/oracle -s /bin/bash oracle
# usermod -g nobody nobody
# chown oracle:oinstall -R /u01/app/oracle
Simlnks:
The Oracle installer apparently uses absolute paths for some of the binaries which are stored in a different place in Ubuntu to where Oracle expects so we need to create simlinks so it can find them
# ln -s /usr/bin/awk /bin/awk
# ln -s /usr/bin/rpm /bin/rpm
# ln -s /usr/bin/basename /bin/basename
Run the installer:
Now, logged into gnome as the oracle user download the Oracle client tools and unpack to a staging directory then start the Oracle installer.
$ mkdir ~/stage
$ unzip 10201_client_linux32.zip ~/stage
$./runinstaller
Once the install is completed you need to add the appropriate environment variables, I added the following lines to /etc/profile so that all users on the system get them:
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/oracle/product/10.2.0/client_1
export ORACLE_SID=YOURSID
export PATH=$PATH:/u01/app/oracle/product/10.2.0/client_1/bin
and finally configure the $ORACLE_HOME/network/admin/tnsnames.ora file for your environment. If you want a different user other than oracle to use the tools you’ll need to add them to the oinstall and dba groups.