Oracle 10gR2 Installation on RHEL 4.0

This article is a comprehensive guide for installing Oracle10g Release 2 on the Red Hat linux 4 operating environment.

After installation of RHEL 4, check the following

Checking /tmp Space

According to Oracle’s documentation, the Oracle Universal Installer (OUI) requires up to 400 MB of free space in the /tmp directory. But OUI checks if /tmp is only greater than 80 MB.

To check the space in /tmp, run:
$ df /tmp

If you do not have enough space in the /tmp filesystem, you can temporarily create a tmp directory in another filesystem. Here is how you can do this:
su – root
mkdir /<AnotherFilesystem>/tmp
chown root.root /<AnotherFilesystem>/tmp
chmod 1777 /<AnotherFilesystem>/tmp
export TEMP=/<AnotherFilesystem>           # used by Oracle
export TMPDIR=/<AnotherFilesystem>         # used by Linux programs like the linker “ld”

When you are done with the Oracle installation, shutdown Oracle and remove the temporary /tmp directory:
su – root
rmdir /<AnotherFilesystem>/tmp
unset TEMP
unset TMPDIR
When installing Red Hat linux, I install ALL components. (Everything). This makes it easier than trying to troubleshoot missing software components.

For 10g R2 (32-bit) on RHEL 4 x86, the document Oracle Database Release Notes 10g Release 2 (10.2) for Linux x86 lists the following required package versions or higher:

  binutils-2.15.92.0.2-10.EL4
  compat-db-4.1.25-9
  control-center-2.8.0-12
  gcc-3.4.3-9.EL4
  gcc-c++-3.4.3-9.EL4
  glibc-2.3.4-2
  glibc-common-2.3.4-2
  gnome-libs-1.4.1.2.90-44.1
  libstdc++-3.4.3-9.EL4
  libstdc++-devel-3.4.3-9.EL4
  make-3.80-5
  pdksh-5.2.14-30
  sysstat-5.0.5-1
  xscreensaver-4.18-5.rhel4.2

Also ensure to install the libaio-0.3.96 RPM or a newer version! Otherwise the OUI prerequisite check will fail.

To check the RPMs, run:
  rpm -q binutils compat-db control-center gcc gcc-c++ glibc glibc-common gnome-libs \
         libstdc++ libstdc++-devel make pdksh sysstat xscreensaver libaio
Installing the RPMs

If you dint find any RPMs or if it is in lower version ,
download the latest RPMs and install using the following command.

login as s root user.

   rpm -Uvh gcc-3.4.4-2.x86_64.rpm (if the rpm is existing ,but its version is lower)

   rpm -Ivh gcc-3.4.4-2.x86_64.rpm (if the rpm is not  existing )

 

You can also Check the redhat-release File

Verify that the redhat-release RPM is installed on your Red Hat system:

rpm -q redhat-release
About Kernel Parameters:

Configuring Shared Memory

The Oracle database uses shared memory in UNIX to allow processes to access common data structures and data. These data structures and data are placed in a shared memory segment to allow processes the fastest form of Interprocess Communications (IPC) available. The speed is primarily a result of processes not needing to copy data between each other to share common data and structures – relieving the kernel from having to get involved.
Oracle uses shared memory in UNIX to hold its Shared Global Area (SGA). This is an area of memory within the Oracle instance that is shared by all Oracle backup and foreground processes. It is important to size the SGA to efficiently hold the database buffer cache, shared pool, redo log buffer as well as other shared Oracle memory structures. Inadequate sizing of the SGA can have a dramatic decrease in performance of the database.  
To determine all shared memory limits Oracle DBA can use the ipcs command. The following example shows the values of my shared memory limits on a fresh RedHat linux install using the defaults:

# ipcs -lm

—— Shared Memory Limits ——–
max number of segments = 4096
max seg size (kbytes) = 32768
max total shared memory (kbytes) = 8388608
min seg size (bytes) = 1
Let’s continue this section with an overview of the parameters that are responsible for configuring the shared memory settings in linux>.
SHMMAX
The SHMMAX parameter is used to define the maximum size (in bytes) for a shared memory segment and should be set large enough for the largest SGA size. If the SHMMAX is set incorrectly (too low), it is possible that the Oracle SGA (which is held in shared segments) may be limited in size. An inadequate SHMMAX setting would result in the following:
ORA-27123: unable to attach to shared memory segment
You can determine the value of SHMMAX by performing the following:

# cat /proc/sys/kernel/shmmax
33554432
As Oracle DBA can see from the output above, the default value for SHMMAX is 32MB. This is often too small to configure the Oracle SGA. I generally set the SHMMAX parameter to 2GB.
To change the value SHMMAX, you can use either of the following three methods:

This is method I use most often. This method sets the SHMMAX on startup by inserting the following kernel parameter in the /etc/sysctl.conf startup file:
# echo “kernel.shmmax=2147483648” >> /etc/sysctl.conf

If you wanted to dynamically alter the value of SHMMAX without rebooting the machine, you can make this change directly to the /proc file system. This command can be made permanent by putting it into the /etc/rc.local startup file:
# echo “2147483648” > /proc/sys/kernel/shmmax

Oracle DBA can also use the sysctl command to change the value of SHMMAX:
# sysctl -w kernel.shmmax=2147483648
SHMMNI
We now look at the SHMMNI parameters. This kernel parameter is used to set the maximum number of shared memory segments system wide. The default value for this parameter is 4096. This value is sufficient and typically does not need to be changed.
You can determine the value of SHMMNI by performing the following:

# cat /proc/sys/kernel/shmmni
4096
SHMALL
Finally, we look at the SHMALL shared memory kernel parameter. This parameter controls the total amount of shared memory (in pages) that can be used at one time on the system. In short, the value of this parameter should always be at least:
ceil(SHMMAX/PAGE_SIZE)
The default size of SHMALL is 2097152 and can be queried using the following command:
# cat /proc/sys/kernel/shmall
2097152
From the above output, the total amount of shared memory (in bytes) that can be used at one time on the system is:
SM = (SHMALL * PAGE_SIZE)
   = 2097152 * 4096
   = 8,589,934,592 bytes
The default setting for SHMALL should be adequate for our Oracle installation.
——————————————————————————–
Configuring Semaphores

Now that we have configured our shared memory settings, it is time to take care of configuring our semaphores. A semaphore can be thought of as a counter that is used to control access to a shared resource. Semaphores provide low level synchronization between processes (or threads within a process) so that only one process (or thread) has access to the shared segment, thereby ensureing the integrity of that shared resource. When an application requests semaphores, it does so using “sets”.
To determine all semaphore limits, use the following:

# ipcs -ls

—— Semaphore Limits ——–
max number of arrays = 128
max semaphores per array = 250
max semaphores system wide = 32000
max ops per semop call = 32
semaphore max value = 32767
Oracle DBA can also use the following command:
# cat /proc/sys/kernel/sem
250     32000   32      128
SEMMSL
The SEMMSL kernel parameter is used to control the maximum number of semaphores per semaphore set.
Oracle recommends setting SEMMSL to the largest PROCESS instance parameter setting in the init.ora file for all databases hosted on the linux> system plus 10. Also, Oracle recommends setting the SEMMSL to a value of no less than 100.

SEMMNI

The SEMMNI kernel parameter is used to control the maximum number of semaphore sets on the entire linux> system.
Oracle recommends setting the SEMMNI to a value of no less than 100.

SEMMNS

The SEMMNS kernel parameter is used to control the maximum number of semaphores (not semaphore sets) on the entire linux> system.
Oracle recommends setting the SEMMNS to the sum of the PROCESSES instance parameter setting for each database on the system, adding the largest PROCESSES twice, and then finally adding 10 for each Oracle database on the system. To summarize:

SEMMNS =   sum of PROCESSES setting for each database on the system
         + ( 2 * [largest PROCESSES setting])
         + (10 * [number of databases on system]
To determine the maximum number of semaphores that can be allocated on a linux> system, use the following calculation. It will be the lesser of:

SEMMNS  -or-  (SEMMSL * SEMMNI)
SEMOPM

The SEMOPM kernel parameter is used to control the number of semaphore operations that can be performed per semop system call.
The semop system call (function) provides the ability to do operations for multiple semaphores with one semop system call. A semaphore set can have the maximum number of SEMMSL semaphores per semaphore set and is therefore recommended to set SEMOPM equal to SEMMSL.

Oracle recommends setting the SEMOPM to a value of no less than 100.

Setting Semaphore Kernel Parameters
Finally, we see how to set all semaphore parameters using several methods. In the following, the only parameter I care about changing (raising) is SEMOPM. All other default settings should be sufficient for our example installation.
This is method I use most often. This method sets all semaphore kernel parameters on startup by inserting the following kernel parameter in the /etc/sysctl.conf startup file:
# echo “kernel.sem=250 32000 100 128” >> /etc/sysctl.conf

If you wanted to dynamically alter the value of all semaphore kernel parameters without rebooting the machine, you can make this change directly to the /proc file system. This command can be made permanent by putting it into the /etc/rc.local startup file:
# echo “250 32000 100 128″ > /proc/sys/kernel/sem

You can also use the sysctl command to change the value of all semaphore settings:
# sysctl -w kernel.sem=”250 32000 100 128”
——————————————————————————–
Configuring File Handles

When configuring our linux> database server, it is critical to ensure that the maximum number of file handles is large enough. The setting for file handles designate the number of open files that you can have on the entire linux> system.
Use the following command to determine the maximum number of file handles for the entire system:

# cat /proc/sys/fs/file-max
103062
Oracle recommends that the file handles for the entire system be set to at least 65536. In most cases, the default for Red Hat linux> is 103062. I have seen others (Red Hat linux> AS 2.1, Fedora Core 1, and Red Hat version 9) that will only default to 32768. If this is the case, Oracle DBA will want to increase this value to at least 65536.

This is method I use most often. This method sets the maximum number of file handles (using the kernel parameter file-max) on startup by inserting the following kernel parameter in the /etc/sysctl.conf startup file:
# echo “fs.file-max=65536” >> /etc/sysctl.conf

If you wanted to dynamically alter the value of all semaphore kernel parameters without rebooting the machine, you can make this change directly to the /proc file system. This command can be made permanent by putting it into the /etc/rc.local startup file:
# echo “65536” > /proc/sys/fs/file-max

Oracle DBA can also use the sysctl command to change the maximum number of file handles:
# sysctl -w fs.file-max=65536

For Oracle10g, the following kernel parameters have to be set to values greater than or equal to the recommended values which can be changed in the proc filesystem:

shmmax  = 2147483648   
shmmni  = 4096          
shmall  = 2097152       
shmmin  = 1            
shmseg  = 10           
semmsl  = 250          
semmns  = 32000       
semopm  = 100           
semmni  = 128          
file-max = 65536        
ip_local_port_range = 1024 65000
                       
so to ensure the above values execute:

su – root
sysctl -a

if any value is lower then replace it with the required value..

vi  /etc/sysctl.conf

kernel.shmmax=2147483648
kernel.sem=250 32000 100 128
fs.file-max=65536
net.ipv4.ip_local_port_range=1024 65000

then save and close

to make the changes into effect execute the following

login as a root user

sysctl -p
Creating Oracle User Accounts

To create the oracle account and groups, execute the following commands:

su – root
groupadd dba          # group of users to be granted SYSDBA system privilege
groupadd oinstall     # group owner of Oracle files
useradd -c “Oracle software owner” -g oinstall -G dba oracle
passwd oracle
Creating Oracle Directories

For Oracle10g you only need to create the directory for $ORACLE_BASE:
su – root
mkdir -p /u01/app/oracle
chown oracle.oinstall /u01/app/oracle

mkdir -p /u02/oradata/orcl
chown oracle.oinstall /u02/oradata/orcl

Login into the oracle user:

su – oracle

Configuring  Bash Profile:

vi .bash_profile

export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/10.1.0/db_1
export PATH=$PATH:$ORACLE_HOME/bin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export ORACLE_SID=orcl
export ORACLE_TERM=xterm

save the file and close

run the bash profile:

. .bash_profile

Then go to the installer cd

. .runInstaller

Then follow the Oracle Universal Installer GUI….

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s