Index

Next: CHECK LIST

Appendixes.

TABLE OF CONTENT:

Appendixes. 1

APPENDIX 1. Modified orarun scripts. 1

APPENDIX 2. List of packages. 12

APPENDIX III. References: 12

 

Table of scripts.

File /etc/profile.d/oracle.sh (FILE.d/oracle.sh): 1

File /etc/sysconfig/oracle (FILE.d/sysconfig.oracle): 2

File /etc/init.d/oracle (FILES.d/init.oracle): 5

 

APPENDIX 1. Modified orarun scripts.

These files are slightly modified components of ‘orarun’ package, which is part of SUSE Linux Enterprise Server packages. I hope to eliminate their modification with future orarun package. I print them here only to allow full understanding of this installation process.

File /etc/profile.d/oracle.sh (FILE.d/oracle.sh):

#

# These is special version of oracle.sh file, modified for Oracle 10g RAC installation on SLES9

# Do not use it in other cases.

#

# Login environment variable settings for Oracle

# The code below is done ONLY if the user is "oracle":

# Set the ULIMITs for the shell and add gcc_old to PATH if it's installed

#

 

  # Get settings, if file(s) exist(s). If not, we simply use defaults.

  if test -f /etc/sysconfig/oracle; then

    # new location as of SL 8.0 is directory /etc/sysconfig/

    . /etc/sysconfig/oracle

  else

    if test -f /etc/rc.config.d/oracle.rc.config; then

      # location is directory /etc/rc.config.d/

      . /etc/rc.config.d/oracle.rc.config

    else

      if test -f /etc/rc.config; then

      # old SuSE location was to have everything in one file

      . /etc/rc.config

      fi

    fi

  fi

 

 

  ORACLE_SID=test1

 

  ORACLE_BASE=/opt/oracle

  ORACLE_HOME=$ORACLE_BASE/product/10.1.0/db_1

 

  TNS_ADMIN=$ORACLE_HOME/network/admin

  ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data

  PATH=$PATH:$ORACLE_HOME/bin

  LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}$ORACLE_HOME/lib:$ORACLE_HOME/ctx/lib

  CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib:$ORACLE_HOME/network/jlib

 

  export ORACLE_BASE ORACLE_HOME ORA_NLS33 ORACLE_SID PATH LD_LIBRARY_PATH CLASSPATH TNS_ADMIN

 

  # ORACLE_TERM=xterm; export ORACLE_TERM

  # NLS_LANG=AMERICAN_AMERICA.UTF8; export NLS_LANG

 

  #

  # This requires the limits to have been increased by root

  # e.g. at boot time by the /etc/rc.d/oracle script, both

  # ulimit and kernel parameters.

  #

 

  # Add package "gcc_old" gcc 2.95.3 to path - FIRST

  #if test -x /opt/gcc295/bin/gcc; then

  #  export PATH=/opt/gcc295/bin:$PATH

  #fi

 

  # RAC (cluster) component GSD commands don't run when this is

  # set - which it is if a SuSE Java package is installed.

  unset JAVA_BINDIR JAVA_HOME

 

  # Set ulimits:

  #

  # We suppress any warning messages, so if the hard limits have not been

  # increased by root and the commands don't work we keep silent...

  # This is because the only one who needs it is the shell that starts

  # the DB server processes, and the number of warning messages created

  # here is potentially way too much and confusing

 

  # core dump file size

  ulimit -c ${MAX_CORE_FILE_SIZE_SHELL:-0} 2>/dev/null

 

  # max number of processes for user

  ulimit -u ${PROCESSES_MAX_SHELL:-16384} 2>/dev/null

 

  # max number of open files for user

  ulimit -n ${FILE_MAX_SHELL:-65536} 2>/dev/null

 

  export LD_ASSUME_KERNEL=2.4.21

 
 
 
 
File /etc/sysconfig/oracle (FILE.d/sysconfig.oracle):

#

# Note: the environment variables are set in /etc/profile.d/oracle.[c]sh

# Owner of Oracle installation; Oracle will be started as that user

#

# This is file for ORACLE 10 G CRS system

# Use original file (from orarun) for Oracle9 and Oracle8

#

ORACLE_OWNER="oracle"

 

#

# Start Oracle Cluster Filesystem (for RAC)

#

START_ORACLE_DB_OCFS="yes"

 

#

# Start Cluster Ready Services (for RAC10g; notice - they are started by inittab, so this line do not influence original start)

# Setting NO do not turn it off, but prevents this script from stopping and restarting CRS

#

START_ORACLE_DB_CRS="yes"

 

#

# Start Enterprise manager for Oracle10

#

START_ORACLE_DB_EM="yes"

 

 

#

# Set the KERNEL PARAMETERS for Oracle. Requires a 2.4 kernel, in 2.2

# kernels only SHMMAX can be set during runtime via /proc.

#

# DO NOT CHANGE ANY VALUES unless you KNOW what you are doing and why!!!

#

# Have a look at the Oracle ReleaseNotes for the Oracle product you are

# using for how to set these values. If you do not set them we will

# assume some reasonable defaults for a medium Oracle 9i database

# system (that's a pretty big and busy one!).

#

# The /proc filesystem provides access to kernel parameters and statistics

# and the /proc/sys/ system allows one to change some kernel settings

# during runtime.

# If you have the kernel sources installed (package kernel-source)

# You can find more information here:

#   /usr/src/linux/Documentation/sysctl/ (directory)

#   /usr/src/linux/Documentation/filesystems/proc.txt

#   /usr/src/linux/Documentation/networking/ip-sysctl.txt

#

SET_ORACLE_KERNEL_PARAMETERS="yes"

 

#

# Max. shared memory segment size that can be allocated.

# The ONLY parameter you should touch at all (and only if you have more than

# 4 GB of physical memory) is SHMMAX. It does not make any sense to change

# the others for Oracle!

# Kernel sources header file: /usr/src/linux/include/linux/shm.h

# Recommended: SHMMAX = 0.5*(physical memory). Higher # values are okay,

# since this parameter only sets the OS maximum:

# This setting does not affect how much shared memory is needed or used by

# Oracle8i or the operating system. It is used only to indicate the maximum

# allowable size. This setting also does not impact operating system

# kernel resources.

# The values for SHMSEG and SHMMIN cannot be changed via the proc-interface,

# but there is no need to change anything anyway!

# SHMSEG (default: 4096): max. number of shared segments per process

# SHMMIN (default: 1): min. size of a shared mem. segment in bytes

#

# SHMMAX max. size of a shared memory segment in bytes

#

SHMMAX=3294967296

#

# SHMMNI (default: 4096): max. number of shared segments system wide

# No change is needed for running Oracle!

#

SHMMNI=4096

#

# SHMALL (default: 8G [2097152]): max. shm system wide (pages)

# No change is needed for running Oracle!

#

SHMALL=2097152

 

#

# Sempahore values

# Kernel sources header file: /usr/src/linux/include/linux/sem.h

#

# SEMVMX: semaphore maximum value. Oracle recommends a value of 32767,

# which is the default in SuSE *and* the maximum value possible.

# This value cannot be changed during runtime via the /proc interface,

# but there is no need to do so anyway!

#

# SEMMSL: max. number of semaphores per id. Set to 10 plus the largest

# PROCESSES parameter of any Oracle database on the system (see init.ora).

# Max. value possible is 8000.

#

SEMMSL=1250

#

# SEMMNS: max. number of semaphores system wide. Set to the sum of the

# PROCESSES parameter for each Oracle database, adding the largest one

# twice, then add an additional 10 for each database (see init.ora).

# Max. value possible is INT_MAX (largest INTEGER value on this

# architecture, on 32-bit systems: 2147483647).

#

SEMMNS=32000

#

# SEMOPM: max. number of operations per semop call. Oracle recommends

# a value of 100. Max. value possible is 1000.

#

SEMOPM=100

#

# SEMMNI: max. number of semaphore identifiers. Oracle recommends a

# a value of (at least) 100. Max. value possible is 32768 (defined

# in include/linux/ipc.h: IPCMNI)

#

SEMMNI=256

 

#

# Defines the local port range that is used by TCP and UDP to

# choose the local port. The first number is the first, the

# second the last local port number. Default value depends on

# amount of memory available on the system:

# > 128Mb 32768-61000

# < 128Mb 1024-4999 or even less.

# This number defines number of active connections, which this

# system can issue simultaneously to systems not supporting

# TCP extensions (timestamps). With tcp_tw_recycle enabled

# (i.e. by default) range 1024-4999 is enough to issue up to

# 2000 connections per second to systems supporting timestamps.

#

IP_LOCAL_PORT_RANGE="1024 65000"

 

#

# The *_SHELL settings are for the Oracle startup script (/etc/rc.d/oracle

# and 'rcoracle') *ONLY*, it does NOT have any influence on the

# limits if you login as user 'oracle' and start Oracle from there!!!

# This sets the limits for the number of open files and processes.

# FILE_MAX_SHELL *MUST* be lower than FILE_MAX_KERNEL, obviously

#

FILE_MAX_KERNEL=131072

FILE_MAX_SHELL=65536

PROCESSES_MAX_SHELL=16384

MAX_CORE_FILE_SIZE_SHELL=unlimited

 

#

# By Andrea Arcangeli, SuSE:

# This decreases the swappiness of the kernel. It will tend to swap less. It

# will shrink the pagecache more, before falling back into swap. So

# increasing the mapped ratio will result in less cache and less swap.

# On a lowmemory machine reducing the cache, and the swap can decrease

# performance.

# On a database machine with plenty of ram, swapping some hundred mbyte

# instead may not be necessary, better to shrink the cache, in particular

# because having that much shm allocated tends to fool the VM. The VM

# can't know if the shm is fs cache too (the shm in Oracle is mostly cache

# for the filesystem).

# So going to 1000 is probably a good idea for high end servers with

# plenty of memory. Using "1000" make sense where you really know swapping

# is going to be not necessary during all the important workloads because

# you tune the machine in a way that it has enough ram to succeed w/o the

# need of swap. Using 1000 tells the VM to swap less.

#

VM_MAPPED_RATIO=1000

 

#

# Max. size of an async I/O request

#

AIO_MAX_SIZE=262144

 

 

 

File /etc/init.d/oracle (FILES.d/init.oracle):

#! /bin/sh

# Copyright (c)1995 SuSE GmbH Nuernberg, Germany.

#

# Author: SuSE Oracle Team <feedback@suse.de>

# Homepage: http://www.suse.com/oracle/

#

### BEGIN INIT INFO

# Provides: oracle

# Required-Start: $network $syslog $remote_fs raw

# Required-Stop:

# Default-Start: 3 5

# Default-Stop: 0 1 2 6

# Description: Start the Oracle database

### END INIT INFO

 

 

# Shell functions sourced from /etc/rc.status:

#      rc_check         check and set local and overall rc status

#      rc_status        check and set local and overall rc status

#      rc_status -v     ditto but be verbose in local rc status

#      rc_status -v -r  ditto and clear the local rc status

#      rc_failed        set local and overall rc status to failed

#      rc_reset         clear local rc status (overall remains)

#      rc_exit          exit appropriate to overall rc status

. /etc/rc.status

 

 

# catch mis-use right here at the start

if [  "$1" != "start"  -a  "$1" != "stop"  -a  "$1" != "status" -a "$1" != "restart"  -a "$1" != "kill" ]; then

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

    exit 1

fi

 

 

LOAD_OCFS=/sbin/load_ocfs

MOUNT=/bin/mount

UMOUNT=/bin/umount

MKDIR=/bin/mkdir

RMMOD=/sbin/rmmod

 

CHECKPROC="/sbin/checkproc"

test -x "$CHECKPROC" || CHECKPROC="test -x "

 

 

# Get settings, if file(s) exist(s). If not, we simply use defaults.

if test -f /etc/sysconfig/oracle; then

    # new location as of SL 8.0 is directory /etc/sysconfig/

    . /etc/sysconfig/oracle

else

  if test -f /etc/rc.config.d/oracle.rc.config; then

    # location is directory /etc/rc.config.d/

    . /etc/rc.config.d/oracle.rc.config

  else

    if test -f /etc/rc.config; then

    # old SuSE location was to have everything in one file

    . /etc/rc.config

    fi

  fi

fi

 

 

# Determine the base and follow a runlevel link name.

# DISABLED by default because it's very individual...

#base=${0##*/}

#link=${base#*[SK][0-9][0-9]}

# Force execution if not called by a runlevel directory.

#test $link = $base && START_ORACLE_DB="yes" && START_ORACLE_DB_LISTENER="yes" && SET_ORACLE_KERNEL_PARAMETERS="yes"

 

 

# First reset status of this service

rc_reset

 

 

#

# Get and check environment (e.g. ORACLE_HOME)

#

ora_environment()

{

  test -f /etc/profile.d/oracle.sh && . /etc/profile.d/oracle.sh

  if [ ! -z "$ORACLE_HOME" -a ! -d "$ORACLE_HOME" ]; then

    echo

    echo "${warn}ORACLE_HOME directory $ORACLE_HOME does not exist!$norm"

    echo "Unsetting ORACLE_HOME, will try to determine it from system..."

    unset ORACLE_HOME

  fi

 

  # Try /etc/oratab if it's not set in /etc/profile.d/oracle.sh

  test -z "$ORACLE_HOME" && test -f /etc/oratab &&                        \

    ORACLE_HOME=`awk -F: '/^[^#].*:.+:[YN]/ {if ($2!="") print $2; exit}' </etc/oratab` &&   \

    echo && echo "ORACLE_HOME not set, but I found this in /etc/oratab: $ORACLE_HOME" && echo

 

  if [ -z "$ORACLE_HOME" ]; then

    echo "${warn}ORACLE_HOME environment variable not set.$norm"

    echo "Check /etc/profile.d/oracle.sh and /etc/oratab"

  fi

 

  if [ ! -d "$ORACLE_HOME" ]; then

    echo "${warn}Cannot find ORACLE_HOME directory $ORACLE_HOME.$norm"

    echo "Environment settings are wrong! Check /etc/profile.d/oracle.sh"

  fi

 

  test -z "$ORACLE_OWNER" && ORACLE_OWNER="oracle"

 

 

  if [ "$1" = "start" ]; then

    echo -n " ${extd}SETTINGS $1 from /etc/sysconfig/oracle$norm"

    if [ ! -f /etc/sysconfig/oracle ]; then

      echo " - ${warn}!!! MISSING !!!$norm"

    else

      echo

    fi

    echo " - Set Kernel Parameters for Oracle:   ${SET_ORACLE_KERNEL_PARAMETERS:-no}"

    echo " - Start Oracle OCFS:                  ${START_ORACLE_DB_OCFS:-no}"

    echo " - Start Oracle CRS:                   ${START_ORACLE_DB_CRS:-no}"

    echo " - Start Oracle EM:                    ${START_ORACLE_DB_EM:-no}"

   fi

}

 

 

# Here we finally get to do the real work.

case "$1" in

  start)

    echo

    echo "#############################################################################"

    echo "#                 Begin of   O R A C L E   startup section                  #"

    echo "#############################################################################"

    echo

    ora_environment start

 

    #

    # Check if we really have all the Oracle components we are told to start

    #

    if [ ! -x $ORACLE_HOME/bin/emctl -a ${START_ORACLE_DB_EM:-no} = "yes" ]; then

      echo "${warn}Can't find needed file: emctl - Setting START_ORACLE_DB_EM = no $norm"

      START_ORACLE_DB_EM="cannot";

    fi

 

    if [ ! -x /etc/init.d/init.crs -a ${START_ORACLE_DB_CRS:-no} = "yes" ]; then

      echo "${warn}Can't find needed file: init.crs - Setting START_ORACLE_DB_CRS = no $norm"

      START_ORACLE_DB_CRS="cannot";

    fi

 

 

    if [ ! -x /sbin/load_ocfs -a ${START_ORACLE_DB_OCFS:-no} = "yes" ]; then

      echo "${warn}Can't find needed file: /sbin/load_ocfs - Setting START_ORACLE_DB_OCFS = no $norm"

      START_ORACLE_DB_OCFS="cannot";

    fi

 

    echo

 

    # Set kernel parameters for Oracle

    if [ "${SET_ORACLE_KERNEL_PARAMETERS:-no}" == "yes" ]; then

      echo

      echo "Setting kernel parameters for Oracle, see file"

      if test -f /etc/sysconfig/oracle; then

        echo "/etc/sysconfig/oracle for explanations."

      else

        echo "/etc/rc.config.d/oracle.rc.config for explanations."

      fi

      echo

 

      if  [ ! -d /proc/sys/kernel ]; then

          echo; echo "No sysctl kernel interface - cannot set kernel parameters."; echo

          rc_failed

      else

        # Set shared memory parameters

        echo -n "${extd}Shared memory:$norm    "

        test -f /proc/sys/kernel/shmmax && echo -n "  SHMMAX=${SHMMAX:-3294967296}"

        test -f /proc/sys/kernel/shmmax && echo ${SHMMAX:-3294967296} > /proc/sys/kernel/shmmax

        test -f /proc/sys/kernel/shmmni && echo -n "  SHMMNI=${SHMMNI:-4096}"

        test -f /proc/sys/kernel/shmmni && echo ${SHMMNI:-4096}       > /proc/sys/kernel/shmmni

        test -f /proc/sys/kernel/shmall && echo    "  SHMALL=${SHMALL:-2097152}"

        test -f /proc/sys/kernel/shmall && echo ${SHMALL:-2097152}    > /proc/sys/kernel/shmall

        test -f /proc/sys/kernel/shmall || echo

 

        # Set the semaphore parameters:

        # see Oracle release notes for Linux for how to set these values

        # SEMMSL, SEMMNS, SEMOPM, SEMMNI

        echo -n "${extd}Semaphore values:$norm "

        test -f /proc/sys/kernel/sem && echo -n "  SEMMSL=${SEMMSL:-1250}"

        test -f /proc/sys/kernel/sem && echo -n "  SEMMNS=${SEMMNS:-32000}"

        test -f /proc/sys/kernel/sem && echo -n "  SEMOPM=${SEMOPM:-100}"

        test -f /proc/sys/kernel/sem && echo    "  SEMMNI=${SEMMNI:-256}"

        test -f /proc/sys/kernel/sem && echo ${SEMMSL:-1250} ${SEMMNS:-32000} ${SEMOPM:-100} ${SEMMNI:-128} > /proc/sys/kernel/sem

        test -f /proc/sys/kernel/sem || echo

 

        echo -n "${extd}Other values:$norm     "

        test -f /proc/sys/fs/file-max && echo -n "  FILE_MAX_KERNEL=${FILE_MAX_KERNEL:-131072}"

        test -f /proc/sys/fs/file-max && echo ${FILE_MAX_KERNEL:-131072} > /proc/sys/fs/file-max

        test -f /proc/sys/net/ipv4/ip_local_port_range && echo "  IP_LOCAL_PORT_RANGE=${IP_LOCAL_PORT_RANGE:-"1024 65000"}"

        test -f /proc/sys/net/ipv4/ip_local_port_range && echo ${IP_LOCAL_PORT_RANGE:-"1024 65000"} > /proc/sys/net/ipv4/ip_local_port_range

        test -f /proc/sys/vm/vm_mapped_ratio && echo -n "                    VM_MAPPED_RATIO=${VM_MAPPED_RATIO:-250}"

        test -f /proc/sys/vm/vm_mapped_ratio && echo ${VM_MAPPED_RATIO:-250} > /proc/sys/vm/vm_mapped_ratio

        test -f /proc/sys/fs/aio-max-size && echo "  AIO_MAX_SIZE=${AIO_MAX_SIZE:-131072}"

        test -f /proc/sys/fs/aio-max-size && echo ${AIO_MAX_SIZE:-131072} > /proc/sys/fs/aio-max-size

        test -f /proc/sys/fs/aio-max-size || echo

 

        echo -n "${extd}ULIMIT values:$norm    "

        echo    "  MAX_CORE_FILE_SIZE_SHELL=${MAX_CORE_FILE_SIZE_SHELL:-0}"

        ulimit -c ${MAX_CORE_FILE_SIZE_SHELL:-0}

        echo -n "                    FILE_MAX_SHELL=${FILE_MAX_SHELL:-65536}"

        ulimit -n ${FILE_MAX_SHELL:-65536}

        echo    "  PROCESSES_MAX_SHELL=${PROCESSES_MAX_SHELL:-16384}"

        ulimit -u ${PROCESSES_MAX_SHELL:-16384}

 

        # Check if shmmax is really set to what we want - on some systems and

        # certain settings the result could be shmmax=0 if you set it to e.g. 4GB!

        if [ `cat /proc/sys/kernel/shmmax` != "${SHMMAX:-3294967296}" ]; then

          echo "${warn}---- WARNING - SHMMAX could not be set properly ----$norm"

          echo "   Tried to set it to: ${SHMMAX:-3294967296}"

          echo "   Value is now:       `cat /proc/sys/kernel/shmmax`"

          echo "   You might try again with a lower value."

        fi

      fi

      echo

   

      echo -n "Kernel parameters set for Oracle: "

      rc_status -v

      echo

      echo

    fi

 

    rc_reset

 

    echo -n "  - Starting Oracle Cluster Filesystem..."

    if [ "${START_ORACLE_DB_OCFS:-no}" = "yes" ]; then

       $LOAD_OCFS >& /dev/null

       rc_status -v -r

       echo -n "  - Mounting Oracle Cluster Filesystem(s)..."

       $MOUNT -a -t ocfs >& /dev/null

       rc_status -v -r

    else

       if [ ${START_ORACLE_DB_OCFS:-no} = "cannot" ]; then

         rc_status -s

       else

         rc_status -u

       fi

    fi

 

    rc_reset

 

    echo -n "  - Starting Oracle CRS..."

    if [ "${START_ORACLE_DB_CRS:-no}" = "yes" ]; then

       /etc/init.d/init.crs start >& /dev/null

       rc_status -v -r

       sleep 2

       kill -1 1

    else

       if [ ${START_ORACLE_DB_CRS:-no} = "cannot" ]; then

         rc_status -s

       else

         rc_status -u

       fi

    fi

 

    rc_reset

 

    echo

 

    echo -n "  - Starting Oracle EM dbconsole..."

    if [ "${START_ORACLE_DB_EM:-no}" = "yes" ]; then

        su - $ORACLE_OWNER -c "export ORACLE_HOME=$ORACLE_HOME TNS_ADMIN=$TNS_ADMIN; $ORACLE_HOME/bin/emctl start dbconsole >& /dev/null &"

      rc_status -v -r

    else

       if [ ${START_ORACLE_DB_EM:-no} = "cannot" ]; then

         rc_status -s

       else

         rc_status -u

       fi

    fi

 

    rc_reset

    ;;

 

 

  stop|kill)

    echo

    echo "#############################################################################"

    echo "#                 Begin of   O R A C L E   shutdown section                 #"

    echo "#############################################################################"

    echo

    ora_environment stop

 

    echo "Shutting down Oracle services (only those running)"; echo

 

    if test -x $ORACLE_HOME/Apache/Apache/bin/apachectl && $CHECKPROC $ORACLE_HOME/Apache/Apache/bin/httpd 

    then

        echo -n "Shutting down Apache: "

        export ORACLE_HOME=$ORACLE_HOME TNS_ADMIN=$TNS_ADMIN; $ORACLE_HOME/Apache/Apache/bin/apachectl stop >& /dev/null; rc_status -v -r

    fi

   

    if test -x $AGENT_PROG && $CHECKPROC $ORACLE_HOME/bin/dbsnmp

    then

         echo -n "Shutting down Agent: "

         su - $ORACLE_OWNER -c "export ORACLE_HOME=$ORACLE_HOME TNS_ADMIN=$TNS_ADMIN; $AGENT_STOP >& /dev/null"; rc_status -v -r

    fi

   

    if [ -x $ORACLE_HOME/bin/emctl ]

    then

        echo -n                                          

        echo -n "Shutting down EM console: "

        su - $ORACLE_OWNER -c "export ORACLE_HOME=$ORACLE_HOME TNS_ADMIN=$TNS_ADMIN; emctl stop dbconsole " &

        sleep 20

        killall emagent

        killall emdctl

        rc_status -v -r

    fi

   

    test -x $ORACLE_HOME/bin/cmctl                   && echo -n                                          && echo -n "Shutting down Connection Manager: " && (su - $ORACLE_OWNER -c "export ORACLE_HOME=$ORACLE_HOME TNS_ADMIN=$TNS_ADMIN; $ORACLE_HOME/bin/cmctl stop >& /dev/null"; rc_status -v -r)

    test -x $ORACLE_HOME/bin/lsnrctl                 && $CHECKPROC $ORACLE_HOME/bin/tnslsnr              && echo -n "Shutting down Listener: " && (su - $ORACLE_OWNER -c "export ORACLE_HOME=$ORACLE_HOME TNS_ADMIN=$TNS_ADMIN; $ORACLE_HOME/bin/lsnrctl stop >& /dev/null & "; rc_status -v -r)

    test -x $ORACLE_HOME/bin/dbshut                  && $CHECKPROC $ORACLE_HOME/bin/oracle               && echo -n "Shutting down Database: " && (su - $ORACLE_OWNER -c "export ORACLE_HOME=$ORACLE_HOME TNS_ADMIN=$TNS_ADMIN; $ORACLE_HOME/bin/dbshut >& /dev/null"; rc_status -v -r)

    test -x $ORACLE_HOME/bin/gsdctl                  && test "" != "`ps U oracle|grep 'DPROGRAM=gsd'`"   && echo -n "Shutting down GSD: " && (su - $ORACLE_OWNER -c "export ORACLE_HOME=$ORACLE_HOME TNS_ADMIN=$TNS_ADMIN; unset JAVA_BINDIR; unset JAVA_HOME; $ORACLE_HOME/bin/gsdctl stop >& /dev/null"; rc_status -v -r)

    test -x $ORACLE_HOME/oracm/bin/oracm             && $CHECKPROC $ORACLE_HOME/oracm/bin/oracm          && echo -n "Shutting down OCM: " && (killall oracm >& /dev/null; rm -f /etc/rac_on; rc_status -v -r)

    test -x /etc/init.d/init.crs                  && echo -n                                              && echo -n "Turning off CRS:" && /etc/init.d/init.crs stop 

    if [ "`$MOUNT -t ocfs | grep ocfs`" != "" ]; then

      echo -n "Unmounting all OCFS filesystems: " && ($UMOUNT -t ocfs -a; rc_status -v -r)

    fi

    if [ "$1" = "kill" ]

    then

        echo Killing all ORACLE processes

        kill `ps aux | grep '^oracle' | awk '{print $2}'`

        sleep 10

        kill -9 `ps aux | grep '^oracle' | awk '{print $2}'`

    fi

 

    ;;

  status)

    echo

    echo "#############################################################################"

    echo "#                  Begin of   O R A C L E   status section                  #"

    echo "#############################################################################"

    echo

    ora_environment status

 

    echo "${extd}Kernel Parameters$norm"

    echo -n "Shared memory:"

    echo -n "  SHMMAX=" `cat /proc/sys/kernel/shmmax`

    echo -n "  SHMMNI=" `cat /proc/sys/kernel/shmmni`

    echo    "  SHMALL=" `cat /proc/sys/kernel/shmall`

    echo -n "Semaphore values:"

    echo    "  SEMMSL, SEMMNS, SEMOPM, SEMMNI: " `cat /proc/sys/kernel/sem`

    echo

 

    if [ -x $ORACLE_HOME/bin/oracle ]; then

      echo "${extd}Database-Instances$norm"

      # loop over the instances (very simple !!!)

      IFS=:

      grep -v '^\(#\|$\)' /etc/oratab | while read sid ohome autostart ; do

        state=up

        su - $ORACLE_OWNER -c "export ORACLE_SID=$sid; sqlplus /nolog" <<-! 2>/dev/null | grep ORA-01034 >/dev/null && state=down

connect / as sysdba

show sga

!

        echo "Instance $sid is $state \(autostart: $autostart\)"

      done

      echo

    fi

 

    if [ -x $ORACLE_HOME/bin/lsnrctl ]; then

      state=up

      su - $ORACLE_OWNER -c "$ORACLE_HOME/bin/lsnrctl status" | grep "[nN]o [lL]istener" >/dev/null && state=down

      echo "${extd}TNS-Listener:$norm $state"

      echo

    fi

 

    numhttpd=`ps -e | grep httpd | wc -l | sed 's/ //g'`

    state=up

    if [ "$numhttpd" -lt 1 ] ; then state=down ; fi

    echo "${extd}Web-Server (Apache httpd):$norm $state ($numhttpd processes)"

    echo

 

    if [ -x $ORACLE_HOME/bin/agentctl ]; then

      state=up

      su - $ORACLE_OWNER -c "agentctl status" | grep "Could not contact agent" >/dev/null && state=down

      echo "${extd}Intelligent Agent:$norm $state"

      echo

    fi

 

    echo "${extd}Process list for user oracle:$norm"

    ps U oracle

    ps ax | grep oracm | grep -v grep

    ps axc | grep crs | grep -v grep

    ps axc | grep css | grep -v grep

    tail -10 $ORACLE_HOME/../crs_1/crs/log/*

    ;;

  restart)

    ## Stop the service and regardless of whether it was

    ## running or not, start it again.

    $0 stop

    $0 start

    ;;

  *)

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

    exit 1

esac

 

echo

echo "#############################################################################"

echo "#                      End of   O R A C L E   section                       #"

echo "#############################################################################"

echo

 

# Global return value of this script is "success", always. We have too many

# individual return values...

rc_status -r

 

rc_exit

 

 

 

APPENDIX 2. List of packages.

Here is list of rpm’s, required for Oracle 10g for Linux x86-64.

 

Magnie Fabrizio provided this list. It is not official Oracle list.



glibc-devel-2.3.3-98.28
glibc-2.3.3-98.28
glibc-32bit-9-200407011233
glibc-devel-32bit-9-200407011229
compat-2004.7.1-1.2
compat-32bit-9-200407011229
XFree86-libs-4.3.99.902-43.22
XFree86-libs-32bit-9-200407011229
libaio-devel-0.3.98-18.4
libaio-32bit-9-200407011229
libaio-0.3.98-18.4
libaio-devel-32bit-9-200407011229
openmotif-libs-2.2.2-519.1
openmotif-2.2.2-519.1

Openmotif is needed only for 10g.
The version is the default of a SLES9 without SP1.

APPENDIX III. References:

  1. http://www.novell.com/products/linuxenterpriseserver/oracle/documents.html - Oracle installation guides from SUSE (extremely useful set of documents);
  2. http://www.netapp.com/tech_library/3339.html - Oracle 10g RAC installation with RedHat Linux and Network Appliance filer (from NetApp). This document has one little bug – you should never use noac option for ORACLE_HOME volume.
  3. http://www.oracle-base.com/index.php - numerous articles about Oracle 10g;
  4. www.oracle.com - Oracle main web site (with links to Oracle Technology network, Metalink and other useful resources).
  5. http://oss.oracle.com  – Oracle and Linux project site;
  6. http://lists.suse.com/archive/suse-oracle/ - SUSE and Oracle mailing list.

Index

Next: CHECK LIST