I haven’t found any particularly good instructions on the Internet explaining how to do a 10g or 11g installation onto 64-bit Ubuntu (32-bit installations are a piece of cake… and even my own doris script has done those without trouble for a long time). Indeed, for a long time, I considered any such installation practically impossible -and used virtual Centos machines instead (where the 64-bit Oracle installation works flawlessly).
But times change: I use 64-bit Ubuntu as my OS at work and at home, and there are times when I don’t want to have to fire up a virtual machine just so I can do some Oracle experimentation. I’ve therefore been forced to work out how the Oracle installation can be made to succeed on that platform. I should say upfront that it’s still not a perfect installation: no matter what I do, I can’t get rid of an error in invoking target ‘collector’ of makefile ‘ins_emdb.mk’ message during the linking phase of the installation -but it is, at least, the only such error and it doesn’t seem to make any difference to the overall ability of the Oracle software to create, run and manage databases.
Here’s how I did it (and these instructions work for both 10g and 11g, with minor differences noted in the appropriate places).
Step 1: Perform a completely default Ubuntu 9.04 64-bit Desktop installation.
Step 2: Change the PC to use a static IP address rather than a DHCP-assigned one. That’s done by selecting System -> Preferences -> Network Connections. Select your network connection (for example, mine was under the “Wired” tab, called ‘Auto eth0′) and click Edit. Select the IPv4 Settings tab. Change the Method to Manual (from the default “Automatic DHCP”). Click Add and then specify an appropriate value for your Address (e.g., 192.168.0.100), Netmask (e.g., 255.255.255.0) and Gateway (e.g., 192.168.0.1). The Gateway’s especially important because if your Ubuntu machine cannot connect to the Internet, you won’t be able to download the necessary software prerequisites. If your Ubuntu machine is connected directly to the Internet, then of course you leave the Gateway blank. Otherwise, it’s the IP address of your router (or its equivalent, depending on your physical network setup). Also set up a suitable value for your DNS Server and Search Domains. Your DNS Server will either be an internal one if you’ve got one, or the one your ISP provides you with. The Search Domains entry should be the name of your internal network (such as ‘dizwell.home’) if you’re using an internal DNS Server: it’s basically the domain name for which the DNS Server you’ve just specified is authorative. If you don’t have an internal DNS Server, your Search Domains entry can be set to the domain name of your ISP (siuch as ‘telstra.com’).
Once that’s done, make your /etc/hosts file reference your static IP address by machine name. That is, issue the command
sudo gedit /etc/hosts
…and change the top part of the file from this:
127.0.0.1 localhost
127.0.1.1 heracles
…to this…
127.0.0.1 localhost
127.0.1.1 heracles
192.168.0.100 heracles
That is, my Ubuntu machine was created with a hostname of ‘heracles’. By default, that name is only mapped to a loopback address of 127.0.1.1. I’ve just set my IP address to be a static one of 192.168.0.100, so now I’m saying that the new IP address should also map back to my hostname. You obviously change the specific numbers and names used in the file to suit your own situation.
Step 3: Install the necessary software prerequisites:
sudo aptitude update
sudo aptitude install gcc libaio1 lesstif2 lesstif2-dev
make libc6 libc6-i386 libc6-dev-i386 libstdc++5
lib32stdc++6 lib32z1 ia32-libs sysstat rlwrap
unixodbc unixodbc-dev elfutils rpm
(That should all be on one line, of course).
Step 4: Append appropriate entries to the following configuration files…
/etc/sysctl.conf
kernel.shmall = 2097152
kernel.shmmax = 2147483648
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default = 262144
net.core.rmem_max = 262144
net.core.wmem_default = 262144
net.core.wmem_max = 262144
vm.swappiness=5
/etc/security/limits.conf
* soft nproc 2047
* hard nproc 16384
* soft nofile 1024
* hard nofile 65536
(Make sure to add those lines before the “# End of file” one).
/etc/pam.d/login
session required pam_limits.so
Step 5: Create the Oracle User and all appropriate installation directories
sudo sysctl -p
sudo groupadd nobody
sudo groupadd oinstall
sudo groupadd dba
sudo useradd -s /bin/bash -g oinstall -G dba oracle -m
sudo passwd oracle
(…and supply a password for the oracle user when prompted)
sudo mkdir -p /u01/app/oracle/product/10.2.0/db_1
sudo chown -R oracle:oinstall /u01/app
sudo chmod -R 775 /u01/app
Step 6: Create necessary symbolic links
sudo ln -s /usr/bin/awk /bin/awk
sudo ln -s /usr/bin/rpm /bin/rpm
sudo ln -s /lib/libgcc_s.so.1 /lib/libgcc_s.so
sudo ln -s /usr/bin/basename /bin/basename
Step 7: Set appropriate environment variables for the oracle user
sudo gedit /home/oracle/.bashrc
…and then past these lines onto the end of that file:
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1
ORACLE_SID=ubu102
export ORACLE_BASE ORACLE_HOME ORACLE_SID
PATH=$ORACLE_HOME/bin:$PATH:.
export PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
export LD_LIBRARY_PATH CLASSPATH
alias sqlplus='rlwrap sqlplus'
Note that the above lines assume that you will call your starter database ‘ubu102′. If you want to call it something else, set the ORACLE_SID environment variable appropriately now. Also note that the above content assumes you are installing 10g (it has a ‘10.2.0′ bit in the ORACLE_HOME setting). If you’re installing 11g, that should be replaced with ‘11.1.0′.
Step 8: Become the Oracle User and commence the installation
sudo xhost +
su - oracle
export DISPLAY=":0.0"
/media/cdrom/runInstaller -ignoreSysPrereqs
Note that last command assumes you have created a proper installation CD from the 10gR2 cpio/zip file download. I describe how to do that here.
For the most part, you then just keep clicking [Next] through the Oracle Universal Installer’s screens. You’ll need to change the proposed database name to match what you typed for the ORACLE_SID in Step 7 (in my case, therefore, I changed the proposed ‘orcl’ to ‘ubu102′). You will, of course, fail all of the system tests that the OUI might try to do, but you can click through those regardless and confirm that you know what you’re doing: the thing will work correctly anyway.
As I mentioned at the beginning, you will see an error during the linking phase (relating to ims_emdb.mk) -at least, you are very likely to! I’ve had a couple of installations where no errors at all were raised, but others (following the same instructions, mind!) did. Go figure! If you happen to be unlucky enough to get a linking error, simply click ‘Continue’ when it appears, and the installation should proceed to completion without further incident, correctly creating appropriate networking configurations and a starter database. I wouldn’t call that a particularly robust installation -and there’s no way I’d want to run anything even vaguely of ‘production quality’ on the result! But it does at least work -to the point where I’m running a useful test database on my Ubuntu installation at work, including a very large and demanding Oracle Text index, without any apparent problems.