Chinaunix首页 | 论坛 | 博客
  • 博客访问: 880169
  • 博文数量: 254
  • 博客积分: 5350
  • 博客等级: 大校
  • 技术积分: 2045
  • 用 户 组: 普通用户
  • 注册时间: 2008-06-27 13:27
文章分类

全部博文(254)

文章存档

2015年(1)

2014年(9)

2013年(17)

2012年(30)

2011年(150)

2010年(17)

2009年(28)

2008年(2)

分类: LINUX

2010-02-06 14:49:59

Installing Oracle 11g on RHEL 5

Quick Reference

1. Install RHEL 5

       First of all, we need to install RHEL 5 first. Just install it with gnome desktop.

1.1 Install necessary packages

1.     binutils

2.     compat-db

3.     compat-libstdc++

4.     control-center

5.     gcc

6.     gcc-c++

7.     glibc

8.     glibc-common

9.     libstdc++

10.  libstdc++-devel

11.  make

12.  sysstat

13.  setarch

14.  libXp

15.  libaio-devel

16.  elfutils-libelf-devel

17.  unixODBC-devel

Warning: Some package(s) will not be checked while installing Oracle, but to make sure Oracle will successful work, please do check all 17 packages listed here had been installed before run Oracle installer.

Determine whether a package installed

       Some pacakegs had been installed as system default, so we should determine which package(s) should be installed.

$ rpm -qa

       For example:

$ rpm -qa compat-db

       Note: Please use full name of packages.

Install missed packages

       To install a package, you must be root user. Here is an example of install missed packages. If you install RHEL 5 with default packages, you can just follow this example.

       Insert RHEL 5 CD-Rom Disk 2,

# cd /media/RHEL-5\ i386\ Disc\ 2/Server/

# rpm -Uvh compat-libstdc++-33-3.2.3-61.i386.rpm

# rpm -Uvh glibc-headers-2.5-12.i386.rpm

# rpm -Uvh glibc-devel-2.5-12.i386.rpm

# rpm -Uvh libgomp-4.1.1-52.el5.i386.rpm

# rpm -Uvh gcc-4.1.1-52.el5.i386.rpm

# rpm -Uvh libstdc++-devel-4.1.1-52.el5.i386.rpm

# rpm -Uvh gcc-c++-4.1.1-52.el5.i386.rpm

# rpm -Uvh libXp-1.0.0-8.i386.rpm

# rpm -Uvh libaio-devel-0.3.106-3.2.i386.rpm

# rpm -Uvh elfutils-libelf-devel-0.125-3.el5.i386.rpm elfutils-libelf-devel-static-0.125-3.el5.i386.rpm

# rpm -Uvh unixODBC-devel-2.2.11-7.1.i386.rpm

       Insert RHEL 5 CD-Rom Disk 3,

# cd /media/RHEL-5\ i386\ Disc\ 3/Server/

# rpm -Uvh compat-db-4.2.52-5.1.i386.rpm

# rpm -Uvh sysstat-7.0.0-3.el5.i386.rpm

2. Install Oracle 11g

2.1 Create groups and user

       Let's create users and groups for installation,

# groupadd -g 8000 dba

# groupadd -g 8001 oinstall

# useradd -G dba -d /home/oracle -g oinstall -c Oracle\ 11g -u 8000 oracle

# passwd oracle

2.2 Check kernel parameters

       We can get kernel parameters through /proc file system.

$ cd /proc/sys/kernel

$ cat sem

       The result is value of:  semmsl       semmns semopm semmni

       Those value should be,

       semmsl - 250

    semmns - 32000

    semopm - 100

    semmni – 128

$ cat shmall

$ cat shmmax

$ cat shmmni

       We shouldn't modify those default value unless we are working on a machine which memory is more than 8G. In that case, modify shmmax to half the size of physical memory (in bytes). Later we will explain how to modify it.

$ cd /proc/sys/fs

$ cat file-max

       If this value is lower than 65536, we should modify it to 65536 later.

$ cd /proc/sys/net/ipv4

$ cat ip_local_port_range

$ cd /proc/sys/net/core

$ cat rmem_default

$ cat rmem_max

$ cat wmem_default

$ cat  wmem_max

       We will find out that all of those value is lower than Oracle suggested. So we will modify those value later.

2.3 Modify kernel parameters

       We just need to modify /etc/sysctl.conf, below is an example of added content to the end of this file.

# kernel parameters for Oracle 11g

kernel.sem = 250 32000 100 128

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

       And after execute this command,  check kernel parameters again.

# sysctl -p

2.4 Set Environment

       Set system environment for all user. To do this, we can creat a new file,

# vim /etc/profile.d /oracle.sh

       And input below content,

# export oracle  environment

ORACLE_BASE="/opt/oracle"

ORACLE_HOME="/opt/oracle/product/11.1.x"

ORACLE_SID="orcl"

export ORACLE_BASE ORACLE_HOME ORACLE_SID

       And make it executable.

# chmod 755 /etc/profile.d/oracle.sh

       Load new environment,

# source /etc/profile

2.5 Actual installation

       Extract install source,

# mkdir -p /opt/oraInventory

# mkdir -p /opt/oracle/install-source

# cd /opt/oracle/install-source

# unzip ~/linux_11gR1_database.zip

# chown -R oracle.oinstall /opt/oracle

# chown -R oracle.oinstall /opt/oraInventory

# exit

$ xhost +

$ su – oracle

$ cd /opt/oracle/install-source/database

$ sh runInstaller

       Now follows GUI wizard to install Oracle 11g. Later you might get a network warning while checking system requirements. Skip this one unless you get more other warnings.

2.6 Automatic start oracle instance

       Set user oracle's path,

# vim ~oracle/.bash_profile

       Change path to :

PATH=$ORACLE_HOME/bin:$PATH:$HOME/bin

       Modify oracle's oratab file,     

# vim /etc/oratab

       Change the last line to :

orcl:/opt/oracle/product/11.1.x:Y

       Create oracle init script file,    

# vim /etc/init.d/oracle11g

        And input below content,

#!/bin/bash

#

# /etc/init.d/oracle11g

#

# Starts the Oracle Database

#

# chkconfig: 2345 95 5

# description: Oracle 10g Daemon

# processname: lsnrctl dbstart dbshut

source /etc/rc.d/init.d/functions

ORACLE_HOME="/opt/oracle/product/11.1.x"

[ -x $ORACLE_HOME/bin/lsnrctl ] || exit 1

[ -x $ORACLE_HOME/bin/dbstart ] || exit 1

[ -x $ORACLE_HOME/bin/dbshut ] || exit 1

USER="oracle"

RETVAL=0

desc="Oracle 11g Release 1"

start() {

   echo -n $"Starting $desc : "

   su - $USER -c "lsnrctl start"

   su - $USER -c "dbstart $ORACLE_HOME"

   RETVAL=$?

   [ $RETVAL -eq 0 ] && success || failure

   echo

   return $RETVAL

}

stop() {

   echo -n $"Shutting down $desc : "

   su - $USER -c "lsnrctl stop"

   su - $USER -c "dbshut $ORACLE_HOME"

   RETVAL=$?

   [ $RETVAL -eq 0 ] && success || failure

   echo

   return $RETVAL

}

case "$1" in

  start)

   start

   ;;

  stop)

   stop

   ;;

  restart)

   stop

   start

   RETVAL=$?

   ;;

  *)

   echo $"Usage: $0 {start|stop|restart}"

   RETVAL=1

esac

exit $RETVAL

       Finally make Oracle services automatically startup when system startup.

# chmod 755 /etc/init.d/oracle11g

# chkconfig --add oracle11g

       Note: Please turn off SELinux, and open 1521 port in firewall.

 

阅读(2199) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~