Installing an Oracle Database on Oracle Linux

You can use an Oracle VM template to get a running Oracle clustered database in less than 10 mn (excluding VM images download time). But sometimes, it is useful to have our own custom DB instance for testing purpose. Here are the steps in use to setup quickly a simple Oracle database instance on your Oracle Linux 5.9 aka Tikanga release.

Once you setup correctly your internet connection, apply the following command to prepare the database per-requisite:
* As a root user, apply the following commands:

cat /etc/redhat-release
> Red Hat Enterprise Linux Server release 5.9 (Tikanga)

* if the file public-yum-el5.repo do not exist, then issue the following command to download a YUM repository configuration:

cd /etc/yum.repos.d/
wget http://public-yum.oracle.com/public-yum-el5.repo

* vi public-yum-el5.repo , and comment the section related to your Oracle OS System, in my case enable ol5_u9 and disabled the latest version

[el5_latest]
name=Oracle Linux $releasever Latest ($basearch)
baseurl=http://public-yum.oracle.com/repo/OracleLinux/OL5/latest/$basearch/
gpgkey=http://public-yum.oracle.com/RPM-GPG-KEY-oracle-el5
gpgcheck=1
enabled=0

[ol5_u9_base]
name=Oracle Linux $releasever Update 9 installation media copy ($basearch)
baseurl=http://public-yum.oracle.com/repo/OracleLinux/OL5/9/base/$basearch/
gpgkey=http://public-yum.oracle.com/RPM-GPG-KEY-oracle-el5
gpgcheck=1
enabled=1

* Prepare your OS to receive the Oracle database installation. The last command will create the dba group and appropriate oracle user to be used for installing the Oracle database software:

yum install unixODBC-2.2.11
yum install oracle-validated

* Download the Oracle database software from https://edelivery.oracle.com/
* Tips: You can use the following command to mount a Share Windows FS into your Linux system

mount -t cifs //<windows_IP>/<windows_Shared_drive_name> /mnt/<mount_name> -o user=<Windows_User>

* Copy the downloaded file 11gR2_11.2.0.1.0_Linux_x86-64_Part1_V17530-01_1of2.zip and 11gR2_11.2.0.1.0_Linux_x86-64_Part2_V17530-01_2of2.zip and unzip them in your Linux temporary files.
* Then follow the wizzard installation, see screenshots below.
* Now, configure your DB instance to startup automatically your database instance when you reboot your OS
* As a root user, set run levels to execute this file on startup and change the flag of /etc/oratab file to Y

touch /etc/init.d/oracledb
chmod 750 /etc/init.d/oracledb
chkconfig --level 345 oracledb on
vi /etc/oratab

* Below a sample file /etc/init.d/oracledb

#!/bin/bash
#
# oracle Init file for starting and stopping
# Oracle Database. Script is valid for 10g and 11g versions.
#
# chkconfig: 35 80 30
# description: Oracle Database startup script

# Source function library.

. /etc/rc.d/init.d/functions

ORACLE_OWNER="oracle"
ORACLE_HOME="/app/oracle/product/11.2.0/dbhome_1"
ORACLE_HOME_LISTENER=$ORACLE_HOME

case "$1" in
        start)
        echo -n $"Starting Oracle DB:"
        su - $ORACLE_OWNER -c "$ORACLE_HOME/bin/dbstart $ORACLE_HOME"
        echo "OK"
        ;;
        stop)
        echo -n $"Stopping Oracle DB:"
        su - $ORACLE_OWNER -c "$ORACLE_HOME/bin/dbshut $ORACLE_HOME"
        echo "OK"
        ;;
*)
echo $"Usage: $0 {start|stop}"
esac

* Below some screenshot of my oracle DB installation on Linux

Screenshot Description
ora-db-install-00 Add details here
ora-db-install-00 Add details here
ora-db-install-00 Add details here
ora-db-install-00 Add details here
ora-db-install-00 Add details here
ora-db-install-00 Add details here
ora-db-install-00 Add details here
ora-db-install-00 Add details here
ora-db-install-00 Add details here
ora-db-install-00 Add details here
ora-db-install-00 Add details here
ora-db-install-00 Add details here
ora-db-install-00 Add details here
ora-db-install-00 Add details here

More to come …

Advertisements

About Chenda Mok

19 years of hands on experience in software design and development with emphasis on Enterprise Application Integration (EAI), Services Oriented Architecture (SOA) and Identity Management (IDM) solutions. I’m a software engineer, member of the professional service delivery team working for Salesforce. Prior to this, I worked for Oracle as Solution Architect, through SeeBeyond(06/2005), then SUN’s acquisition (04/2009). After my master’s degree in computer science in 1997; I always delivered consulting on architecture, design, implementation on integration’s field. I’m interested in architecture using EAI/SOA/IDM/BPM/Cloud technologies, software development and Java’s related technologies. I may blog about my work/activities at Salesforce, but I do not speak for my employer, past, present or future.
This entry was posted in commands, database, Linux, Linux, Operating System, oracle and tagged , , , . Bookmark the permalink.