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 ssh
Tunneling 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):


cd /media
sudo unzip /media/external/linux_11gR2_database_1of2.zip -d .
sudo unzip /media/external/linux_11gR2_database_2of2.zip -d .
cd
sudo unmount /media/external

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 :

gcc
make
binutils
rpm

Final Server Preparations

We need to tweak the server environment, setup some users, and create some links.
First off, update the shell ( we’re still connected as root here, hence the # prompt)

cd /bin
# ls -l /bin/sh
lrwxrwxrwx 1 root root 4 2008-04-28 19:59 /bin/sh -> dash
# ln -sf bash /bin/sh
# ls -l /bin/sh
lrwxrwxrwx 1 root root 4 2008-05-01 22:51 /bin/sh -> bash

Add users and groups

# set -o vi
# addgroup oinstall
Adding group `oinstall' (GID 1001) ...
Done.
# addgroup dba
Adding group `dba' (GID 1002) ...
Done.
# addgroup nobody
Adding group `nobody' (GID 1003) ...
Done.
# usermod -g nobody nobody
# useradd -g oinstall -G dba -p password -d /home/oracle -s /bin/bash oracle
# passwd oracle
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
# mkdir /home/oracle
# chown -R oracle:dba /home/oracle
#

Create symbolic links

# ln -s /usr/bin/awk /bin/awk
# ln -s /usr/bin/rpm /bin/rpm
# ln -s /usr/bin/basename /bin/basename

Not entirely sure why we need to do this bit, but I did

# mkdir /etc/rc.d
# for i in 0 1 2 3 4 5 6 S ; do ln -s /etc/rc$i.d /etc/rc.d/rc$i.d; done

Create the ORACLE_BASE directory

# mkdir -p /u01/app/oracle
# chown -R oracle:dba /u01
#

Now we need to change some config files :
/etc/sysctl.conf – make sure that the following parameters are set to these values. These should all be placed at the end of the file.

fs.file-max = 6815744 
kernel.shmall = 2097152 
kernel.shmmax = 2147483648 
kernel.shmmni = 4096 
kernel.sem = 250 32000 100 128 
net.core.rmem_default = 4194304 
net.core.rmem_max = 4194304 
net.core.wmem_default = 1048576 
net.core.wmem_max = 1048576 
net.ipv4.ip_local_port_range = 9000 65535 
fs.aio-max-nr = 1048576 

/etc/security/limits.conf – add these settings to the end of the file :

oracle soft nproc 2047 
oracle hard nproc 16384 
oracle hard nofile 65536 
oracle soft nofile 1024 

/etc/pam.d/login – add the following line at the end of the file

session required /lib/security/pam_limits.so

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.

Now we’re ready to fire up the installer.

su – oracle
cd /media/database
./runInstaller -ignoreSysPrereqs

After a short pause, you should now see this screen :

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

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

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

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

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

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

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) :

make-3.80 
binutils-2.15.92.02 
gcc-3.4.6 
libaio-0.3.105 
glibc-2.3.4-2.41 
compat-libstdc++-33-3.2.3 
elfutils-libelf-0.97 
elfutils-libelf-devel-0.97 
glibc-common-2.3.4 
glibc-devel-2.3.4 
glibc-headers-2.3.4 
gcc-c++-3.4.6 
libaio-devel-0.3.105 
libgcc-3.4.6 
libstdc++-3.4.6 
libstdc++-devel-3.4.6 
sysstat-5.0.5 
unixODBC-2.2.11 
unixODBS-devel-2.2.11 
pdksh-5.2.14

Once you’re happy, Click Next

Installer Step 10

Installer Step 10

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

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

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

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

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

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

DBCA Screen 8

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

DBCA Screen 11

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

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 !

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 :

export ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1 
export PATH=$PATH:/u01/app/oracle/product/11.2.0/dbhome_1/bin 
export ORACLE_BASE=/u01/app/oracle 
export ORACLE_OWNR=oracle 

Next, we want the database to start when the server boots.

Edit /etc/oratab and change the line :

sid:/u01/app/oracle/product/11.2.0/dbhome_1:N

to :

sid:/u01/app/oracle/product/11.2.0/dbhome_1:Y

where SID is the name of the database you created.

Next, we want to create a script to execute on startup to start the database and the listener :

cd /etc/init.d
sudo vi oracledb

The script should be as follows :

#!/bin/bash 
# 
# Run-level Startup script for the Oracle Listener and Instances 
# It relies on the information on /etc/oratab 
# Based on script listing at 
# http://www.pythian.com/news/1355/installing-oracle-11gr1-on-ubuntu-810-intrepid-ibex/ 
# Mike 7/3/10 
# 
export ORACLE_BASE=/u01/app/oracle 
export ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1 
export ORACLE_OWNR=oracle 
export PATH=$PATH:$ORACLE_HOME/bin 
 
if [ ! -f $ORACLE_HOME/bin/dbstart -o ! -d $ORACLE_HOME ] 
then 
    echo "Oracle startup: cannot start" 
    exit 1 
fi 

case "$1" in 
    start) 
        # Oracle listener and instance startup 
        echo -n "Starting Oracle: " 
        su $ORACLE_OWNR -c "$ORACLE_HOME/bin/lsnrctl start" 
        su $ORACLE_OWNR -c "$ORACLE_HOME/bin/dbstart $ORACLE_HOME" 
        touch /var/lock/oracle 
        echo "OK" 
        ;; 
    stop) 
        # Oracle listener and instance shutdown 
        echo -n "Shutdown Oracle: " 
        su $ORACLE_OWNR -c "$ORACLE_HOME/bin/lsnrctl stop" 
        su $ORACLE_OWNR -c "$ORACLE_HOME/bin/dbshut $ORACLE_HOME" 
        rm -f /var/lock/oracle 
        echo "OK" 
        ;; 
    reload|restart) 
        $0 stop 
        $0 start 
        ;; 
    *) 
        echo "Usage: `basename $0` start|stop|restart|reload" 
        exit 1 
esac 

exit 0 

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 :

ORAKARMIC = 
  (DESCRIPTION = 
    (ADDRESS = (PROTOCOL = TCP)(HOST = mikeserver)(PORT = 1521)) 
    (CONNECT_DATA = 
      (SERVER = DEDICATED) 
      (SERVICE_NAME = orakarmic.mikeserver) 
    ) 
  ) 

You should now be able to connect to the database from the client :

sqlplus system/password@orakarmic

SQL*Plus: Release 10.2.0.1.0 - Production on Sat Mar 13 18:46:37 2010

Copyright (c) 1982, 2005, Oracle. All rights reserved.

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL>

I seem to remember someone mentioning beer.

About these ads

50 thoughts on “Installing Oracle 11gR2 on Ubuntu 9.10

  1. Pingback: Installing Oracle 11gR2 on Ubuntu 9.10 « The Anti-Kyte

  2. 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.

    Thanks Mike!

  3. Good one Mike thanks for sharing.

    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.

  4. i got java error afetrr running this command ./runInstaller -ignoreSysPrereqs

    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)

      HTH

      Mike

  5. 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

  6. 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

  7. hi …thank you very much for this tutorial, is one of the most comprehensive in Internet.

    I have a problem when I want to access from a client to my database server.

    I get the error:

    ORA-12 560

    And when i do tnsping from the client, doesnt works too…

    Please help me whit that.

    Thank you…and sorry for my english :)

    • German,

      I assume that the error is TNS-12560 TNS: Protocol Adapter error.

      If so, I’d suggest you might try the following :

      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 :

      lsnrctl status

      Hopefully, this may give you some clue as to what is going wrong.

      Lo siento para mi male Espaniol ;-)

      Mike

      • lol = jajajaja

        you make me laugh…thxs a lot…your post is the best…is very easy and complete…well…im so obstinate and because of that…i tried so many things, and i’ve disabled the firewall on my centos 5.4 server :)

        And ta daaaaa…voila…it works :)

        Well, even so, i’ll continue research on types of oracle installation…

        Made me curious, that you choose dbca to install the database, because in so many sites people prefers OUI to do it…well, is a personal choice, i guess…

        I hope to continue reading yours articles…and again, sorry for my poor english…

        And…su español no es tan malo

        :)

  8. Pingback: Blogroll Report 12/03/2010 – 19/03/2010 « Coskan’s Approach to Oracle

  9. 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?

    • Rob,

      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.

  10. Pingback: New Resources learnt this week « Oracle Top 5 References's Blog

  11. 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.

  12. I installed Oracle 11g R2 64 Bit on Ubuntu 10.04 64 Bit (lucid)

    in /etc/sysctl.conf change
    net.ipv4.ip_local_port_range = 9000 65535
    to
    net.ipv4.ip_local_port_range = 9000 65500

    I also installed the following probably missing packages
    sudo apt-get install libaio-dev expat sysstat unixodbc unixodbc-dev lesstif2

    instead modifying /etc/profile I created
    /etc/profile.d/oracle.sh

  13. Pingback: PLUSONNET Community » Blog Archive » Installing Oracle 11gR2 Ubuntu 10.04 server

    • Vinothraja,

      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.

    • Vinothraja,

      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 :

      echo $PATH

      This should include your Oracle home directory.

      HTH

      Mike

  14. hi i need another help,
    i want copy and paste files in system folder, how can i do this?
    whenever i did this it shows PERMISSION DENIED ,
    how to solve this problem? in ubuntu

    i want copy files from my home folder to /var/lib/tomcat6/wabapps/..

    • Vinothraja,

      this is not really related to this post, so I’ve sent you a mail rather than posting a reply here.
      Please mail me if the suggestions I sent you don’t solve your problem.

      Mike

    • Amine,

      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.

      The full text of the script is :

      Rem Copyright (c) 1990, 2006, Oracle. All rights reserved.  
      Rem NAME
      REM    UTLSAMPL.SQL
      Rem  FUNCTION
      Rem  NOTES
      Rem  MODIFIED
      Rem     lburgess   04/02/06  - lowercase passwords 
      Rem     menash     02/21/01 -  remove unnecessary users for security reasons
      Rem     gwood      03/23/99 -  make all dates Y2K compliant
      Rem     jbellemo   02/27/97 -  dont connect as system
      Rem     akolk      08/06/96 -  bug 368261: Adding date formats
      Rem     glumpkin   10/21/92 -  Renamed from SQLBLD.SQL 
      Rem     blinden   07/27/92 -  Added primary and foreign keys to EMP and DEPT
      Rem     rlim       04/29/91 -         change char to varchar2 
      Rem     mmoore     04/08/91 -         use unlimited tablespace priv 
      Rem     pritto     04/04/91 -         change SYSDATE to 13-JUL-87 
      Rem   Mendels    12/07/90 - bug 30123;add to_date calls so language independent
      Rem
      rem 
      rem $Header: utlsampl.sql 02-apr-2006.21:13:01 lburgess Exp $ sqlbld.sql 
      rem 
      SET TERMOUT OFF
      SET ECHO OFF
      
      rem CONGDON    Invoked in RDBMS at build time.   29-DEC-1988
      rem OATES:     Created: 16-Feb-83
       
      DROP USER SCOTT CASCADE;
      DROP USER ADAMS CASCADE;
      DROP USER JONES CASCADE;
      DROP USER CLARK CASCADE;
      DROP USER BLAKE CASCADE;
      GRANT CONNECT,RESOURCE,UNLIMITED TABLESPACE TO SCOTT IDENTIFIED BY tiger;
      DROP PUBLIC SYNONYM PARTS;
      
      CONNECT SCOTT/tiger
      CREATE TABLE DEPT
             (DEPTNO NUMBER(2) CONSTRAINT PK_DEPT PRIMARY KEY,
      	DNAME VARCHAR2(14) ,
      	LOC VARCHAR2(13) ) ;
      CREATE TABLE EMP
             (EMPNO NUMBER(4) CONSTRAINT PK_EMP PRIMARY KEY,
      	ENAME VARCHAR2(10),
      	JOB VARCHAR2(9),
      	MGR NUMBER(4),
      	HIREDATE DATE,
      	SAL NUMBER(7,2),
      	COMM NUMBER(7,2),
      	DEPTNO NUMBER(2) CONSTRAINT FK_DEPTNO REFERENCES DEPT);
      INSERT INTO DEPT VALUES
      	(10,'ACCOUNTING','NEW YORK');
      INSERT INTO DEPT VALUES (20,'RESEARCH','DALLAS');
      INSERT INTO DEPT VALUES
      	(30,'SALES','CHICAGO');
      INSERT INTO DEPT VALUES
      	(40,'OPERATIONS','BOSTON');
      INSERT INTO EMP VALUES
      (7369,'SMITH','CLERK',7902,to_date('17-12-1980','dd-mm-yyyy'),800,NULL,20);
      INSERT INTO EMP VALUES
      (7499,'ALLEN','SALESMAN',7698,to_date('20-2-1981','dd-mm-yyyy'),1600,300,30);
      INSERT INTO EMP VALUES
      (7521,'WARD','SALESMAN',7698,to_date('22-2-1981','dd-mm-yyyy'),1250,500,30);
      INSERT INTO EMP VALUES
      (7566,'JONES','MANAGER',7839,to_date('2-4-1981','dd-mm-yyyy'),2975,NULL,20);
      INSERT INTO EMP VALUES
      (7654,'MARTIN','SALESMAN',7698,to_date('28-9-1981','dd-mm-yyyy'),1250,1400,30);
      INSERT INTO EMP VALUES
      (7698,'BLAKE','MANAGER',7839,to_date('1-5-1981','dd-mm-yyyy'),2850,NULL,30);
      INSERT INTO EMP VALUES
      (7782,'CLARK','MANAGER',7839,to_date('9-6-1981','dd-mm-yyyy'),2450,NULL,10);
      INSERT INTO EMP VALUES
      (7788,'SCOTT','ANALYST',7566,to_date('13-JUL-87','dd-mm-rr')-85,3000,NULL,20);
      INSERT INTO EMP VALUES
      (7839,'KING','PRESIDENT',NULL,to_date('17-11-1981','dd-mm-yyyy'),5000,NULL,10);
      INSERT INTO EMP VALUES
      (7844,'TURNER','SALESMAN',7698,to_date('8-9-1981','dd-mm-yyyy'),1500,0,30);
      INSERT INTO EMP VALUES
      (7876,'ADAMS','CLERK',7788,to_date('13-JUL-87', 'dd-mm-rr')-51,1100,NULL,20);
      INSERT INTO EMP VALUES
      (7900,'JAMES','CLERK',7698,to_date('3-12-1981','dd-mm-yyyy'),950,NULL,30);
      INSERT INTO EMP VALUES
      (7902,'FORD','ANALYST',7566,to_date('3-12-1981','dd-mm-yyyy'),3000,NULL,20);
      INSERT INTO EMP VALUES
      (7934,'MILLER','CLERK',7782,to_date('23-1-1982','dd-mm-yyyy'),1300,NULL,10);
      CREATE TABLE BONUS
      	(
      	ENAME VARCHAR2(10)	,
      	JOB VARCHAR2(9)  ,
      	SAL NUMBER,
      	COMM NUMBER
      	) ;
      CREATE TABLE SALGRADE
            ( GRADE NUMBER,
      	LOSAL NUMBER,
      	HISAL NUMBER );
      INSERT INTO SALGRADE VALUES (1,700,1200);
      INSERT INTO SALGRADE VALUES (2,1201,1400);
      INSERT INTO SALGRADE VALUES (3,1401,2000);
      INSERT INTO SALGRADE VALUES (4,2001,3000);
      INSERT INTO SALGRADE VALUES (5,3001,9999);
      COMMIT;
      EXIT
      

      HTH

      Mike

    • Shashika,

      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,

      Mike

  15. Hola,
    ¿Si mi instalacion no es en una distro server habra algun inconveniente?
    ¿Puedo instalar solo el cliente oracle y trabajar solo con eso o necesito realizar una instalacion con esta?

    Agradeceria mucho de sus ayudas e instruccion!

    Gracias!

    • Pedimos disculpas por mi español malo…
      Puede installar en Ubuntu 10.04 desktop, pero no he hecho esto.
      tal vez una mejor opción sería la de instalar Oracle 10g Express Edition. Instrucciones para hacer esto se pueden encontrar aquí.

      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

        Cheers again
        Rae

  16. Hello … in section “Getting Required Packages”, you have a mistake:

    apt-get ‘software_name’ … the option ‘install’ fault, is’nt-it?!

    Not?

  17. Pingback: Instalando o Oracle 11g Release 2 no Ubuntu 11.10 « whoisroot

  18. 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.

      Mike

  19. 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:

    /lib/libgcc_s.so.1
    ln -s /lib/i386-linux-gnu/libgcc_s.so.1 /lib/libgcc_s.so.1

    /usr/lib/libstdc++.so.6
    ln -s /usr/lib/i386-linux-gnu/libstdc++.so.6.0.19 /usr/lib/libstdc++.so.6

    (I suggest a lookup, for instance, find / -type f -name *libstdc++.so* for the case they have minor versions appended to the filename)
    And now, Oracle runs in my Ubuntu server 14.04

    On me, you have a six pack of beers!!!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s