Friday, October 26, 2007

Preparing OS for Installing Oracle 11gR1 32bit RDBMS on OEL 5 & RHEL 5

Everybody knows second releases are better, however I’ll try 11gR1 (Oracle 11gR1 (11.1.0.x) 32-bit on Enterprise Linux 5 x86 Platform) in order to review Oracle 11g top new features and the whole installation process.
Since it is the expressed goal to keep Oracle Enterprise Linux functionally IDENTICAL to RHEL, this NOTE is also completely applicable to RHEL 5 (any update level)

I’ve started with a VMware Server Console 1.0.1 build-29996 on Windows XP Professional 5.1.2600, Service Pack 2 with 1024MB for test purposes.

I’m using an Enterprise Linux 5 virtual machine with 512MB and 1GB swap (Linux version 2.6.18-8.el5 (mockbuild@ca-build14) (gcc version 4.1.1 20070105 (Red Hat 4.1.1-52)) #1 SMP) and I’ve made a default OS installation (without customization during installation).

Required RPMS

compat-libstdc++-33-3.2.3-61
elfutils-libelf-devel-0.125 (requires elfutils-libelf-devel-static-0.125)
glibc-devel-2.5-12 (requires glibc-headers-2.5-12)
gcc-4.1.1-52 (requires libgomp-4.1.1-52)
gcc-c++-4.1.1-52
libaio-devel-0.3.106
libstdc++-devel-4.1.1-52.e15
sysstat-7.0.0
unixODBC-2.2.11
unixODBC-devel-2.2.11

Dependent RPM's:
elfutils-libelf-devel-static-0.125-3.el5
glibc-headers-2.5-12
libgomp-4.1.1-52.el5.2

Other required RPMS's (as per Install Guide, release Notes)
(these get installed during a "Default RPM" installation of the RHEL AS/ES 5 OS. Additional RPMs maybe needed if a "less-than-default-RPMs" installation of RHEL AS/ES 5 is performed.

binutils-2.17.50.0.6-2.el5
elfutils-libelf-0.125-3.el5
glibc-2.5-12
glibc-common-2.5-12
libaio-0.3.106
libgcc-4.1.1-52
libstdc++-4.1.1
make-3.81-1.1

The easy (manual) way to install required RPMS and their dependencies

a) Make a list

[root@localhost ~]# cat rpms.lst
compat-libstdc++
elfutils-libelf-devel-static
elfutils-libelf-devel
glibc-headers
glibc-devel
libgomp
gcc
gcc-c++
libaio-devel
libstdc++-devel
sysstat
unixODBC
unixODBC-devel

b) Find missing packages and copy them to a temporary folder (manually mounting all OS installations CDs)

[root@localhost ~]mount /dev/cdrom /mnt/
[root@localhost ~]# for i in `cat rpms.lst`;do find /mnt/ -name "*$i*" -exec cp {} rpm/ \;;done
[root@localhost ~]umount /mnt/

c) Install RPMS

rpm -ivh elfutils-libelf-devel-0.125-3.el5.i386.rpm elfutils-libelf-devel-static-0.125-3.el5.i386.rpm

rpm -ivh glibc-devel-2.5-12.i386.rpm glibc-headers-2.5-12.i386.rpm gcc-4.1.1-52.el5.i386.rpm libgomp-4.1.1-52.el5.i386.rpm

rpm -ivh compat-libstdc++-296-2.96-138.i386.rpm compat-libstdc++-33-3.2.3-61.i386.rpm

rpm -ivh libstdc++-devel-4.1.1-52.el5.i386.rpm

rpm -ivh gcc-c++-4.1.1-52.el5.i386.rpm

rpm -ivh libaio-devel-0.3.106-3.2.i386.rpm

rpm -ivh sysstat-7.0.0-3.el5.i386.rpm

rpm -ivh unixODBC-2.2.11-7.1.i386.rpm
unixODBC-devel-2.2.11-7.1.i386.rpm

d) Check

[root@localhost ~]# for i in `cat rpms.lst`;do echo "checking $i"; rpm -qa|grep $i;echo "-----------------";done

Setting Kernel parameters

[root@localhost ~]# vi /etc/sysctl.conf

kernel.shmall = 2097152
kernel.shmmax = 1/2 of physical RAM. This would be the value 2147483648 for a 4Gb RAM system. (268435456 in my case)
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 512 * PROCESSES (for example 65536 for 128 processes)
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

[root@localhost ~]# sysctl –p

Adding user Oracle

# useradd oracle
# passwd oracle
# groupadd dba
# groupadd oinstall
# usermod -g oinstall -G dba oracle

Configure Oracle software owner limits

[root@el5 ~]# vi /etc/security/limits.conf
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536

[root@el5 ~]# vi /etc/pam.d/login
session required /lib/security/pam_limits.so
session required pam_limits.so

[root@el5 ~]# vi /etc/profile

if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi

Miscelaneous

In order to avoid errors OUI-10035 and OUI-10033 during installation, take into account Oracle Metalink Note 452780.1 what in a brief, explains that regarding new oraInventory location’s change on 11gR1, Oracle user, needs write permission on $ORACLE_BASE/../ ($ORACLE_BASE/../oraInventory)


If you are installing Oracle RDBMS 11gR1 software onto either the RHEL 5 or the OEL 5 operating system, please set the Linux feature "SELinux" to "Permissive" mode. This issue is described more fully in Metalink Note 454196.1, "./sqlplus: error on libnnz11.so: cannot restore segment prot after reloc".

It talks about issuing the following commands and/or switch SELinux from the default "Enforcing" mode that it is running in, to the "Permissive" mode.

/usr/sbin/semanage fcontext -a -t textrel_shlib_t $ORACLE_HOME/lib/libnnz11.so
/usr/sbin/semanage fcontext -a -t textrel_shlib_t $ORACLE_HOME/lib/libnque11.so
/usr/sbin/semanage fcontext -a -t textrel_shlib_t $ORACLE_HOME/lib/libclntsh.so.11.1

In my case (test scenario) I’ve decided to disable selinux before installation.

[root@el5 ~]# vi /etc/selinux/config

[root@el5 ~]# id oracle

uid=500(oracle) gid=502(oinstall) groups=502(oinstall),501(dba) context=root:system_r:unconfined_t:SystemLow-SystemHigh

After reboot:
[root@el5 ~]# id oracle
uid=500(oracle) gid=502(oinstall) groups=502(oinstall),501(dba)

Login as Oracle software owner:

If the ORACLE_SID, ORACLE_HOME or TNS_ADMIN environment variable is set, then remove/unset them from the environment.
Unset following environment variables (if set) LD_LIBRARY_PATH
Java References (like JAVA_HOME..etc)
Oracle Home references in $PATH

set 'umask 0022' and ulimit stack size to 32768

umask 0022
ulimit -s 32768


Ready to install Oracle 11gR1 32bit RDBMS


References:
Oracle Metallink Note: 438765.1
Oracle Metallink Note: 452780.1
Oracle Metallink Note: 454196.1