Install and Configure Oracle 10gR2 on Ubuntu Server


Introduction

Oracle is one of the most (if not the most) famous DMBS, in many places you are going to be asked to develop using Oracle for the persistence.
But the installation of oracle is big, and also slow, I have installed Oracle on my Linux box every time I install a fresh Linux Version and its fine, if you don't start the enterprise manager it can moderate on resources, so to resolve the problem I am going to install Oracle 10gR2 on a Ubuntu Server on a VMware virtual machine.
I have choose Ubuntu Server because of it size and the package manager that makes install the minimal X requirements easy.

Installation of Ubuntu Server 
I am going to install ubuntu from the ubuntu dvd, this dvd can install a command line system, a sever and the default ubuntu.
change your language hitting F2, and your keyboard with F3, after hitting on the option "Install a server", the installation for the server is console based, the steps are:
  1. Selection of the language for the installation process
  2. Selection of a country
  3. Enter a hostname
  4. Partition of the disk: you can do this step in 3 ways
    1. Guided (take all disk)
    2. Guided and use LVM
    3. Manual
  5. After you setup your partition layout the installer ask you about your timezone
  6. Select if your time its set to UTC or not.
  7. Enter the full name of the default user, this is not the login name but the full name.
  8. Enter the login name, the one that you are going to be asked for in the login of the system
  9. Enter the user password
  10. Re-enter the user password
  11. After 7 minutes of software installation, the installer told me that only the base system was installed, that if I want to install ubuntu desktop, lamp server or dns, I didn't choose anything and hit enter
  12. After the reboot, in the first boot you will need to install x packages to install oracle, I choose fluxbox because of it's size and footprint.
    $sudo apt-get install fluxbox xserver-xorg xfonts-base fluxbox xterm
    this will give you a very lightweight server
  13. you can start the X environment with startx now.
note: if you are working on vmware, you may want to make a clone of your ubuntu server, so may do clones of this virtual machine if you want to use a lightweight server later.

Installation of Oracle 10gR2
note: this process installation is highly based on Akshay Mehta's tutorial
now it's time for the installation of oracle, but for a perfect installation it will be necessary to do some previous steps:
  1. update package repository
    $sudo apt-get update
  2. install some necesary packages
    $sudo apt-get install build-essential libaio rpm lesstif2-dev alien libstdc++6-dev
  3. Create the users and groups oracle needs:
    $sudo groupadd oinstall
    $sudo groupadd dba
    $sudo groupadd nobody
    $sudo useradd -g oinstall -G dba,nobody -d /opt/oracle -m -s /bin/bash oracle
  4. Set oracle user’s password
    $sudo passwd oracle
  5. Append user oracle’s .bashrc with PATH and ORACLE:BASE,HOME and SID information as oracle user
    $sudo su oracle
    $nano .bashrc
    and append to the file
    export ORACLE_BASE=/opt/oracle
    export ORACLE_HOME=$ORACLE_BASE/product/10gR2
    export ORACLE_SID=orcl
    export PATH=$PATH:$ORACLE_HOME/binreturn to your normal user
    $exit
  6. Make sure the correct kernel parmeters are appended to /etc/sysctl.conf
    kernel.shmall = 2097152
    kernel.shmmax = 2147483648
    kernel.shmmni = 4096
    kernel.sem = 250 32000 100 128
    net.core.rmem_default = 262144
    net.core.rmem_max = 262144
    net.core.wmem_default = 262144
    net.core.wmem_max = 262144
    fs.file-max = 65536
    net.ipv4.ip_local_port_range = 1024 65000
  7. Set the kernel parameters or reboot
    $sudo /sbin/sysctl -p
    1. Set /etc/security/limits.conf
      $sudo nano /etc/security/limits.conf
      and append to the file
      * soft nproc 2047
      * hard nproc 16384
      * soft nofile 1024
      * hard nofile 65536
  8. Create symbolic links this is because the location of some commands are hard codded on oracle scripts, so ubuntu would look more like an enterprise rpm based distro.
    $sudo ln -s /usr/bin/awk /bin/awk
    $sudo ln -s /usr/bin/rpm /bin/rpm
    $sudo ln -s /lib/libgcc_s.so.1 /lib/libgcc_s.so
    $sudo ln -s /usr/lib/libstdc++.so.6 /lib/libstdc++.so.5
    $sudo ln -s /usr/bin/basename /bin/basename
  9. Mount the Oracle10g CD and run the installer
    /runInstaller -ignoreSysPrereqsnote: I have had problems running the installer as another user than oracle, if you have kde installed, you can try with sudo, or start a konsole with kdesudo -u oracle konsole, or log as oracle user and run the installer from there.
    Installation of oracle is: next, next, next..... only take care of assign a password when you are prompted to.
  10. Enable the orcl database to start when you call dbstart
    $sudo nano /etc/oratab

    and change :N to :Y
  11. to start the services as oracle user do:
    $dbstart
    $lsnrctl start
    if you want to start the isqlplus web console do:
    $isqlplusctl start
    if you want to start the enterprise web console do:
    $emctl start dbconsole
  12. remember to stop the services before shut down the machine.
                   More Details Click Here
                              Author by:-xlayn

0 comments:

Post a Comment