Wednesday, August 18, 2010

Installing Oracle on Ubuntu

Download Oracle

Download oracle from the Oracle site. It's usually a zip file for linux version and unzip it in a directory.

Install the Package

We need to install some packages which are needed by oracle. Run the following apt-get for that

sudo apt-get install gcc make binutils libmotif3 lesstif2 rpm libaio1 zip 
sudo apt-get install libstdc

Make some soft links

sudo ln -s /usr/bin/awk /bin/awk
sudo ln -s /usr/bin/rpm /bin/rpm
sudo ln -s /usr/bin/basename /bin/basename 
sudo ln -s /etc /etc/rc.d

Oracle supports only some of the linux version officially, so we tell oracle that we are one of those. Change the following file as follows

sudo gedit /etc/redhat-release

Copy/Paste the following text:

Red Hat Linux release 3.0 (drupal)

Make the oracle user and groups dba,oinstall

sudo userdel nobody
sudo groupadd oinstall
sudo groupadd dba
sudo groupadd nobody
sudo useradd -g oinstall -G dba -p passwd -d /home/oracle oracle -s /bin/bash
sudo useradd -g nobody nobody

Now, we create the directory where Oracle will be installed

sudo mkdir -p /u01/app/oracle
sudo mkdir -p /u02/oradata
sudo chown -R oracle:oinstall /u01 /u02
sudo chmod -R 775 /u01 /u02

At the end of /etc/security/limits.conf add the following:

*               soft    nproc   2047
*               hard    nproc   16384
*               soft    nofile  1024
*               hard    nofile  65536^

In the following file

sudo vi /etc/pam.d/login 

uncomment

session    required   pam_limits.so

In the file

sudo vi /etc/pam.d/su

uncomment

^session    required   pam_limits.so

Add this line to /etc/profile as root

if [ $USER = "oracle" ]; then
           ulimit -u 16384 -n 65536
fi

Add the following lines to the end of /home/oracle/.bashrc (open it in root or oracle user):

umask 022
PATH=${PATH}:/u01/app/oracle/oracle/product/10.2.0/db_1/bin/
ORACLE_HOME=/u01/app/oracle/oracle/product/10.2.0/db_1/
ORACLE_SID=orcl
ORATAB=/etc/oratab
ORACLE_HOME_LISTNER=$ORACLE_BASE
ORACLE_BASE=$ORACLE_HOME
export ORACLE_BASE ORACLE_SID ORATAB ORACLE_HOME ORACLE_HOME_LISTNER

Now login as oracle user and go the the directory where oracle installer is unzipped

./runInstaller

Follow the instruction. At the end do not forget to run root.sh.

If you find following problems that do as following

Error in invoking target all_no_orcl ihsodbc of makefile - Download libstd using apt-get

sudo apt-get install libstdc++5

Accessing Oracle

Different admin applications can be accessed on following url's. Replace <hostname> with your machine name

iSQL*Plus URL: http://:5560/isqlplus

iSQL*Plus DBA URL: http://:5560/isqlplus/dba

Enterprise Manager 10g Database Control URL: http://:5500/em

No comments:

Post a Comment