This article will be about installing Oracle 11g on Ubuntu 10.04. This document will be separated into several sections and each section will be described in detail with screenshots from installation.
- Preparing pc for installation
I expect that user who wants to install Oracle database on Ubuntu, can works with Unix based OS. This condition is necessary for successful installation.
- First step is to find PC’s preferences (CPU, Memory, HDD€¦)
Switch to root:
$sudo su Password: #
- Memory requirements: At least 1 GB of RAM
To determine the RAM size, enter the following command:
# grep MemTotal /proc/meminfo
If the size of the RAM is less than the required size, then you must install more memory before continuing.
- swap space on disk:
To determine the size of the configured swap space, enter the following command:
# grep SwapTotal /proc/meminfo
To determine the available RAM and swap space, enter the following command:
To make some swap space, enter the following commands: 3GB should be sufficient.
# dd if=/dev/zero of=/.SWAP bs=100M count=30 # mkswap -v1 /.SWAP # swapon -p -2 /.SWAP
- Disk Space Requirements
To determine the amount of free disk space on the system, enter the following command:
# df -h
The following table describes the disk space requirements for software and data files for each installation type on Linux x86 and Linux 86-64
|Installation Type||Requirement for Software and data files (GB)|
|For x86 version|
|For x86-64 version|
- After we setup the requirements above, we need to install these required packages:
# apt-get update # apt-get install build-essential # apt-get install libaio1 # apt-get install libaio-dev # apt-get install libmotif3 # apt-get install libtool # apt-get install expat # apt-get install alien # apt-get install ksh # apt-get install pdksh # apt-get install unixODBC # apt-get install unixODBC-dev # apt-get install sysstat # apt-get install elfutils # apt-get install libelf-dev # apt-get install binutils # apt-get install lesstif2 # apt-get install lsb-cxx # apt-get install lsb-rpm
- To avoid errors we have to create some symbolic links:
# ln -s /usr/bin/awk /bin/awk # ln -s /usr/bin/rpm /bin/rpm # ln -s /usr/bin/basename /bin/basename
- The next step is to change the kernel parameter file, which is located at /etc/sysctl.con
It’s good to make a backup this file:
# cp /etc/sysctl.conf /etc/sysctl.original
Now modify the /etc/sysctl.conf: you can do that using some editor: vim, nano or do this:
echo "#">> /etc/sysctl.conf >echo "# Oracle 11gR2 entries">> /etc/sysctl.conf echo "fs.aio-max-nr=1048576" >> /etc/sysctl.conf echo "fs.file-max=6815744" >> /etc/sysctl.conf echo "kernel.shmall=2097152" >> /etc/sysctl.conf echo "kernel.shmmni=4096" >> /etc/sysctl.conf echo "kernel.sem=250 32000 100 128" >> /etc/sysctl.conf echo "net.ipv4.ip_local_port_range=9000 65500" >> /etc/sysctl.conf echo "net.core.rmem_default=262144" >> /etc/sysctl.conf echo "net.core.rmem_max=4194304" >> /etc/sysctl.conf echo "net.core.wmem_default=262144" >> /etc/sysctl.conf echo "net.core.wmem_max=1048586" >> /etc/sysctl.conf echo "kernel.shmmax=2147483648" >> /etc/sysctl.conf
Load new kernel parameters
- Now we add Groups and Accounts
groupadd oinstall groupadd dba useradd -m -g oinstall -G dba oracle usermod -s /bin/bash oracle passwd oracle groupadd nobody usermod -g nobody nobody
- We have to do some changes in /etc/security/limits.conf
We should do backup of this file:
cp /etc/security/limits.conf /etc/security/limits.conf.original echo "#Oracle 11gR2 shell limits:">>/etc/security/limits.conf echo "oracle soft nproc 2048">>/etc/security/limits.conf echo "oracle hard nproc 16384">>/etc/security/limits.conf echo "oracle soft nofile 1024">>/etc/security/limits.conf echo "oracle hard nofile 65536">>/etc/security/limits.conf
- Next step is to create Oracle directories:
mkdir -p /u01/app/oracle mkdir -p /u01/app/oraInventory mkdir -p /u02/oradata chown oracle:oinstall /u01/app/oracle chown oracle:oinstall /u01/app/oraInventory chown oracle:oinstall /u02/oradata chmod 750 /u01/app/oracle chmod 750 /u01/app/oraInventory chmod 750 /u02/oradata
2. Oracle 11g Installation
Firstly, we have to download Oracle 11g installation packages. We can do that from this address: http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html
For downloading Oracle software we have to create oracle account. Oracle account is for free so as the Oracle 11g (but we can use Oracle Database only for personal use. If you would like to use Oracle 11g database for commercial use, you will have to prepare a lot of money)
So after that you download 2 files of Oracle installation unzip these files:
# cd /your/Oracle/Zip/Files # unzip linux_11gR2_database_1of2.zip # unzip linux_11gR2_database_1of2.zip
Now we need to make sure that the server is running in the correct runlevel.
sudo init 3
after following command: sudo runlevel, you should see this:
- Finally we can start with installation:
(Once I tried to install Oracle11g on Ubuntu on Virtual Box, I got always the same error, when I execute ./runInstaller It says: Checking monitor: must be configured to display at least 256 colors€¦ I skipped this error and then I got following error: Exception in thread „main“ java.lang.NoClassDefFoundError and this was the end of the installation. If you get the same error just do this:
su> DISPLAY=:0 export DISPLAY xhost + su - oracle DISPLAY=:0 export DISPLAY
After that you should be ready for installation.
su oracle cd /your/Oracle/Zip/Files/database/ ./runInstaller
- After few seconds you should see Oracle Installer:
- Second step is about to Installation Options. I choose Create and configure database
- Because I installed Oracle on my notebook I choose option: Desktop class
- In fourth step you have to set the directories for oracle database installation. I suppose, you followed this tutorial and create directories, which I suggested you. If you did that, set the directories like at this screen. Administrative password should be strong (at least 8 letters)
- After setting typical installation, there are Prerequisite checks. There should be only indicated problems with packages. But these packages we’ve already install, so we can Ignore it All:
- The last step is installation of Oracle product. After cca. 30 minutes you should see this screen. As the form says, execute configuration scripts:
su /u01/app/oraInventory/./orainstRoot.sh /u01/app/oracle/product/11.2.0/dbhome_1/./root.sh
Now we can celebrate! The Oracle 11g is successfully installed on Ubuntu 10.04.
I hope that this tutorial somehow help you with installation. Of course, there are many possibilities where the installation could fail. In that case, you should go to web and search the forums with oracle Installation topics, as I did, when I wrote this tutorial.
Michal Horák, firstname.lastname@example.org CTU Prague