Installation of Oracle9i R2 On Redhat 7.3

This document is an overview of the steps required to configure the Oracle 9iR2 database on Redhat Linux 7.3. It is designed to supplement two documents available from Oracle:

You should be familiar with those documents and have them available. This document supplements them by:

It does not cover:

Questions on this document should be addressed to alceste@xmission.com.


Verify System Requirements

In order to obtain reasonable performance, the machine being installed should be at least a Pentium-II 400 with 512MB RAM. The device(s) used to install Oracle onto should have at least 5 gig of free space; one disk should have at least 3.5 gigabytes. In addition, your system should have 1 gigabyte of swap space, and 500 megabytes free in the /tmp filesystem.

The system should be running Redhat 7.3 with all security updates patched. I have tested this installation of two versions of Redhat, and it has worked correctly.  Third-party packages might present problems.  You won't know until you try it.

Create Installation Shares

You will have to create a place for Oracle on your system. If this is a workstation system with a single disk, then there's little to be gained in making several physical partitions and filesystems to store Oracle on. If this is a full-featured server with many disks, you will want to create at least four partitions and filesystems for Oracle.  If you're using a striped and mirrored array, then you probably know how you want your filesystems set up.

Traditionally, on UNIX, these are named /u01, /u02, /u03 and /u04. Consult the Oracle Documentation for the OFA (Optimal Flexible Architecture) for more information.

In the simplest case, just use a single filesystem called /oracle. Create subdirectories under that and link them to the root in case you want switch to separate filesystems.


#mkdir /oracle/u01

#mkdir /oracle/u02

#mkdir /oracle/u03

#mkdir /oracle/u04

Note: Oracle officially only supports the ext2 filesystem. However, I believe quicker recovery from a hard outage can be had by using the ext3 filesystem, a journaling version of ext3. Other journaling filesystems (xfs and Reiserfs) exist for Linux, but the are not supported fully in Redhat 7.3. As always, your milege may vary.  See documents at www.gurulabs.com for information on methods of mounting ext3 filesystems and the various performance numbers.

Download and Install Installation Directory

Create an install directory. This does not need to be on the Oracle filesystem. It should have at least 2.5 gig of free space on it, in addition to the space required above. This directory does not have to be on an attached disk (it can be mounted off the network via NFS).

You will need three files:

lnx_920_disk1.cpio.gz

lnx_920_disk2.cpio.gz

lnx_920_disk3.cpio.gz

These files can be downloaded from Oracle.

Use gzip and the cpio program to extract the files.

#cd [directory_name}

#gunzip lnx*

#cpio -idmv <lnx_920_disk1.cpio

#cpio -idmv <lnx_920_disk2.cpio

#cpio -idmv <lnx_920_disk3.cpio


This should create three directories in your installation directory: Disk1, Disk2, and Disk3.

Alter Kernel Parameters

Redhat should give you mostly adequate kernel parameters to run Oracle9i. There are a few that need to be altered. This script sets the parameters to the either the Oracle Recommendations or the Redhat defaults on a 512M system.  If you plan on running multiple instances of Oracle on the same machine, you will probably need to increase some parameters (and your system resources) appropriately.

Copy this script into the /etc/init.d/ directory.


/etc/rc3.d/init.d/oraclekernel

#!/bin/sh
#
# chkconfig: 2345 26 74
# description: sets and unsets oracle kernel parameters
# processname: none
# config: /etc/sysconfig/oraclekernel

#shared memory
SEMMNI=100
SEMMNS=32000
SEMOPM=128
SEMMSL=100
SHMMAX=2147483648
SHMMIN=1
SHMMNI=4096
SHMSEG=4096
SHMVMX=32767
SHMALL=2097152
SOCKET_LOWER=1024
SOCKET_HIGHER=65000
if [ -f /etc/sysconfig/oraclekernel ]
then
. /etc/sysconfig/oraclekernel
fi

start() {
echo -n $"Setting Oracle Kernel Parameters"
echo
echo ${SEMMSL} ${SEMMNS} ${SEMOPM} ${SEMMNI} > /proc/sys/kernel/sem
echo ${SHMMAX} > /proc/sys/kernel/shmmax
echo ${SHMMNI} > /proc/sys/kernel/shmmni
echo ${SHMALL} > /proc/sys/kernel/shmall
echo ${FILE_MAX} > /proc/sys/fs/file-max
ulimit -n ${FILE_MAX}
echo ${SOCKET_LOWER} ${SOCKET_HIGHER} > /proc/sys/net/ipv4/ip_local_port_range
ulimit -u ${PROCS_USER}
RETVAL=$?
}

stop() {
echo
}

dostatus() {
RETVAL=0
}

restart() {
stop
start
RETVAL=$?
}

# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
status)
dostatus
;;
restart|reload)
restart
;;
*)
echo "Usage: oraclekernel {start|stop|status|restart|reload}"
exit 1
esac

exit $RETVAL


Create a symbolic link to the above script in /etc/rc.d/rc3.d/

# ln -s /etc/rc.d/init.d/oraclekernel /etc/rc.d/rc3.d/S10oraclekernel

This will set the Oracle parameters for you on every boot.  Once you have done this, you should run the script to alter your configuration before you begin the install.

# /etc/init.d/oraclekernel start

If you don't do this, you'll run into problems when you're creating your database.

Create group and user accounts

Now you must create the UNIX groups required by oracle. I create these groups in the system space using Redhat's extensions to the useradd and groupadd commands.

#/usr/sbin/groupadd -r dba

#/usr/sbin/groupadd -r oinstall

#/usr/sbin/useradd -g oinstall -G dba -d /home/oracle -r -m oracle

Change ownership of the needed /u01 directories.

#chown -R oracle:dba /oracle/u01

#chown -R oracle:dba /oracle/u02

#chown -R oracle:dba /oracle/u03

#chown -R oracle:dba /oracle/u04

In order for the Oracle Web Services to run as a webserver user, and not as an Oracle user, you must change the primary group of apache for the Oracle install.  You can skip this step if you didn't install the Apache webserver when you loaded Linux.

# /usr/sbin/usermod -g oinstall apache


Configure Necessary Environment for Oracle User

The Oracle user should have several environment variables created during the installation process. The most effective way to do this is to configure the oracle user's shell by editing ~/.bashrc The bashrc file runs when you login as the Oracle user, or su using the – argument. 1 Edit the ~oracle/.bashrc to include the necessary environment variables. Here is a .bashrc listing for a typical setup:


~oracle/.bashrc

export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=${ORACLE_BASE}/product/9.2.0.1.0
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export PATH=$ORACLE_HOME/bin:${PATH}

 

These settings will increase the process and file parameters for Oracle and other users. 


/etc/profile.d/oracle.sh

# Change ulimit process and file parameters for oracle.
ulimit -S -c 0 > /dev/null 2>&1
ulimit -n 65536 > /dev/null 2>&1
ulimit -u 16384 > /dev/null 2>&1

You also might want to set the name of the default database on your machine for the oracle user. If you want to do that, once you’ve created the database, add

ORACLE_SID=database_name to the .bashrc file above.

One you have done that, assuming you're installing on the local machine, you'll need to allow other users (the oracle user) to display on your machine's screen. You do this by using the xhost command.

#xhost +localhost

This will allow any user on the local machine to display windows on your desktop. You'll need this to display the GUI oracle installer when installing as oracle.

Finally, you can

#su - oracle

and begin the installation.

Start the Installation

Start the installation by running:

$[your-oracle-installation-directory]/Disk1/runInstaller

  1. Accept the default path for the Oracle installation information.

  2. Type "oinstall" for the UNIX group name.

  3. Run the script the install asks you to by opening an additional window as root.  Leave this window open, you'll need it in a few minutes.

  4. Choose Oracle9i Database.

  5. Choose Enterprise Edition.

  6. Choose General Purpose (if you have experience with Oracle, you may choose to create a different style of database)

  7. Enter a fully qualified database name in the Window that reads “database identification.” An example might be “devtest.oracledb1.mydomain.org” It's probably not a good idea to name the database the same thing as the host, although you can include the hostname as part of the database name.

  8. Accept the SID provided.

  9. Change the database file location to /u02/app/oracle/oradata in order to keep datafiles and the installation separate.

  10. Use Unicode character set unless you have a reason not to. 

  11. Start the install.

Fix a Little Bug

Once the installation has started you'll probably need to change a bad line in an Oracle Makefile. If you hit this bug, you'll get an error message that reads:

“Error in invoking target install of makefile /u01/app/oracle/product/9.2.0.1.0/ctx/lib/ins_ctx.mk”

What has happened is that the Oracle file that links (connects the shared libraries with the compiled programs) hasn't got every library it needs listed.

Edit the file $ORACLE_HOME/ctx/lib/env_ctx.mk and add a "$(LDLIBFLAG)dl" to the line that begins INSO_LINK= and save it.

Here is the full line with the added "$(LDLIBFLAG)dl" flag:

INSO_LINK =-L$(CTXLIB) $(LDLIBFLAG)m $(LDLIBFLAG)dl $(LDLIBFLAG)sc_ca $(LDLIBFLAG)sc_fa $(LDLIBFLAG)sc_ex $(LDLIBFLAG)sc_da $(LDLIBFLAG)sc_ut $(LDLIBFLAG)sc_ch $(LDLIBFLAG)sc_fi $(LLIBCTXHX) $(LDLIBFLAG)c -Wl,-rpath,$(CTXHOME)lib $(CORELIBS) $(COMPEOBJS)

The database should then continue installing.

Finish the Installation

When asked, run the script required as root.

At this point, your 9i server is installed. However, Oracle runs several configuration assistants which help you configure the network and create a database.

The system will start the Network Configuration assistant first. Until we have a full Oracle infrastructure, you can choose a typical setup.

The next tool that the installation starts is the database configuration assistant. I would use this tool right now to create a test database. Once you have everything working, you'll probably want to go back to it and create an appropriate database for your project. If you accept the defaults through this dialog, you should be OK.

At this point your database installation should be working. If you're unfamiliar with Oracle, well, now it’s time to become familiar with the world’s most powerful and complex piece of software.

1Actually, the .bashrc runs when you execute a new shell, and .bash_profile when you login, but .bash_profile reads in the environment in ~/.bashrc on Redhat Linux.