Oracle – for when it was like that when you got there

Main menu

Post navigation

Installing Oracle 11gR2 on Ubuntu 9.10

Finally, I’ve got everything in place for the big one – installing 11gR2 on my Ubuntu server.

NOTE – if you’ve stumbled across this post in search of instructions for installing Oracle XE 11g on Ubuntu, you can find installation steps here.
As far as the server is concerned, I’ve posted on everything I’ve done since I installed it onto the machine.
The pre-requisites for this Oracle installation were :

Installing the server and setting up sshTunneling X over SSH
I also setup a SAMBA share on the server. This is not directly relevant to the Oracle setup but I’ve included a link to it here as it serves to complete the picture of the state of the server before I started the installation. It also has a section on mounting a USB stick on the server, which may be relevant when it comes to transferring the Oracle files onto the server.
Whilst I’m mentioning links, I should acknowledge the helpful information I got from here and especially here.

Whilst I’m here, I probably don’t need to mention that Oracle isn’t exactly supported on Ubuntu at the time of writing, so I assume that, if you are planning to go down this route, it’s for your own edification and amusement. If your planning to setup a production database environment, then you really should be doing so on a supported OS.

One final, but pertinent point to note is that, like many of my recent adventures with Ubuntu Server, this was achieved after a certain amount of trial and error. I know Oracle pretty well. However, I make no claims to being a linux expert. The steps that follow worked for me. That doesn’t mean that there’s not an easier/better/safer way to do it.

Pre-Requisite Checks

First stop are the pre-checks as recommended in the Oracle Installation Guide.
Once you’re happy that you’ve got the tin to do the job, it’s time to get the software.

Getting Oracle

Unfortunately, there’s no rpm package for this version, so you need to download 11g release 2 from here.
As I’m running the 32-bit server, I got the Linux x86 version of Oracle Database 11g Release 2 ( 11.0.2.0.1.0)

As you’ll notice from my previous posts, the server was prone to get a little unhappy when copying large files or large amounts of data generally to it from an external device. However, extracting the compressed download files worked fine.
To achieve this, I downloaded the required files onto a trusty memory stick, mounted it on the server, then unzipped it.
The files are in zip format, so I needed to get the unzip package :
sudo apt-get install unzip

Now with the USB mounted on /media/external (have a look here if you need details on how to do this):

This should extract the files in the zips into a newly created directory called database under /media.

NOTE – it’s probably a good idea to make sure all is working as expected after unzipping the first file – i.e. that the database directory has been created and that all of the files have been extracted under that directory.

Updating the packages on the Server

Connect to the server, switch to root and update the packages currently on the server
sudo -su
apt-get update

Once this is done, reboot the server so we’re sure that all the changes take effect.
# reboot

Getting Required Packages

Connect to the server again and ( as root) download some more packages ( I’ve listed these as one command at a time to make it easier to read) :
sudo su -
apt-get build-essential
apt-get libaio1
apt-get gawk
apt-get ksh
apt-get libmotif3
apt-get alien
apt-get libtool
apt-get lsb-rpm

NOTE – the following packages are also required for the Oracle install, but they were already present on the server :

In order to make sure that all of these settings had taken effect, I did a reboot at this point :
sudo reboot

Installing the Oracle Software

Now, cross everything, check that you are indeed wearing your lucky underpants…time to do the install.
Start a terminal session on the client and ssh into the and check the setting
ssh -X administrator@server

First, we need to get the value of the DISPLAY variable as we’ll need to set it when we su to the oracle user so that the installer GUI will run on the client ( remember, we have no X-Windows desktop on the server).
echo $DISPLAY
localhost:10.0

Now we need to make sure that the server is running in the correct runlevel
sudo runlevel
N 2

The last number in the output of the runlevel command is the current runlevel.
The server is currently at runlevel 2, we need it to be at 3 so :
sudo init 3
sudo runlevel
2 3

NOTE – at this point, I opened a separate ssh session on the server and su’d to root on that session, just in case I hit any issues during the installation process. On the fifth attempt to get the install to work this changed into for when I hit issues.

Please bear in mind that these screenshots were taken over numerous installation attempts so the step numbers displayed at the top may not match up to what you see. However, the screens themselves should be the same as the ones below.

Oracle Installer - screen 1

Uncheck the I wish to receive security updates via My Oracle Support – if you’re installing on Ubuntu, your doing it for your own research purposes so aren’t going to have paid for Oracle support anyway.
Click Next

Installer Step 2

We’re just going to install the software at this point, so select Install database software only ( as per the screenshot above) and click Next

Installer Step 3

We’ve got enough on our plate just trying to persuade oracle to work on this platform, so let’s keep it simple and just go for Single database installation.
Click Next

Installer Step 4

English (United Kingdom) ? Surely this should read English( Proper, not that strange dialect they use in The Colonies across the Atlantic). Enough of the jingoism, make the appropriate selection and click Next.

Installer Step 5

We’re going for Enterprise Edition. Click Next
Steps 6, 7 and 8 should provide you with default suggestions, which I accepted in each case.

Installer Step 9

This is where it gets a bit interesting. The first time I tried this, I hadn’t set all of the parameters in sysctl.conf and limits.conf to oracle’s liking. Some of these come up as fixable and the Fix & Check Again button is enabled.
If you click this, Oracle will direct you to a script that you can run as root to correct the problems :

Installer Fix Scripts

If you do go down this route, hit Check Again once you’ve run the script(s).
As you can see, the installer complains about a number of things which you can by-pass by checking the Ignore All checkbox in the top left-hand corner.

Note, for the record, oracle complained about the following packages being missing ( which I ignored) :

At this point, I did select Save Response File, just in case I needed to try a silent installation. Fortunately, I didn’t, but it’s probably worth doing, just in case.
Click Finish

Installer Progress

This will take a while, but at least you get a progress bar.
Once it’s all completed, click Next and you get this confirmation

Installer Final Screen

Click Finish
Celebrate with a beverage of your choice…but not too much, we still need to create a database.

Creating a database using Database Configuration Assistant

First of all, we need to get another package. On the server :
sudo apt-get lesstif2

Now we can run the Database Configuration Assistant ( DBCA).
This time, connect to the server as oracle :
ssh -X oracle@server

Make sure that the DISPLAY variable is set. If not, set it to the value it was for the software installation. So, if it was localhost:10.0 for that session then :
export DISPLAY=localhost:10.0
echo $DISPLAY
localhost:10.0

now we just need to fire it up :
cd $ORACLE_HOME/bin
./dbca

Just click through the first couple of screens until you get to :

DBCA Screen 3

Hot Tip : when you pick a Global Database Name and SID here, make sure it’s no longer than 8 characters.
If you’re foolish enough to pick one with more characters ( such as orakarmic, to take a completely random example), you’ll find that, when you come to check your new database, it thinks it’s called ORAKARMI, at least, in v$instance.
On reflection, orakoala would probably a better, not to mention fluffier, choice.
Anyway, once you’ve chosen a database name, click Next.

DBCA Screen 4

Uncheck the Configure Enterprise Manager box here. Once again, we want to keep things as simple as possible.
Click Next

DBCA Screen 5

Choose your passwords. Obviously, it’s a good idea to make a note of them at this point !
Click Next through the next few screens until you get to :

DBCA Screen 8

I’d like the sample schemas installed.
Keep clicking next until…

DBCA Screen 11

Click Finish
At this point, you should get a nice screen confirming what dbca is going to do. You should do.
I haven’t got a screenshot of this because dbca popped up a blank screen. I’m not sure whether this was Java having a sulk, or some problem with my setup.
Although nothing was displayed, I managed to get past this screen by randomly clicking in the bottom third of the window until I evidently managed to hit the relevant button…because I then got this screen :

Something's happening but we're not going to tell you what

Yes, it’s supposed to have a prograss bar on it, but all I got was the animated gif. Eventually however, Java decided to behave itself once more and displayed :

Eureka !

Nearly done. One final ingredient required. What’s that you say ? More beer ? Good guess…

Post Installation Configuration

We want to make sure that any sessions we start on this server have the correct environment variables set, so edit /etc/profile and add :

Now make the script executable and set it to run at boot time :
chmod a+x /etc/init.d/oracledb
update-rc.d oracledb defaults 99

Testing Server Changes

Connect via ssh as oracle, check that the environment variable changes in /etc/profile have been picked up :
ssh oracle@server
echo $ORACLE_HOME
orakarmic

Now we want to test our script. First off, we need to shutown the database :
export ORACLE_SID=orakarmic
sqlplus / as sysdba

SQL> shutdown immediate

SQL> quit

Now connect to the server as the administrator and run the script
ssh administrator@server
sudo /etc/init.d/oracledb start

This should start the TNS Listener and the database. To check :
lsnrctl status

The output of this command should include the line :
Service "orakarmic.server" hasd 1 instance(s).
Instance "orakarmic", status READY, has 1 handler(s) for this service...

You should also be able to connect to the database via SQL*Plus as before.

If you now reboot the server, you can then verify that both the listener and the database have started correctly :
ssh oracle@server
lsnrctl status
export ORACLE_SID=orakarmic
sqlplus system/password
SQL> select status from v$instance;

The query should return a status of OPEN.

Connecting to the database from a client machine

And finally…

The client needs to have an oracle client or similar installed.
There should be a file called tnsnames.ora in $ORACLE_HOME/network/admin.

Simply add an entry for your new database in this file. It will something like this :

This is an excellent article. I was finally able to install oracle 11g on my ubuntu server. I tried for a week to install in silent mode, but was unsuccessful. Everything seems to be working fine so far.

I nearly followed the same way you followed but I handled prerequisites with GOAL script from Howard Rogers

One thing as an addition for enterprise manager console, it gets “ulimit -25 bad limit” problem when you are in bash even if you sorted all the limits with initial configuration. The solution I used to change $ORACLE_HOME/bin/emctl file to run in bash.

Exception in thread “main” java.lang.NoClassDefFoundError
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:164)
at java.awt.Toolkit$2.run(Toolkit.java:821)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.Toolkit.getDefaultToolkit(Toolkit.java:804)
at com.jgoodies.looks.LookUtils.isLowResolution(Unknown Source)
at com.jgoodies.looks.LookUtils.(Unknown Source)
at com.jgoodies.looks.plastic.PlasticLookAndFeel.(PlasticLookAndFeel.java:122)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:242)
at javax.swing.SwingUtilities.loadSystemClass(SwingUtilities.java:1783)
at javax.swing.UIManager.setLookAndFeel(UIManager.java:480)
at oracle.install.commons.util.Application.startup(Application.java:758)
at oracle.install.commons.flow.FlowApplication.startup(FlowApplication.java:164)
at oracle.install.commons.flow.FlowApplication.startup(FlowApplication.java:181)
at oracle.install.commons.base.driver.common.Installer.startup(Installer.java:265)
at oracle.install.ivw.db.driver.DBInstaller.startup(DBInstaller.java:114)
at oracle.install.ivw.db.driver.DBInstaller.main(DBInstaller.java:132)

At the risk of stating the obvious, it looks like the Oracle Installer ( which is a Java application) can’t find Java.
When I did this I was running the installer on the client I connected from. I guess the only practical thing I can suggest is that you check that java is installed on the client by typing java -version at the prompt. When I do this I get :
java version “1.6.0_15″
Java(TM) SE Runtime Environment (build 1.6.0_15-b03)
Java HotSpot(TM) Server VM (build 14.1-b02, mixed mode)

nice walkthrough
I found that a clean ubuntu 9.10 server installation is missing
libstdc++.so.5
I had to find/download/install this before being able to resume the installation. a bit surprised that no-one else has encountered this, I presume others upgraded to 9.10 from previous releases which left libstdc++.so.5 in place
kudos also to the pythian walkthrough for 11gr1 on 9.04 which I like very much

It was great to explain everything and also the comment mentioning that libstdc++.so.5 may be missing. Yes, everything worked prefect except that libstdc++.so.5 was really required. so I downloaded and installed it (http://packages.debian.org/lenny/amd64/libstdc++5/download) and the error during linking ‘error in invoking target install of makefile … ins_ctx.mk…
thans everyone for the support

On the client :
– first, check to see if the $ORACLE_SID environment variable is set. If not, then you need to specify the database name your connecting to. So, in Terminal, you would need to type :
sqlplus username/password@database

– second, make sure that the entry you have for the database in the tnsnames.ora ( in $ORACLE_HOME/network/admin) is correct – i.e. it’s pointing to the correct host and has the correct database sid.

On the server :

– check that the listener is up and running for your instance. In terminal :

Hi,
first of all thanks for your comprehensive guide. I was being able to install 11g R2 just fine on my machine.
BUT
Did you also try to use the Oracle Warehouse Builder? I am stuck at the OWB Design Center, which doesn’t display anything but a blank window after login.
I had the same issue with SQL Developer, but fixed this with adding the right path to the JRE. But OWB uses it’s own JDK /JRE files in ORACLE_HOME.
You have a suggestion how to solve this?

unfortunately I’ve not used OWB and don’t really know too much about it. Beyond fiddling around with the Java environment variables ( which it looks like you’ve already tried) I can’t really offer any ideas beyond hitting it with a big stick. On the plus side, the people who read this blog tend to be a lot smarter than me, so hopefully one of them will be able to enlighten us.

I’m the product manager for Warehouse Builder. The Design Center client pieces won’t run on 64-bit linux. You will have to run them in a 32-bit linux environment, or in 32-bit Windows (we don’t support 64-bit windows either).

The issue with the blank dialog windows in dbca is fixed by disabling visual effects in Gnome’s “Appearance” preferences. Otherwise using a lightweight environment like LXDE doesn’t have this problem either.

the section Post Installation Configuration is the bit where the environment variables get set.

In addition to the environment variables mentioned there, you may also want to set the $ORACLE_SID, if your server isn’t going to have more than one Oracle instance on it :
export $ORACLE_SID=mydbname
where mydbname is the name of your instance.

I think that this may be related to your problem with environment variables.
The oracle home directory should be included in the $PATH environment variable otherwise Linux won’t know where to look for the imp executable.
To check this, at the $prompt type :

strange – the scott schema should be there ( it was when I installed it). Maybe the login is disabled ?
If it really is missing, then you can re-create it by running $ORACLE_HOME/rdbms/admin/utlsampl.sql as a DBA user ( such as SYSTEM).
Note that this script does attempt to drop users that don’t already exist so you’re likely to get some errors. It will however re-create the scott schema.

as far as the scripts go, you can use /etc/init.d/oracledb stop on the server to stop both the database and the tnslistener ( provided you have the appropriate environment variables set. If you want to shutdown the database only, you can just su to oracle then, ensuring that the $ORACLE_SID is set, simply do :sqlplus / as sysdba and type shutdown immediate at the SQL prompt.
If this isn’t what you were looking for, could you be a bit more specific ?
Thanks,

And in English…
You can try to install on Ubuntu 10.04 desktop but I have not tried this.
Perhaps a better option would be to install Oracle 10g Express Editions. Instructions on how to do this can be found here .

Really helpful blog ! I installed it on 10.04 with little problems thanks to the blog .
As regards the dbca blank screen I came across this on OTN .
Blank windows in the Oracle Database Creation Assistant (DBCA)
Disable Visual Effects using System -> Preferences -> Appearance, Visual Effects

I am trying to install oracle 11g 2 on Ubuntu 14.04. While Installation I get error when performing prerequisite checks. I tried to run the fixup scripts but got the following error message. “The value for semmni in response file is not greater than value of semmni for current session. Hence not changing it. ” But I have set semmni with the required value.
I tried to ignore and continue to instal but got the error in envoking target ‘install’ of make file.
Would you pls. help.

It’s a while since I did this so apologies if I’m stating the obvious…
A couple of things spring to mind.
Firstly, you could set the semmni value to a higher value than you’ve currently got.
Secondly, you may find it possible to get past this by checking the Ignore All checkbox ( see the screenshot for Step 9 on the installer).
Some other points to note, which may or may not be practical.
First, is it essential that you install on Ubuntu ? If you want an Oracle database on Linux but don’t want to go down the Oracle Linux/Solaris route, then there’s always Red Hat or even CentOS – all of which support the Oracle database natively (CentOS is essentially a clone of Red Hat).
Secondly, if you’re trying to get this up and running on a VM rather than a physical machine then you might want to look at the Oracle Developer Days Virtual Box packages which provide a fully pre-installed software stack.
You can find them at http://www.oracle.com/technetwork/community/developer-vm/index.html
Finally, if you’re doing this on a desktop for the purpose of playing around with Oracle, then have you considered Oracle Express Edition 11g ? This provides a full working database ( minus some features of Enterprise Edition) and is much easier to install. There is a link to the installation instructions on this post.

Like I said, I’m not sure I can really be of much assistance in terms of your specific issue but I hope you find some of this useful.

Many thanks, Mike!!! Following your advise by the thumb does hit success. The only additional fix I bumped with was a couple of libraries missing where expected which, after a brief lookup into the same box, got smoothed like so: