Tuesday, September 8, 2009

Oracle 11g Installation on Linux 5

This articles covers the Installation of Oracle Database 11g on Enterprise Linux 5 and CentOS 5. Server needs minimum 2gb RAM for the installation. Swap should have double of physical ram.
Set the Linux Kernal Parameters:
Linux Kernel Parameters
What is the Shared Memory:
Shared memory allows processes to access common structures and data by placing them in shared memory segments. It's the fastest form of IPC (Interprocess Communication) available since no kernel involvement occurs when data is passed between the processes. In fact, data does not need to be copied between the processes.
Oracle uses shared memory segments for the SGA (Shared Global Area) which is an area of memory that is shared by all Oracle background and foreground processes. The size of the SGA has a major impact to Oracle's performance since it holds database buffer cache and much more.
Setting SHMMAX Parameter
This parameter defines the maximum size in bytes for a shared memory segment. Since the SGA is comprised of shared memory, SHMMAX can potentially limit the size of the SGA.
Setting SHMMNI Parameter
This parameter sets the maximum number of shared memory segments system wide.
Setting SHMALL Parameter
This parameter sets the total amount of shared memory in bytes that can be used at one time on the system.
The SEMMSL Parameter
This parameter defines the maximum number of semaphores per semaphore set.
Oracle recommends to set SEMMSL to the largest PROCESSES init.ora parameter of any database on the Linux system.
The SEMMNI Parameter
This parameter defines the maximum number of semaphore sets in the entire Linux system.
The SEMMNS Parameter
This parameter defines the total number of semaphores (not semaphore set) in the entire Linux system.
The SEMOPM Parameter
This parameter defines the maximum number of semaphore operations that can be performed per semop(2) system call.
Setting File Handles
The maximum number of file handles denotes the maximum number of open files that you can have on the Linux system.
Setting System Wide Limit for File Handles
The value in /proc/sys/fs/file-max sets the maximum number of file handles or open files that the Linux kernel will allocate. When you get error messages about running out of file handles, then you might want to raise this limit.
Change the parameters:

#vi /etc/sysctl.conf
Add the following:
kernel.shmmax = 2147483648
kernel.shmall = 2097152
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 65536 # 512 * PROCESSES
net.core.rmem_default=4194304
net.core.rmem_max=4194304
net.core.wmem_default=262144
net.core.wmem_max=262144
net.ipv4.ip_local_port_range = 1024 65000

#vi /etc/hosts
IP-address Machinename.domainname Hostname

#vi /etc/security/limits.conf
Add or change /etc/security/limits.conf file:
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft nproc 2047
oracle hard nproc 16384

#vi /etc/pam.d/login
session required pam_limits.so
session required /lib/security/pam_limits.so
Very important Steps:
On secure linux has to be disabled:

#vi /etc/selinux/config
Change or add
SELINUX=disabled

The following packages(rpm) required for Enterprise Linux Disk1 :
Insert the 1st cd and mount the same: -
Go to cd /media/cdrom/Server (cd /media/cdrom/Server)
rpm -Uvh binutils-2.*
rpm -Uvh elfutils-libelf-0.*
rpm -Uvh glibc-2.*
rpm -Uvh glibc-common-2.*
rpm -Uvh libaio-0.*
rpm -Uvh libgcc-4.*
rpm -Uvh libstdc++-4.*
rpm -Uvh make-3.*
cd /
eject

Insert Disk2 Cd. Mount the CD: -
Go to cd /media/cdrom/Server (cd /media/cdrom/Server)
rpm -Uvh compat-libstdc++-33*
rpm -Uvh elfutils-libelf-devel-0.*
rpm -Uvh glibc-devel-2.*
rpm -Uvh gcc-4.*
rpm -Uvh gcc-c++-4.*
rpm -Uvh libaio-devel-0.*
rpm -Uvh libstdc++-devel-4.*
rpm -Uvh unixODBC-2.*
rpm -Uvh unixODBC-devel-2.*
cd /
eject

Insert Disk3 Cd. Mount the CD: -
Go to cd /media/cdrom/Server (cd /media/cdrom/Server)
rpm -Uvh sysstat-7.*
cd /
eject

Create user and groups: -
Adding Groups: -
groupadd oinstall
groupadd dba
groupadd asmadmin

Adding user and assign the group: -
useradd -g oinstall -G dba,oper,asmadmin oracle

Add password for Oracle user
#passwd oracle

I would like to light on the "asmadmin" group is used for ASM.
Make directories in which the Oracle Binary to be installed:

#mkdir -p /data1/app/oracle/product/11/db_1
#chown -R oracle:oinstall /data1
#chmod -R 777 /data1

#vi /home/oracle.bash_profile
Add the following: -
ORACLE_HOSTNAME=machinename.domainname
ORACLE_BASE=/data1/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/11/db_1; export ORACLE_HOME
ORACLE_SID=orcl; export ORACLE_SID
ORACLE_TERM=xterm; export ORACLE_TERM
PATH=/usr/sbin:$PATH; export PATH
PATH=$ORACLE_HOME/bin:$PATH; export PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi

Login as Oracle user: -
Run Install Steps:
Set the Display first
$export DISPLAY=hostname:0.0
Go setup Disk directory
$cd Disk1
$./runInstaller
Rest follow the GUI provided by Oracle