Friday, August 24, 2012

Install oracle on Redhat Linux on VM VirtualBox


Steps to Install Oracle 11g on Redhat Linux on a virtual Box.

First of all we have to keep in mind that we need space for installing Oracle Database as when Virtual Box is installed it only creates a 8Gb of virtual Hard Disk by default.

To add another virtual hard drive in VM virtualBox Managaer goto Settings --> Storage --> SATA Controller
Click on the add button create a new virtual hard disk and format it in ext3 or add an pre-formatted  existing virtaul hard disk.
After adding the second virtual hard drive it will look like this pic...


Here I have created 2 Virtual HD's namely redhat_oracle2.vdi and redhat_oracle2_2.vdi.

Now we are going to add this hard drive to linux OS.

Start your Vbox where Redhat Linux is intalled and goto Sytem --> Administrator --> Logical Volume Management.
Click on VolGroup00  physical view
choose option Extend Volume Group a popup will appear and you need to add an unintialized Disk entity
on /dev/sdb/



Click on VolGroup00  Logical view
choose option add Volume Group a popup will appear and you need to add a LV name ( I choose Oracle) and mount point as /u01
Also remember to check mount and mount when rebooted options too otherwise it will not appear through df -h command.



INTERNET CONNECTEVITY

If you have to connect to internet you should setup network setting in Virtual Box.

Goto Virtual Box Manager-->   Settings   -->  Netrwork --> Adaptor 1
Enable Netrwork Adaptor Then choose NAT, Adaptor type will intel xxx.
Also choose cable connected even though you have wireless router setup at home.
This will be your setting for eth0 which will help you open google.com.



Now we will setup eth1 to connect to other VM's on your other laprtops.

Goto Virtual Box Manager--> Settings --> Netrwork --> Adaptor 2
Enable Netrwork Adaptor Then choose Bridged Adaptor, Adaptor type will  like wifi bgn or wifi b/g/n.
It is important to choose Promiscuous Mode as Allow VM's.
Also choose cable connected even though you have wireless router setup at home.



Now we are ready to install Oracle.


Pre-Instalation Tasks

1. Create oracle User Account

Login as root and create user oracle which belongs to oinstall group.
su -
# groupadd oinstall
# useradd -g oinstall oracle
#passwd oracle

2. Setting System parameters
Edit the /etc/sysctl.conf and add following lines:
kernel.shmall = 2097152
kernel.shmmax = 2147483648
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 6553600
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default = 4194304
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 262144
Note: You need reboot system or execute "sysctl -p" command to apply above settings.
Edit the /etc/pam.d/login file and add following line:
session required pam_limits.so

Now we need to set soft and hard limit for
Number of processes available to a single user(nproc) and Open file descriptors (nofile).
Edit the /etc/security/limits.conf file and add following lines:
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
You can Check the soft and hard limits for the file descriptor setting
$ ulimit -Sn 
1024
$ ulimit -Hn 
65536
Check the soft and hard limits for the number of processes available to a user by
$ ulimit -Su
2047
$ ulimit -Hu
16384



3. Creating oracle directories
# mkdir -p /u01/app/oracle
# mkdir -p /u01/app/oracle/product
# chown -R oracle:oinstall /u01
#chmod -R 775 /u01


4. Setting Oracle Enviroment
Edit the /home/oracle/.bash_profile file and add following lines:
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=$ORACLE_BASE/product/112
ORACLE_SID=orcl2
LD_LIBRARY_PATH=$ORACLE_HOME/lib
PATH=$PATH:$ORACLE_HOME/bin

export ORACLE_BASE ORACLE_HOME ORACLE_SID LD_LIBRARY_PATH PATH

Save the .bash_profile and execute following commands for load new enviroment:
cd /home/oracle
. .bash_profile
Installation
Now download oracle 11gR2 database from Oracle.com
Remember to change owner for our /u01 mount point
login as root
#cd /
#chown oracle:oinstall /u01
log back in as oracle
$mkdir database
$unzip linux_11gR2_database_1of2.zip
$unzip linux_11gR2_database_2of2.zip
if there is permission issue log in as root
$su -
password ....
#chmod 777 *.zip

log back in as oracle
$unzip linux_11gR2_database_1of2.zip
$unzip linux_11gR2_database_2of2.zip


$cd database
$./runInstaller
choose your settings as you want.

oops.... I forgot to install linux Packages
Now we have to Find each package and install it from different CD's of Redhat Linux.


OS Kernel Parameter was fixed by choosing the option "Fix & check Again".
Basically it creates a directory in /tmp/CVU_11.2.0.1.0_oracle
we have to login as root and run the filename runfixup.sh given popup.



Packages Install has to be fixed by going to
Apllications--> Add/Remove Software
Search for package by package name  , if it is not installed then install it by searching in all  CD's.
when all packages are installed then choose ignore all and go next.
When done goto sqlplus and check database is OK.
$sqlplus '/as sysdba'
sqlplus> select * from v$database;

1 comment:

Unknown said...

thanks you sir i done with successful installation.