This howto should guide you though the installation of an Oracle Database 11g Release 2 on Ubuntu 12.04.
Ubuntu is not officially supported by Oracle so there will be a few tweaks to achieve a working solution.
I hope this might help you if you aim for a similar task.
Before we start with this Chapter I assume you have a clean Ubuntu 12.04
Server up and running. If that is not the case please check out my previous
post Ubuntu 12.04 LTE Server on Virtualbox 4.1 installation.
first download the full Version of Oracle 11gR2 for linux OS from the Oracle side. Safe the 2 files somewhere
on your local PC. We will transfer them later to the VM.
We have to install a few required packages for Oracle. Best way to install those is to use the standard
debian package manager. As I have installed Ubuntu on my Server and work primary on my MacBook Air
I will open a Terminal session and SSH into the Server as root. You can of course also just enter the
commands direct into the VM’s terminal to install the following packages:
check your /etc/hostname that it looks like below:
and also check that in /etc/hosts the below line is present:
For the installation we need a minimum of 1GB physical memory which we define when we setup the
Virtual Machine earlier, else you can check it with the following command:
Because the Oracle installation is demanding in resources we create some temp swap-space that will
disappear after a reboot. Bare that in mind, if you reboot the Server before completing the Oracle
installation you have to redo the below steps.
Check your current swap-space with this command:
Now let’s create a temporary swap file for the installation.
Execute the command again to confirm the added swap-space
Shared Memory is also important for Oracle, else you might face some ORA-00845 errormessages.
Check your current Shared Memory with this command:
If you have less than 512MB edit /etc/fstab and add (either 1024M or 1512M) I am adding here 1.5GB
by adding the following line:
After remount and check the new size once again:
remember we did not create any Users with our Ubuntu installation so lets do that now
Oracle requires additional kernel parameters, you either create a new kernel parameter file or add it to
the existing system kernel. I choose to add them to the existing system file. So lets make first a backup
Backup the original system file /etc/sysctl.conf by executing:
Execute the following command to simply paste in the parameters:
Now cut and paste the following
then press Ctrl-d to write the file
kernel.shmmax = max possible value, e.g. size of physical RAM.
Verify the above with:
and load the new Kernel parameter with the following command:
Verify the new kernel settings:
that should return — fs.aio-max-nr = 1048576
Before we now set the Oracle limits lets backup the original file:
Next add the following limits to /etc/security/limits.conf:
cut and paste the following and then write to the file with Ctrl-d
Check/add if the following line exits within /etc/pam.d/login
Check if the following line exits within /etc/pam.d/su
It’s time to create some directories for Oracle and set the permissions.
Add following lines to /var/lib/oracle/.profile
We are creating here a AL32UTF8 database, so change this to US7ASCII if you want to create and
ASCII database. This will also map Oracle’s /bin to your $PATH to run Oracle’s binary directly at login:
As mentioned before , Ubuntu is not listed as Oracle officially support platform and so we need
to fake it by creating symbolic links:
Mask ourself as RedHat:
We discussed in the pre-post PuTTY, so we going to use that now to copy the files over to the Server.
Copy the file 2 files (linux.x64_11gR2_database_*.zip to oracle’s home directory and unzip them
In case that cp don’t work use the scp command that comes with PuTTY to copy the files over.
Before we can do that we have to export the Display on our Ubuntu Server as root.
Go to your Ubuntu VM and login as root if not already and execute the following commands:
Next go back to PuTTY session and login to the Server as oracle (su – oracle if you are already as root).
No change to the database directory and start the installer with the following command:
At the first screen of the Oracle Installer you can add your support Account if you have one, In case
you don’t just leave it empty and remove the default tick box for the email.
At the next tab [Select Installation Option] – choose the first setting Create and configure a database:
In [System Class] – choose Server Class:
In [Node Selection] – choose the option Single instance database installation:
In [Select Install Type] – choose Advanced install:
In [Select Product Languages] – choose to install at your demand I select all available languages:
In [Select Database Edition] – choose Enterprise Edition:
In [Specify Installation Location] – the default settings should be as below:
Oracle Base: /u01/app/oracle
Sofeware Location: /u01/app/oracle/product/11.2.0/dbhome_1
In [Create Inventory] – it should default as below:
Inventory Directory: /u01/app/oraInventory
oraInventory Group Name: oinstall
In [Select Configure Type] – choose General Purpose / Transaction Processing:
In [Specify Database Identifiers] – configure as below:
Global database name: AL32UTF8.localdomain
Oracle Service Identifier (SID): AL32UTF8
In [Specify Configuration Options] – configure as below:
Memory -> Enable Automatic Memory Management: TRUE
Character sets: Use Unicode (AL32UTF8)
In [Specify Management Options] – choose Use Database Control for database management
and leave the rest as default:
In [Specify Database Storage Options] – choose File System where:
Specify database file location: /u01/app/oracle/oradata
In [Specify Recovery Options] – choose Do not enable automated backups:
In [Specify Schema Passwords] – choose to your passwords and write them down:
In [Privileged Operating System Groups] – confirm as below:
Database Administrator (OSDBA) Group: dba
Database Operator (OSOPER) Group: oinstall
In [Preform Prerequisite Checks] – just simply ignore all warning message
(since we are using Debian but not Oracle officially supported OS):
So just confirm everything in Summary:
And now let’s go for a coffee/tee break – you deserve it
Special note for Ubuntu 12.04: If you face error during installation so update as below:
When you see the above error, open a new session to the Server and execute the below commands:
Then press Continue and keep going …
Now following the instructions and run the following commands with root user:
/u01/app/oraInventory/orainstRoot.sh
/u01/app/oracle/product/11.2.0/dbhome_1/root.sh
Confirm with installation progress
In previous screen the installer mentioned that we can access Enterprise Manager Database Control URL
from https://localhost.localdomain:1158/em, so now let’s open the browser and test it with following account:
User Name: SYS
Password: your_secret_password
Connect As: SYSDBA
Once login it should show as below:
I like if everything boots up automatic so lets configure Oracle to start during system boot. You can of course
turn this feature later off, but the init.d script is very useful too. First we need to specify which database
instant will be started together with Oracle. (of course this is the first but maybe you have already done
this a few times).
Edit /etc/oratab as below:
Now lets create the init.d script as /etc/init.d/oracle
copy and paste all below and complete it with Ctrl-d
Set the Permission:
Finally we need to install the script so Oracle will start during system bootup:
NOTE: You may find the following error message during /etc/init.d/oracle/stop:
Shutdown Oracle: ulimit: 25: bad number
You can then update /u01/app/oracle/product/11.2.0/dbhome_1/bin/emctl
with #!/bin/bash to solve the problem: