Installing Oracle 9i on OEL/RHEL 4.8 64bit

#######################################################
################    PART A (Logged in as root)    #################
#######################################################
# Update date : 16/06/2012

1. Disabling SELinux – Disable SELinux now (If you couldn’t disable it during installation).
cat /etc/selinux/config

## === And make sure to set the SELINUX Flag disabled.
SELINUX=disabled

2. Installing missing libraries – You don’t know whether you have the required packages installed or not. Right! Don’t sweat. Run following commands to check whether you have those packages or not. If they are installed, the command prompt will return you their version, else ‘Not installed’ message.

rpm -q compat-db compat-gcc-32 compat-gcc-32-c++ compat-libcom_err compat-libcwait compat-libgcc-296 compat-libstdc++-296 compat-libstdc++-33 gcc gcc-c++ glibc glibc-common glibc-devel glibc-headers glibc-kernheaders libgcc make

# Required packages for 64bit (x86_64) architecture:
binutils-2.15.92.0.2-21.x86_64
compat-db-4.1.25-9.i386
compat-db-4.1.25-9.x86_64
compat-gcc-32-3.2.3-47.3.x86_64
compat-gcc-32-c++-3.2.3-47.3.x86_64
compat-libcom_err-1.0-5.i386
compat-libcom_err-1.0-5.x86_64
compat-libgcc-296-2.96-132.7.2.i386
compat-libstdc++-296-2.96-132.7.2.i386
compat-libstdc++-33-3.2.3-47.3.i386
compat-libstdc++-33-3.2.3-47.3.x86_64
gcc-3.4.6-3.1.x86_64
gcc-c++-3.4.6-3.1.x86_64
glibc-2.3.4-2.25.i686
glibc-2.3.4-2.25.x86_64
glibc-common-2.3.4-2.25.x86_64
glibc-devel-2.3.4-2.25.i386
glibc-devel-2.3.4-2.25.x86_64
glibc-headers-2.3.4-2.25.x86_64
glibc-kernheaders-2.4-9.1.98.EL.x86_64
libgcc-3.4.6-3.1.i386
libgcc-3.4.6-3.1.x86_64
make-3.80-6.EL4.x86_64

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

yum -y install compat-gcc-32 compat-gcc-32-c++ compat-gcc-32-c++ glibc-devel libaio-devel xorg-x11-deprecated-libs-devel

3. Installing patches – You need to download three patches and install it. These patches are:

#Location :
http://oss.oracle.com/projects/compat-oracle/files/RedHat/

wget http://oss.oracle.com/projects/compat-oracle/dist/files/RedHat/compat-libcwait-2.1-1.i386.rpm
wget http://oss.oracle.com/projects/compat-oracle/dist/files/RedHat/compat-libcwait-2.1-2.x86_64.rpm
wget http://oss.oracle.com/projects/compat-oracle/dist/files/RedHat/compat-oracle-rhel4-1.0-5.i386.rpm

## === Navigate to the location where you have stored the downloaded file.

# rpm -Uvh compat-libcwait-2.1-1.i386.rpm
# rpm -Uvh compat-libcwait-2.1-2.x86_64.rpm
# rpm -Uvh compat-oracle-rhel4-1.0-5.i386.rpm

4. · User and Group Creation – Oracle installer wouldn’t run as the root user, so you need to create a user. It would be better, if you create a special group for Oracle. To do these, run the following commands in the command prompt.

groupadd oinstall
groupadd dba
groupadd oper
useradd -g oinstall -G dba oracle
passwd oracle

5. ORACLE_BASE Directory Creation -Login as root and create base directory for Oracle ($ORACLE_BASE).

mkdir -p /u02/oracle
chown -R oracle:oinstall /u02

6. · Setting up the kernel parameters – You also need to do a little modification in the the kernel parameters. You need to open the sysctl.conf file
# vi /etc/sysctl.conf

## === Add/update the following lines –

# Oracle Kernel Setting for Oracle 9i
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default=262144
net.core.wmem_default=262144
net.core.rmem_max=262144
net.core.wmem_max=262144

## === Save and close the file. You need to run a command to update the parameters
sysctl -p

#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

# Add or edit the following line in the /etc/pam.d/login file, if it does not already exist:
session required pam_limits.so

#Add the following lines to /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

#######################################################
#############   PART B (Logged in as oracle)   ####################
#######################################################

7. · Setting Environment Variables – Now since you have created the oracle user, you need to setup its environment variables. For that, you need to update oracle’s .bash_profile file.
Open bash profile of Oracle:

#vi ~/.bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/bin
export ORACLE_BASE=/u02/app
export ORACLE_HOME=/u02/app/oracle/product/9.2.0/db_1
export ORACLE_SID=sourcedb
export PATH=$PATH:$ORACLE_HOME/bin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$ORACLE_HOME/lib

# vi ~/.bashrc

alias dba=”sqlplus ‘/as sysdba'”
alias alert=”tail -100f /u02/app/admin/sourcedb/bdump/alert_sourcedb.log”

8. Download Oracle 9i – Download the Oracle 9i (9.2.0.4) ,store the files in oracle’s home directory. Launch the command prompt and navigate there.

## === Unzip the files –

gunzip amd64_db_9204_Disk1.cpio.gz
gunzip amd64_db_9204_Disk2.cpio.gz
gunzip amd64_db_9204_Disk3.cpio.gz

## === Unpack the cpio files –

cpio -idmv < amd64_db_9204_Disk1.cpio
cpio -idmv < amd64_db_9204_Disk2.cpio
cpio -idmv < amd64_db_9204_Disk3.cpio

9. · Starting Oracle Installer – Now you are all set for Oracle installation. In the command prompt go to the Disk1 directory and run runInstaller file.

cd /u02/installer/Disk1
export LD_ASSUME_KERNEL=2.4.19
./runinstaller

– Install Software Only, we’ll run dbca later.
10. Error during DBCA, when checking sqlplus, getting Sementation Fault.
# ERROR WHEN DBCA/LSNRCTL
Segmentation Fault When Execute Sqlplus, Oracle, Lsnrctl After New/Patchset Install [ID 316746.1]

java.io.IOException: Bad file descriptor
at java.io.FileInputStream.readBytes(Native Method)
at java.io.FileInputStream.read(FileInputStream.java:194)
at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(StreamDecoder.java:408)
at sun.nio.cs.StreamDecoder$CharsetSD.implRead(StreamDecoder.java:450)
at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:182)
at java.io.InputStreamReader.read(InputStreamReader.java:167)
at java.io.BufferedReader.fill(BufferedReader.java:136)
at java.io.BufferedReader.readLine(BufferedReader.java:299)
at java.io.BufferedReader.readLine(BufferedReader.java:362)
at oracle.sysman.assistants.util.sqlEngine.SQLEngine$ErrorStreamReader.run(SQLEngine.java:1985)
at java.lang.Thread.run(Thread.java:534)

# Solution
To implement the solution, please execute the following steps:

Refer to:
1. cd /usr/bin (as root)
2. mv gcc gcc.script
3. mv g++ g++.script
4. ln -s gcc32 gcc
5. ln -s g++32 g++
6. login as oracle software owner (make sure environment is correct)
7. cd $ORACLE_HOME/bin
8. relink all > relink.txt 2>&1 (check relink.txt for errors)

Re-run the dbca