Oracle Installation script circa 2002



#!/bin/sh
####################################################################
#                                 Oracle PreInstallation Check
# Date: Nov 20  2002
# This version works on Tru64, HP, Solaris, Linux and AIX
# This script is designed to check your Server to ensure that it has adequate
# resources to successfully Install the Oracle Database Software.
# This script will generate a report called Oracle_PreInstall_Report to
# /tmp/Oracle_PreInstall_Report
# Instructions:
# 1. Log in as the unix user that will be installing the Database Software
# 2. Run this script.
# 3. Fix any changes that are reported in the /tmp/Oracle_PreInstall_Report
# 4. You will now be ready to successfully  install your Database Software
#################################################################### 
PLATFORM=`uname -s`
REPORT=/tmp/Oracle_InstallPrep_Report
ScriptVersion=9.2-v1


 if [ $PLATFORM = "HP-UX" -o $PLATFORM = "Linux" ]
  then
    USER=`/usr/bin/whoami`
  else
    if [ $PLATFORM = "AIX" ]
     then    
      USER=`/usr/bin/whoami`
     else
      USER=`/usr/ucb/whoami`
    fi
 fi
    
################################################################
# Check to see if you are logged in as the correct  Unix user
#
if [ $USER = "root" ]
 then
   echo "You are logged in as $USER"
   echo "Please log in as the user that will be installing the Oracle Database"
   echo "Software. This user should not be root."
   echo "Exiting"
 exit 1;
  else
    echo "You are currently logged on as $USER "
fi 

echo "Is $USER the unix user that will be installing Oracle Software?  y or n "
read answer
  if [ "$answer" != y ]
     then
      echo "You have not confirmed that $USER is the user that will"
      echo "be installing Oracle Software"
      echo "Notice that a lower-case y must be typed to confirm this user"
      echo "Exiting the PreInstall Check Script\n"
      echo "Please log in as the user that will be installing Oracle"
      echo "Then rerun this script \n"
      exit 1;
     else
       `touch $REPORT; chmod 777 $REPORT`
       echo "" >> $REPORT
       echo "           Output from the Oracle PreInstallation Check Script. " > $REPORT
      echo "" >> $REPORT
      echo "" >> $REPORT
      echo "InstallPrep Version: $ScriptVersion" >> $REPORT
      echo "" >> $REPORT
       echo "To successfully install the Oracle Database Software you must resolve" >>$REPORT
       echo "each item listed in this Report. "  >> $REPORT
       echo "" >> $REPORT
       echo "" >> $REPORT
       echo "" >> $REPORT
       echo ""
       echo "Enter the unix group that will be used during the installation"
       echo "   Default: dba"
       read GROUP
         if [ "$GROUP" = "" ]
          then 
            GROUP=dba
          else
            echo "You have entered $GROUP "
         fi
           echo ""
           echo "Enter the version of Oracle RDBMS you will be installing"
           echo "Enter either :   901 OR 920    - Default: 920"
            read RDBMS
             if [ "$RDBMS" = "" ]
              then
               RDBMS=920
                 echo "The rdbms version being installed is $RDBMS"
               else
                 if [ "$RDBMS" = "901" ] 
                  then
                 echo "The rdbms version being installed is $RDBMS"
                   else
                      if [ "$RDBMS" = "920" ]   
                       then
                        echo "The rdbms version being installed is $RDBMS"
                        else
                          echo "Your only valid choices are 901 OR 920"
                          echo "Setting to the default: 920"
                          echo "If this is for prior releases of Oracle this script will work but the OS packages, temp space and swap will be different that reported here."     
                          RDBMS=920
                      fi
                  fi  
              fi
             
  fi
 
##################################################
# TEMP Section                                   #
# Receives $PLATFORM from uname above            #
# gives you amount of space in /tmp  in Kbyte    #
# Written by rneville                            #
################################################## 
GetTemp () {   # Begin GetTemp function

#  Check to see if the env variable TEMP or TMP is set
#  If either is set, that is what the installer will use instead of /tmp

TEMPloc=/tmp
TEMPalert=None
 
if [ `env | grep -ic "TEMP="` -ne 0 ]
   then
   TEMPloc=`env | grep "TEMP=" | awk -F= '{print $2}'`
      if test -d $TEMPloc
       then
        echo "env variable TEMP is set and determines location for TEMP during install."
       else
        echo "env variable TEMP is set but the directory does not exist. You muset remove the env variable TEMP or ensure $TEMPloc exists."
        TEMPloc=/tmp
        TEMPalert=NO_TEMP
      fi
   else
    if [ `env | grep -ic "TMP="` -ne 0 ]
     then
      TEMPloc=`env | grep "TMP=" | awk -F= '{print $2}'`
         if test -d $TEMPloc
          then
        echo "env variable TMP is set and determines location for TEMP during install."
          else
           echo "env variable TMP is set but the directory does not exist. You must remove the env variable TEMP or ensure $TEMPloc exists."
        TEMPloc=/tmp
        TEMPalert=NO_TMP
         fi
    fi
fi

   
 
  case  $PLATFORM  in
    HP-UX )
    TEMP=`df -k $TEMPloc | grep free | awk '{print $NR}'`
 
    ;;
 
 
    SunOS )
    TEMP=`df -k $TEMPloc | awk '{print $4}' |  sed '1d'`
 
      ;;
 
    AIX )
    TEMP=`df -k $TEMPloc | awk '{print $3}' |  sed '1d'`
 
      ;;
 
    OSF1 )
    TEMP=`df -k $TEMPloc | awk '{print $4}' |  sed '1d'`
 
      ;;   #
 
    Linux )
    TEMP=`df -k $TEMPloc | awk '{print $4}' |  sed '1d'` 

     ;;
 
 
    *)  # Platform not supported - should not get here
        echo platform $PLATFORM not supported
       TEMP =-1     # Return -1 if the platform is not supported
 
    esac
 
} # end GetTemp 
 
##################################################
# Physical Memory Section                        #
# Receives $PLATFORM from uname                  # 
# Returns PHYSICAL_MEMORY in Kbyte               #
# Written by rneville                            #
##################################################       

GetPhysicalMemory () {   # Begin GetPhysicalMemory function in Kbytes
PHYSICAL_MEMORY=0
 
  case  $PLATFORM  in
    HP-UX )
     PHY_TEST=`/usr/sbin/dmesg | grep Physical: | awk '{print $8}'`

      if [ "$PHY_TEST" -eq "" ]
       then
        PHYSICAL_MEMORY=0
       else
        PHYSICAL_MEMORY=$PHY_TEST
      fi
 
    ;;
 
 
    SunOS )
    PHYSICAL_MEMORY=`/usr/sbin/prtconf | grep "Memory size" | awk '{print $3}'`
    PHYSICAL_MEMORY=`expr $PHYSICAL_MEMORY \* 1024`
 
      ;;
 
    AIX )
    PHYSICAL_MEMORY=`/usr/sbin/lsattr -E -l sys0 -a realmem | awk '{print $2}'`
 
      ;;
 
    OSF1 )
   PHYSICAL_MEMORY=`/usr/bin/vmstat -P | grep -i 'Total Physical Memory = ' | awk -F = '{print $NF}'| awk -F. '{print $1}'`
   PHYSICAL_MEMORY=`expr $PHYSICAL_MEMORY \* 1024` 
 
      ;;   #
 
    Linux )
   PHYSICAL_MEMORY=` cat /proc/meminfo | grep MemTotal | awk '{print $2}'` 
 
     ;;
 
 
    *)                    # Platform not supported - should not get here
        echo platform $PLATFORM not supported
        PHYSICAL_MEMORY=-1     # Return -1 if the platform is not supported
 
    esac
 
} # end GetPhysicalMemory 
GetPhysicalMemory
 
##################################################
# Word Size Section                              #
# Receives $PLATFORM from uname above            #
# Determines if the OS is 64bit or 32bit         #
# Written by rneville                            #
##################################################
GetWordSize () {   # Begin GetWordSize function

  case  $PLATFORM  in
    HP-UX )
    WORDSIZE=`/bin/getconf KERNEL_BITS`

    ;;

    SunOS )
    if test -f "/bin/isainfo"
      then
        WORDSIZE=`/bin/isainfo -kv | awk -F- '{print $1}'`
       else
        WORDSIZE=32
    fi
      ;;

    AIX )

    WORDSIZE=`lslpp -L | grep 64bit`
     if [ "$WORDSIZE" = "bos.64bit" ]
      then
       WORDSIZE=64
      else
       WORDSIZE=32
     fi

      ;;

    OSF1 )
    WORDSIZE=64

      ;;   #

    Linux )
    WORDSIZE=32

     ;;


    *)  # Platform not supported - should not get here
        echo platform $PLATFORM not supported
       WORDSIZE =-1     # Return -1 if the platform is not supported

    esac

} # end GetWordSize
##################################################
# Generic User and Shell Section                 #
# Written by rneville                            #
################################################## 

 echo "Unix ORACLE_HOME Directory Verification" >> $REPORT
 echo "_______________________________________" >> $REPORT
 echo ""
 echo "Enter Location where you will be installing Oracle"
 echo "   Default: /u01/app/oracle/product/oracle9i"
   read OH
      if [ "$OH" = "" ]
         then
          OH=/u01/app/oracle/product/oracle9i
         else
           : 
      fi 
      if  test -z "$OH"
      then
        echo "You did not provide the location that Oracle will be installed"
        echo "Setting your ORACLE_HOME to No_Location_Given"
        OH=No_Location_Given
      fi
if test -d "$OH"
 then
    echo "" >> $REPORT
    echo "Directory $OH currently exists , during installation these contents" >> $REPORT
  echo "may be overwritten. It is highly recommended to delete these contents" >> $REPORT
  echo "prior to install!" >> $REPORT
     if test -w "$OH"
     then
       echo "" >> $REPORT
       echo "Directory $OH is writable" >> $REPORT
     OH_SPACE=`df -k $OH | awk '{print $4}' |  sed '1d'`
        if [ $OH_SPACE -lt 2097152000 ]
         then
          echo " -- Directory $OH has $OH_SPACE of space." >> $REPORT
          echo " -- A Typical Installation of 8.1.x requires more than 1.2Gb " >> $REPORT
          echo " -- A Typical Installation of 9.x requires more than 2.2Gb " >> $REPORT
         else
          echo " -- Disk Space should be enough to accomodate a Typical Install"
        fi
     else
       echo "" >> $REPORT
       echo " -- Change the owner of $OH to $USER and make it writable" >> $REPORT
     fi
 
 else
  echo "" >> $REPORT
  echo "Directory $OH does not currently exist and will be created by the installer as long as the proper directory permissions exist." >> $REPORT
fi                                                                                                                   
  echo "" >> $REPORT
echo "Your Operating System is $PLATFORM"
echo "Gathering information... Please wait "
echo "" >> $REPORT
####################################################
# Request JDk version from the user                #
# Written by rneville                              #
####################################################

if [ $PLATFORM = SunOS -o $PLATFORM = Linux ]
  then
     echo "JDK check is ignored for $PLATFORM since it is provided by Oracle"
else
  echo ""
  case  $PLATFORM  in
    HP-UX )
           JDK_WEB_LOCATION=http://www.hp.com/products1/unix/java 
           echo "Enter Location of where you installed the Unix JDK"
           echo "   Default: /opt/java"
           read JDKlocation
             if [ "$JDKlocation" = "" ]
               then
                JDKlocation=/opt/java
               else
                :
             fi
              if test -f "$JDKlocation/bin/java"
               then
               cd $JDKlocation/bin; java -version 1>/tmp/oracle_jdk_test 2>&1
               JDKversion=`cat /tmp/oracle_jdk_test | awk -F\" '{print $2}' | awk -F. '{print $2,$3}' | tr -d ' '`
             else
               echo "No binary file java found under the directory $JDKlocation/bin"
               JDKnotfound=yes
               echo " "
              fi
    ### Look at the version of RDBMS and set the version of JDK needed
    if [ "$RDBMS" = "920" ]
      then
      JDKneeded=1310
      else
      JDKneeded=1220
    fi
    ;;
    AIX )
        JDK_WEB_LOCATION=http://www.ibm.com/developerworks/java/jdk/aix/index.html
        echo "Enter Location of where you installed the Unix JDK"
        echo "   Default: /usr/jdk_base"
        read JDKlocation
            if [ "$JDKlocation" = "" ]
             then
             JDKlocation=/usr/jdk_base
              else
               :
            fi
             if test -f "$JDKlocation/bin/java"
              then
              cd $JDKlocation/bin; java -version 1>/tmp/oracle_jdk_test 2>&1
              JDKversion=`cat /tmp/oracle_jdk_test | awk -F\" '{print $2}' | tr -d .`
                   echo " JDKversion is $JDKversion TESTING !!!!"
             else
              echo "No binary file java found under the directory $JDKlocation/bin"
              JDKnotfound=yes
              echo " "
            fi
    ### Look at the version of RDBMS and set the version of JDK needed
    if [ "$RDBMS" = "920" ]
      then
      JDKneeded=131
      else
      JDKneeded=122
    fi

      ;;
    OSF1 )
          JDK_WEB_LOCATION=http://www.compaq.com/java/download/index.html
          echo "Enter Location of where you installed the Unix JDK"
          echo "   Default: /usr/opt/java131"
          read JDKlocation
              if [ "$JDKlocation" = "" ]
               then
                JDKlocation=/usr/opt/java131
               else
                :
              fi
               if test -f "$JDKlocation/bin/java"
                 then
                cd $JDKlocation/bin; java -version 1>/tmp/oracle_jdk_test 2>&1
                JDKversion=`cat /tmp/oracle_jdk_test`
                JDKversion=`cat /tmp/oracle_jdk_test | awk -F\" '{print $2}' | tr -d . | awk -F- '{print $1}'`
               else
                 echo "No binary file java found under the directory $JDKlocation/bin"
                 JDKnotfound=yes
                 echo " "
               fi
    ### Look at the version of RDBMS and set the version of JDK needed 
    if [ "$RDBMS" = "920" ]
      then
      JDKneeded=131
      else
      JDKneeded=122
    fi 
      ;;   #

    *)  # Platform not supported - should not get here
        echo "platform $PLATFORM not supported"

    esac

 fi
##################################################
# Check to ensure the JDK is installed           # 
# Written by rneville                            #
##################################################
 echo "" >> $REPORT
 echo "" >> $REPORT
 echo "JDK (SDK) Verification" >> $REPORT
 echo "________________" >> $REPORT
 echo "" >> $REPORT
 echo
if [ $PLATFORM = "SunOS" -o $PLATFORM = "Linux" ]
  then
    echo "JDK version is shipped with Oracle software for $PLATFORM." >> $REPORT
  else
   if [ "$JDKnotfound" = "yes" ]
    then
       echo "JDK version you specified was not found in $JDKlocation" >> $REPORT
       echo "During a typical Install you will be asked for the location of the JDK." >> $REPORT
       echo " " >> $REPORT
       JDKversion=0
       echo "No JDK found. JDK version set to 0" >> $REPORT 
     else
     :
   fi
     if [ "$JDKversion" -lt "$JDKneeded" ]
       then
        echo "JDK version is $JDKversion" >> $REPORT
        echo "JDK version installed must be $JDKneeded" >> $REPORT
        echo "Please download (32bit word size version when available) from the OS vendors web site at: " >> $REPORT
        echo "$JDK_WEB_LOCATION " >> $REPORT
        echo " " >> $REPORT
        echo "JDK test failed" >> $REPORT
       else
        echo "JDK version is correct" >> $REPORT
        echo " " >> $REPORT
        echo "JDK Test Passed" >> $REPORT
     fi
fi
#################################################################
#  Check to see if Required OS packages are currently           #
#  installed on the server according to the Oracle Installation #
#  Guide.                                                       #
#  Written by rneville.                                         #
#################################################################
 echo "" >> $REPORT
 echo "" >> $REPORT
 echo "Required OS Package Verification" >> $REPORT
 echo "________________________________" >> $REPORT
 echo "" >> $REPORT
 echo "The following OS Packages listed, if any, are required to be installed:" >> $REPORT
 echo 
  case  $PLATFORM  in
    HP-UX )
     echo "Only the Base level OS Package is needed." >> $REPORT
     echo "No additional OS Packages are needed."  >> $REPORT 
    ;;

    SunOS )
    echo "Processing Installed packages. This may take a moment ..."
    pkginfo > /tmp/pkginfo_output

    for pk in SUNWarc SUNWbtool SUNWhea SUNWlibm SUNWlibms SUNWsprot SUNWtoo
    do
     egrep -s  $pk /tmp/pkginfo_output
       if [ $? -eq 1 ]
        then
         echo "Required OS package $pk is not installed " >> $REPORT
        else
         :
       fi
    done
     echo " " >> $REPORT
     rm /tmp/pkginfo_output
      ;;

    AIX )
    echo "Processing Installed packages. This may take a moment ..."
    lslpp -l > /tmp/lslpp_output

     for pk in bos.adt.base bos.adt.lib bos.adt.libm bos.perf.perfstat
      do
       grep -q $pk /tmp/lslpp_output
         if [ $? -eq 1 ]
          then
           echo "Required OS package $pk is not installed " >> $REPORT
          else
           :
        fi
      done
     echo " " >> $REPORT
     rm /tmp/lslpp_output
      ;;

    OSF1 )
      echo "Processing Installed packages. This may take a up to 90 seconds ..."
      /usr/sbin/setld -i > /tmp/setld_output
       for pk in OSF11 OSFSER OSFLIBA OSFPGMR OSFCMPLRS
       do
        grep -q $pk /tmp/setld_output
         if [ $? -eq 1 ]
          then
           echo "Required OS package $pk is not installed " >> $REPORT
          else
           :
         fi
       done
      rm /tmp/setld_output

      ;;   

    Linux )
     echo "Only the Base level OS Package is needed." >> $REPORT
     echo "No additional OS Packages are needed."  >> $REPORT

     ;;


    *)  # Platform not supported - should not get here
        echo platform $PLATFORM not supported

    esac

###################################################################
# Check for required OS patches that are listed                   #
# in the Oracle Install Guide                                     #
###################################################################
 echo "" >> $REPORT
 echo "" >> $REPORT
 echo "Required OS Patch Verification" >> $REPORT
 echo "______________________________" >> $REPORT
 echo "" >> $REPORT
 echo "The following OS Patches listed, if any, are required to be installed:" >> $REPORT
 echo
  case  $PLATFORM  in
    HP-UX )
     echo " Verifying that proper patches are installed"
     echo " "
     echo "Ignore errors to screen when running patch section, review output in final report ... " 
     for PATCH in PHCO_23792 PHCO_24148 PHKL_24268 PHKL_24729 PHKL_25475 PHKL_25525 PHNE_24715 PHSS_23670 PHSS_24301 PHSS_24303 PHSS_24627 PHSS_22868
      do
       echo "Processing $PATCH..."
        /usr/sbin/swlist -l patch $PATCH
         if [ $? -ne 0 ]
          then
           echo "Required OS package $PATCH is not installed " >> $REPORT
           else
            :
         fi

      done
  echo " "  >> $REPORT
  echo "OS Patch bundles can be downloaded from:" >> $REPORT
  echo "http://www.software.hp.com/SUPPORT_PLUS" >> $REPORT
  echo "For individual patches = http://itresourcecenter.hp.com" >> $REPORT

    ;;

    SunOS )

      ;;

    AIX )

      OSV=`oslevel | awk -F. '{print $1}'`
       if [ $OSv -eq 4 ]
        then
        echo "OS is 4.x"
        for PATCH in IY24568 IY25282 IY27614 IY30151
         do
          /usr/sbin/instfix -ik $PATCH
         done
        else
         echo "OS is 5x"
        for PATCH in IY22854 IY26778 IY28766 IY28949 IY29965 IY30150
         do
          /usr/sbin/instfix -ik $PATCH
         done
      fi

      ;;

    OSF1 )
   OSVER=`/usr/sbin/sizer -v | awk '{print $4}'`
   if [ "$OSVER" = "V5.1A" ]
    then
     `/usr/bin/grep -q "KITNAME>> $REPORT
        echo "Patch Kit 3 can be downloaded from http://www.compaq.com/support" >> $REPORT
        else
        echo "Required OS patch PK3 is installed." >> $REPORT
      fi
    else
      if [ "$OSVER" = "V5.1" ]
       then
       # Patch neeed is PK4 named T64V51AS0004
       `/usr/bin/grep -q "KITNAME>> $REPORT
          echo "Patch Kit 4 can be downloaded from http://www.compaq.com/support" >> $REPORT
         else
          echo "Required OS patch PK4 is installed." >> $REPORT
        fi
      else
       echo " Ensure you have the latest patchset from the OS vendor." >> $REPORT
     fi
  fi
      ;;   

    Linux )

     ;;


    *)  # Platform not supported - should not get here
        echo platform $PLATFORM not supported

    esac

##################################################
# Check to ensure the unix user is in /etc/passwd#
##################################################
echo "" >> $REPORT
echo "" >> $REPORT
echo "Unix User Verification" >> $REPORT
echo "______________________" >> $REPORT
echo "" >> $REPORT
 echo
 echo "Checking unix user ..."
echo "" >> $REPORT
  if [ $PLATFORM = "SunOS" ]
     then
      UserID=`id -a | awk '{print $1}'`
      GroupID=`id -a | awk '{print $2}'`
      GRPS=`id -a | awk '{print $3}'`
     else
      UserID=`id | awk '{print $1}'`
      GroupID=`id | awk '{print $2}'`
      GRPS=`id | awk '{print $3}'`
   fi
     echo "User ID is $UserID" >> $REPORT
     echo "Primary Group ID is $GroupID" >> $REPORT
     echo "Additional Groups assigned $GRPS" >> $REPORT
     echo "" >> $REPORT
 
########################################
# List what umask and unix environment #
#  variables need to be set            #
# Writes to $REPORT                    #
########################################
echo
echo "Checking unix umask ... "  
echo "" >> $REPORT
MASK=`umask`
 if [ $MASK -eq 022 ]
   then
    echo "umask of $MASK is set correctly " >> $REPORT
    echo "" >> $REPORT
    echo "umask test passed "
   else
    echo "umask currently set to $MASK" >> $REPORT
    echo "umask must be set to 022 " >> $REPORT
    echo "" >> $REPORT
    echo "umask test Failed " >> $REPORT
    echo " " >> $REPORT
    echo "umask test Failed "
    echo
 fi
 
 if [ "$SH" = "csh" ]
    then
     echo "The following environment variables must be set in your .cshrc file" >> $REPORT
     echo "for the $USER user.">> $REPORT
     echo "" >> $REPORT
     echo "setenv ORACLE_HOME $OH" >> $REPORT
     echo "setenv PATH $OH/bin:/usr/ccs/bin:\$PATH" >> $REPORT
    else
     echo "The following environment variables must be set in your .profile file" >>$REPORT
     echo "for the $USER user." >> $REPORT
     echo "" >> $REPORT
     echo "ORACLE_HOME=$OH" >> $REPORT
     echo "PATH=$OH/bin:\$PATH" >> $REPORT
     echo "export \$ORACLE_HOME" >> $REPORT
     echo "export \$PATH" >> $REPORT
    fi
  if [ "$OH" != No_Location_Given ]
   then
    :
   else
    echo "\nWhen running this script you did not provide a location where " >>$REPORT
    echo "Oracle will be installed" >> $REPORT
#    echo "Change the value of No_Location_Given to the location where Oracle will be installed in." >> $REPORT
  fi                                                                                                          

######################################
# Check Group info from /etc/group   #
# Writes to $REPORT its findings     #
######################################
echo
echo "Checking unix group ... "
# Verify that the GROUP specicfied does exist in /etc/group file
  echo "" >> $REPORT
  echo "" >> $REPORT
  echo "Unix Group Verification" >> $REPORT
  echo "_______________________" >> $REPORT
  echo "" >> $REPORT
  if [ $PLATFORM = "HP-UX" ]
     then
      GROUPCOMMAND=`grep ^$GROUP: /etc/group | awk -F: '{print $1}'`
     else
      GROUPCOMMAND=`grep -w $GROUP /etc/group | awk -F: '{print $1}'`
   fi 
    if [ "$GROUP" = "$GROUPCOMMAND" ]                     
     then
        echo "$GROUP exist" >> $REPORT
        echo "Unix Group Verification Passed" >> $REPORT
        echo "Unix Group test passed"
        echo
     else
        echo "The unix group $GROUP does not exist" >> $REPORT
        echo "You must create the unix group $GROUP as the root user and " >> $REPORT
        echo "add $USER to this group or select a different unix group that" >> $REPORT
        echo "already exists in /etc/group" >> $REPORT
        echo "" >> $REPORT 
        echo "Unix Group Verification Failed" >> $REPORT
        echo "Unix Group test Failed " 
        echo
    fi

################################################# #
# Get Cluster Status if installing RAC option     #
# If RAC is not intended to be installed then     #
# this section will ensure that a cluster will not#
# hinder a Typical Installation.                  #
# Written by rneville  04-Apr-2002                #
################################################# #
 
GetClusterInfo () {   # Begin GetClusterInfo function
CLUSTER_DETECTED=N
CLUSTER_READY=N 
CLUSTER_WARNING=N
echo
echo "Checking for a cluster..." 
  case  $PLATFORM  in
    HP-UX )
    echo $PLATFORM Cluster test
     if test -f "/usr/sbin/cmviewcl" 
      then
      CLUSTER_DETECTED=Y
       clu_status=`/usr/sbin/cmviewcl | sed -n 3p | awk '{print $2}'`
       if [ $clu_status != up  ]
         then
          echo
           echo "This node is not in a cluster so you cannot install the RAC option"
         else
           clu_members_up=`/usr/sbin/cmviewcl | sed -n 4,10p | grep up | wc |  awk '{print $1}'`
           echo "Cluster has been detected"
             if [ "$clu_members_up" -gt "0" ]
              then
           echo "You have a cluster and $clu_members_up cluster members are curently up"
           CLUSTER_READY=Y
              else
           CLUSTER_WARNING=Y
                echo "No members of your cluster is in the UP status, "
                echo "RAC option cannot be installed"
                echo "Since a cluster has been detected or partially detected,"
                echo "during a Typical Installation the RAC option is automatically installed"
                echo "This causes problems, Run a Custom Install instead!!!"
 
             fi
       fi
     else
       echo
       echo "Cluser admin files are not present"
     fi                                                                                             
         
    ;;
 
 
    SunOS )
    echo $PLATFORM Cluster test

       if test -f "/usr/cluster/bin/scconf"
          then 
           sun_cluster=3X
          else
            if test -f "/opt/SUNWcluster/bin/get_node_status"
               then
                sun_cluster=2X
               else
                sun_cluster=none
            fi
       fi

        case  $sun_cluster  in
          2X )
           sun_cluster_version=2.x
           # echo $sun_cluster_version test
           CLUSTER_DETECTED=Y
           clu_members=`/opt/SUNWcluster/bin/get_node_status | grep "membership:" | awk '{print $NF + 1}'`
           clu_members_up=`/opt/SUNWcluster/bin/get_node_status | grep "membership:" | awk '{print $NF + 1}'`
           echo "Cluster has been detected"
             if [ "$clu_members_up" -gt "0" ]
              then
                 echo "You have $clu_members cluster members configured and $clu_members_up are curently up"
               CLUSTER_READY=Y
              else
                CLUSTER_WARNING=Y
                echo "No members of your cluster is in the UP status, "
                echo "RAC option cannot be installed"
                echo "Since a cluster has been detected or partially detected,"
                echo "during a Typical Installation the RAC option is automatically installed"
                echo "This causes problems, Run a Custom Install instead!!!"
            fi 
 
           ;;
 
 
          3X )
           sun_cluster_version=3.x
           echo $sun_cluster_version has been detected
           CLUSTER_DETECTED=Y       
           clu_members=`/usr/cluster/bin/scstat -n | grep "Cluster node:" | wc | awk '{print $1}'`
           clu_members_up=`/usr/cluster/bin/scstat -n | grep "Online"| wc | awk '{print $1}'`
           echo "Cluster has been detected"
             if [ "$clu_members_up" -gt "0" ]
              then
                 echo "You have $clu_members cluster members configured and $clu_members_up are curently up"   
               CLUSTER_READY=Y
              else
                CLUSTER_WARNING=Y
                echo "No members of your cluster is in the UP status, "
                echo "RAC option cannot be installed"
                echo "Since a cluster has been detected or partially detected,"
                echo "during a Typical Installation the RAC option is automatically installed"
                echo "This causes problems, Run a Custom Install instead!!!"
 
             fi                                                                                   

 
           ;;

          none )
           sun_cluster_version=none
           echo $sun_cluster_version test
 
           ;;                  
 
 
               *)  # Cluster test uses files found in either SunCluster 2.x or 3.x for cluster test 
               echo platform $sun_cluster not supported
               sun_cluster_version=-1     # Return -1 if the version is not in this script 
 
         esac                                                                                                                     
      ;;
 
    AIX )

  if test -f "/usr/es/sbin/cluster/clstat"
      then
      CLUSTER_DETECTED=Y
      clu_aix=`/usr/es/sbin/cluster/clstat -a << EOF
      quit
      EOF` 
   clu_aa=`echo "$clu_aix" | sed 12,33d`
   echo "$clu_aa " > /tmp/oracle_cluster_test
    CLUSTER_TEST_ERROR=`cat /tmp/oracle_cluster_test | sed -n 1p | awk '{print $1}'`
     if [ "$CLUSTER_TEST_ERROR" = "Display" ]
       then
        echo
        echo "Due to OS utility limitation, the window in which you are running "
        echo "this script from must be at least 24 lines by 80 columns in order"
        echo "to run the cluster check section."
        echo "Simply enlarge this window and run this script again to get "
        echo "proper cluster test results"
        echo
     else
       cluster_status=` cat /tmp/oracle_cluster_test | sed -n 5p | awk -FState: '{print $2}' | awk -FNodes '{print $1}' | /usr/bin/cut -c1-3` 
      echo "Cluster test ERROR: $CLUSTER_TEST_ERROR"
       if [ $cluster_status != UP ]
         then
           echo "This node is not in a cluster so you cannot install the RAC option"
         else
           clu_members_up=`cat /tmp/oracle_cluster_test | sed -n 5p | awk -FNodes: '{print $NF}'`
           echo "Cluster has been detected"
          if [ "$clu_members_up" -gt "0" ]
               then
                 echo " You have a cluster and $clu_members_up cluster memebers are curently up"
                 CLUSTER_READY=Y
               else
                CLUSTER_WARNING=Y
                echo "No members of your cluster is in the UP status, "
                echo "RAC option cannot be installed"
                echo "Since a cluster has been detected or partially detected,"
                echo "during a Typical Installation the RAC option is automatically installed"
                echo "This causes problems, Run a Custom Install instead!!!"
          fi
       fi
    rm /tmp/oracle_cluster_test
  fi
     else
       echo "\nCluser admin files are not present"
fi
      ;;

    OSF1 )
     if test -f "/usr/sbin/clu_get_info"
     then
       
       clu_status=`/usr/sbin/clu_get_info | wc | awk '{print $1}'`
       if [ "$clu_status" -eq "0"  ] 
         then
           echo "This node is not in a cluster so you cannot install the RAC option"
         else
           clu_members=`/usr/sbin/clu_get_info | grep "Member state" | wc | awk '{print $1}'`
           clu_members_up=`/usr/sbin/clu_get_info | grep "Member state = UP" | wc  | awk '{print $1}'`
           CLUSTER_DETECTED=Y
           echo "Cluster has been detected"
             if [ "$clu_members_up" -gt "0" ]
              then
           echo "You have $clu_members cluster members configured and $clu_members_up are curently up"
           CLUSTER_READY=Y
              else
           CLUSTER_WARNING=Y
                echo "No members of your cluster is in the UP status, "
                echo "RAC option cannot be installed"
                echo "Since a cluster has been detected or partially detected,"
                echo "during a Typical Installation the RAC option is automatically installed"
                echo "This causes problems, Run a Custom Install instead!!!"

             fi
       fi
     else
       echo
       echo "Cluser admin files are not present" 
     fi                                                                                         
 
      ;;   #
 
    Linux )
    echo
    echo "$PLATFORM Cluster test section has not been implemented yet"
 
     ;;
 
 
    *)                    # Platform not supported - should not get here
        echo platform $PLATFORM not supported
        CLUSTER_INFO=-1     # Return -1 if the platform is not supported
 
    esac
 
} # end GetClusterInfo                                                                                                                                          
##################################################
# Get total swap and return TOTAL_SWAP in kbytes #
# Written by bleve@us 18-SEP-2001                #
##################################################

GetSwap () {   # Begin GetSwap function

  case  $PLATFORM  in 
    HP-UX )
      syslog=/var/adm/syslog/syslog.log

      total_swap=`cat $syslog | awk -v extswap=0 'BEGIN{
        swapflg = 0             # Needed to break passes 
        total_swap = 0          # Func variable for holding swap value

      }
  
        {  
          if (( $6 == "Swap" ) && ( $7 == "device" ) && ( $8 == "table:" ))
          {  
            swapflg = 1     # Okay, we found the swap entry so start processing
          } 

          if (( $6 == "entry" ) &&  ( swapflg == 1 ))  # Get entries from syslog 
          {
            #printf "  swapinfo:  entry %d %d \n", $7, $20 
            total_swap= $20 + total_swap      
            swapflg = 1
          }
          if (( $6 == "Dump" ) && ( $7 == "device" ) && ( $8 == "table:" )) {
        	exit total_swap
          }
       }
      END{
        printf "%d", total_swap
        exit total_swap
      }
      '
     ` 
    TOTAL_SWAP=` expr $total_swap \/ 2 `;;
    
    SunOS)
      TOTAL_SWAP=`/usr/sbin/swap -l |awk 'BEGIN {
          total_swap = 0
        }        

        {
          if ( $1 != "swapfile" ) 
          {
            total_swap = total_swap + $4
          }
        }

        END {
            printf "%d",total_swap
        }
       '    # End awk
      `;;   # End assignment block of TOTAL_SWAP 

    AIX)
      TOTAL_SWAP=` /usr/sbin/lsps -a |awk 'BEGIN {

          total_swap = 0
        }

        {
          if ( $1 != "Page" )
          {
            total_swap = total_swap + $4
          }
        }

        END {
            printf "%d",total_swap * 1024
        }
       '    # End awk
      `;;   # End assignment block of TOTAL_SWAP

    OSF1)
      TOTAL_SWAP=`/usr/sbin/swapon -s | tail -4 |awk 'BEGIN {
          total_swap = 0
          swapflg = 0
          recnum = 0
        }

        {
          if ( $1 == "Allocated" )
          {
            string_length=length($5)
            nchar = string_length - 2
            uncalculated = substr($5,2,nchar)
          }
        }

        END {
           #######################################
           # Need to put stuff here to figure out#
           # what format the total is in         #
           #######################################
           
            string_legnth = length(uncalculated)
            seek_nchar = string_length - 3
            postfix = substr(uncalculated, seek_nchar, 2)
            if ( postfix == "GB" ) {
              swap_total = uncalculated * 1048576
            }
            else {
              swap_total = uncalculated * 1024
            }
            printf "%d", swap_total   
        }
       '    # End awk
      `;;   # End assignment block of TOTAL_SWAP

    Linux)
      
      TOTAL_SWAP=`/usr/bin/free -k | awk '{
        if ( $1 == "Swap:" ){
          printf "%d",$2
        }
      }  
      '
     `;;  
 
    
    *)                    # Platform not supported - should not get here  
        echo platform $PLATFORM not supported
	TOTAL_SWAP=-1     # Return -1 if the platform is not supported

    esac # end if [ $PLATFORM ] 



} # end GetSwap
##################
TOTAL_SWAP=0
 
GetSwap
 
if [ $TOTAL_SWAP -gt -1 ]
  then
  :
  #echo Total swap is $TOTAL_SWAP kbytes
fi
   

####################################################
# Is Swap is Adequate depending on Physical memory #
# Requires PHYSICAL_MEMORY from GetPhsicalMeomry   #
# and TOTAL_SWAP from GetSwap.                     #
# Writes to $REPORT if these are adequate amounts  #
# Written By rneville                              # 
####################################################
echo
echo "Checking Memory & Swap... "
TWOxMem=`expr $PHYSICAL_MEMORY \* 2`
PhyMemMid=523264   
PhyMemLower=261120

echo "" >> $REPORT
echo "" >> $REPORT
echo "Memory Verification" >> $REPORT
echo "___________________" >> $REPORT
echo "" >> $REPORT
 if [ $PHYSICAL_MEMORY -eq 0 ]
 then
  echo
  echo "Cannot obtain Physical Memory on this machine, setting to 0"
  echo "Setting PHYSICAL MEMORY to 0 during script run"
  echo
  echo "Due to OS permissions, cannot determine Physical Memory size" >> $REPORT
  echo "Setting Physical Memory size to 0" >> $REPORT
  echo 
 fi
echo "Physical Memory = $PHYSICAL_MEMORY Kb" >> $REPORT
echo "Swap space = $TOTAL_SWAP Kb" >> $REPORT
echo "" >> $REPORT
  if [ $PHYSICAL_MEMORY -lt $PhyMemLower ]
   then
    echo "You have $PHYSICAL_MEMORY Kb of memory. " >> $REPORT
    echo "This is NOT enough to install Oracle. You must have atleast $PhyMemLower Kb" >> $REPORT
    echo "" >> $REPORT
    echo "" >> $REPORT
    echo "Memory Check Failed" >> $REPORT
    echo "Memory test Failed" 
    echo 
     else
    if [ $PHYSICAL_MEMORY -ge $PhyMemLower -a $PHYSICAL_MEMORY -lt $PhyMemMid ]
      then
           if [ $TOTAL_SWAP -lt $TWOxMem ]
              then
               echo "You must increase your swap space to atleast $TWOxMem " >> $REPORT
               echo "" >> $REPORT
               echo "" >> $REPORT
               echo "Memory Check Failed" >> $REPORT
               echo "Memory test Failed"  
               echo
              else
                echo "You have adequate Swap of $TOTAL_SWAP for your Physical Memory of $PHYSICAL_MEMORY " >> $REPORT
              echo "" >> $REPORT  
                echo "Memory & Swap Check is Successful" >> $REPORT
                echo "Memory test passed " 
                 echo
           fi
       else
         if [ $PHYSICAL_MEMORY -ge $PhyMemMid ]
           then
              if [ $TOTAL_SWAP -lt $PHYSICAL_MEMORY ]
               then
                 echo "You must increase your swap space to atleast $PHYSICAL_MEMORY " >> $REPORT
echo "" >> $REPORT
                 echo "Memory Check Failed" >> $REPORT
                 echo "Memory test Failed" 
                 echo
               else
                 echo "You have adequate Swap of $TOTAL_SWAP Kb for your Physical Memory of $PHYSICAL_MEMORY Kb" >> $REPORT
                  echo "" >> $REPORT
                  echo "" >> $REPORT 
                 echo "Memory & Swap Check is Successful" >> $REPORT
                 echo "Memory test passed" 
                  echo
              fi
           else
           echo "script broken, download it again"
         fi
     fi
   fi                                                                                                                             
# Report Section from TEMP SPACE
 
 
GetTemp
 
if [ $TEMP -gt -1 ]
  then
   echo "" >> $REPORT
   echo "" >> $REPORT
   echo "TMP Space Verification" >> $REPORT
   echo "___________________" >> $REPORT                
   echo "" >> $REPORT

 if [ "$TEMPalert" = "NO_TEMP" ]
    then
     echo "env variable TEMP is set but the directory does not exist. You must remove the env variable TEMP or ensure $TEMPloc exists." >> $REPORT
  elif [ "$TEMPalert" = "NO_TMP" ]
      then
       echo "env variable TMP is set but the directory does not exist. You must remove the env variable TMP or ensure $TEMPloc exists." >> $REPORT
  else
    if [ $TEMP -lt 409600 ]
      then
       echo "" >> $REPORT
       echo "You must increase your $TEMPloc space to atleast 409600 Kb" >> $REPORT
       echo "" >> $REPORT
       echo "/tmp Check Failed" >> $REPORT
       echo "/tmp test Failed " 
       echo
      else
       echo "You have adequate space in $TEMPloc of $TEMP Kbytes" >> $REPORT
       echo "" >> $REPORT
       echo "/tmp test passed " 
       echo
    fi
 fi
fi
       
###############################
# GetClusterInfo Reporting Section
 
CLUSTER_INFO=0
 
GetClusterInfo
 
if [ $CLUSTER_INFO -gt -1 ]
  then
 
 echo "" >> $REPORT
 echo "Real Application Cluster Option Verification" >> $REPORT
 echo "_______________________________" >> $REPORT
 echo "" >> $REPORT

  if [ $CLUSTER_DETECTED = Y ]
    then
     echo "A cluster has been detected" >> $REPORT
      if [ $CLUSTER_READY = Y ]
        then
         echo "Cluster is up and the RAC option will be installed when " >> $REPORT
         echo "performing a Typical Install" >> $REPORT
        else
         echo "Cluster is not up. This may cause problems during installation" >> $REPORT
         echo "Ensure your cluster is up before installing Oracle or " >> $REPORT
         echo "perform a Custom Install vs. a Typical Install of Oracle" >> $REPORT
      fi
    else 
     echo "A cluster was not detected. RAC option will not be installed" >> $REPORT
     echo "Cluster test passed" >> $REPORT
  fi
 
 if [ $CLUSTER_WARNING = Y ]
   then
    echo "A Partial cluster has been detected which could cause the RAC option" >>$REPORT
    echo "to be installed by default when performing a Typical Install." >>$REPORT
    echo "Recommendation is to use the Custom Install and DESELECT the RAC " >> $REPORT
    echo "option to avoid any problems" >> $REPORT
   else
    echo "No cluster warnings detected"
 fi

fi
 
#######################################################################
# Gets KERNEL PARAMETER on system. All Kernel Parameters that are not #
# used remain as value NA.  All non-NA vaulues are written to $REPORT #
# If you need to add a kernel parameter, add it to the top first      # 
# with the value NA then use it below on the os platform and finally  #
# add the if statement in the bottom so it will be checked.           # 
# Written by rneville                                                 #
#######################################################################
echo "Processing kernel parameters... Please wait" 
GetKernelParam () {   # Begin GetKernelParam function
KERNEL_PARAMETERS=0
SHMMAX=NA
SHMMNI=NA
SHMMIN=NA
SHMSEG=NA
SEMMNI=NA
SEMMSL=NA
SEMMNS=NA
SHMMIN_Req=1
SHMMNI_Req=100
SHMSEG_Req=32
per_proc_data_size=NA
max_per_proc_data_size=NA
max_per_proc_address_space=NA
per_proc_address_space=NA

 
echo "" >> $REPORT
echo "" >> $REPORT
echo "Unix Kernel Verification" >> $REPORT
echo "________________________" >> $REPORT
echo "" >> $REPORT
echo "Checking Required Kernel Parameters for minimum values needed"  >> $REPORT
echo "" >> $REPORT
echo "The following will indicate if a kernel parameter need to be increased" >> $REPORT
echo "" >>$REPORT
echo "Note:  Changes to the Unix Kernel must be performed by the root user." >> $REPORT
echo "A system reboot is required for the kernel changes to take affect." >> $REPORT      
echo "" >> $REPORT

  case  $PLATFORM  in
    HP-UX )
     KERNEL_TEST="("
     SHMMAX_Req=`expr 1073741824 / 1024`
     SEMMNI_Req=100
     SEMMNS_Req=1000
     SHMSEG_Req=10
     SHMMNI_Req=100
  if test -r "/stand/system"
    then
     SHMMAX=`/usr/bin/grep -i shmmax /stand/system | awk '{print $2}'`
     SHMMAX=`echo ${SHMMAX} | cut -d X -f 2`
     SHMMAX=`bc << EOF
     ibase=16
     $SHMMAX
     quit
     EOF`
     SHMMAX=`bc << EOF
     $SHMMAX / 1024
     quit
     EOF`                                                                                          
SHMMNI_ORIG="`/usr/bin/grep -i shmmni /stand/system | awk '{print $2}' | sed 2,10d`"
       SHMMNI_TEST="`/usr/bin/grep -i shmmni /stand/system | awk '{print $2}' |sed 2,10d | /bin/cut -c 1`"
       if [ \ $KERNEL_TEST = \ $SHMMNI_TEST ]
         then
           SHMMNI=0
           echo ""
           echo " Kernel parameter SHMMNI is based on a formula $SHMMNI_ORIG"
           echo " This script does not calculate this for you"
           echo " You must calculate manually and ensure it is larger than $SHMMNI_Req"
           echo ""
          else
          SHMMNI=`/usr/bin/grep -i shmmni /stand/system | awk '{print $NF}'`
          if test -z "$SHMMNI"
           then
            SHMMNI=0
          fi 
       fi


SHMSEG_ORIG="`/usr/bin/grep -i shmseg /stand/system | awk '{print $2}' | sed 2,10d`"
       SHMSEG_TEST="`/usr/bin/grep -i shmseg /stand/system | awk '{print $2}' |sed 2,10d | /bin/cut -c 1`"
       if [ \ $KERNEL_TEST = \ $SHMSEG_TEST ]
         then
           SHMSEG=0
           echo ""
           echo " Kernel parameter SHMSEG is based on a formula $SHMSEG_ORIG"
           echo " This script does not calculate this for you"
           echo " You must calculate manually and ensure it is larger than $SHMSEG_Req"
           echo ""
          else
     SHMSEG=`/usr/bin/grep -i shmseg /stand/system | awk '{print $NF}'`
       if test -z "$SHMSEG"
         then
         SHMSEG=0
       fi 

      fi



       SEMMNI_ORIG="`/usr/bin/grep -i semmni /stand/system | awk '{print $2}' | sed 2,10d`"
       SEMMNI_TEST="`/usr/bin/grep -i semmni /stand/system | awk '{print $2}' | sed 2,10d | /bin/cut -c 1`"
        if [ \ $KERNEL_TEST = \ $SEMMNI_TEST ]
         then
           SEMMNI=0  
           echo ""
           echo " Kernel parameter SEMMNI is based on a formula $SEMMNI_ORIG"
           echo " This script does not calculate this for you"
           echo " You must calculate manually and ensure it is larger than $SEMMNI_Req"
           echo ""
          else  
           SEMMNI=`/usr/bin/grep -i semmni /stand/system | awk '{print $NF}'`
            if test -z "$SEMMNI"
             then
              SEMMNI=0
            fi 
        fi   


       SEMMNS_ORIG="`/usr/bin/grep -i semmns /stand/system | awk '{print $2}' |sed 2,10d`"
       SEMMNS_TEST="`/usr/bin/grep -i semmns /stand/system | awk '{print $2}' |sed 2,10d | /bin/cut -c 1`"
        if [ \ $KERNEL_TEST = \ $SEMMNS_TEST ]
         then
          SEMMNS=0
           echo ""
           echo " Kernel parameter SEMMNS is based on a formula $SEMMNS_ORIG"
           echo " This script does not calculate this for you"
           echo " You must calculate manually and ensure it is larger than $SEMMNS_Req"
           echo ""
         else
          SEMMNS=`/usr/bin/grep -i semmns /stand/system | awk '{print $NF}'` 
          if test -z "$SEMMNS"
         then
          SEMMNS=0
          fi 
        fi



     
   else
    echo "" >> $REPORT
    echo "Unable to check kernel parameter settings due to permissions on "
    echo "file /etc/stand"
    echo "Either change permissions on /etc/stand/system to allow users to read"
    echo "or ensure Kernel parameters are set correctly according to the "
    echo "Installation Guide"
  fi
 
    ;;
 
 
    SunOS )
     SHMMAX_Req=4294967295
     SEMMNI_Req=100
     SEMMSL_Req=100
     SEMMNS_Req=1000
     SHMMAX=`/etc/sysdef | grep SHMMAX | awk '{print $1}'`
     SHMMIN=`/etc/sysdef | grep SHMMIN | awk '{print $1}'`
     SHMMNI=`/etc/sysdef | grep SHMMNI | awk '{print $1}'`
     SHMSEG=`/etc/sysdef | grep SHMSEG | awk '{print $1}'`
     SEMMNI=`/etc/sysdef | grep SEMMNI | awk '{print $1}'`
     SEMMSL=`/etc/sysdef | grep SEMMSL | awk '{print $1}'`
     SEMMNS=`/etc/sysdef | grep SEMMNS | awk '{print $1}'`
 
 
      ;;
 
    AIX )
    echo $PLATFORM has no specific kernel parameters to set to successfuly install Oracle RDBMS. >> $REPORT
 
      ;;
 
    OSF1 )
    MEMBYTE=1073741824
    STACKSIZE=536870912
    NEWWIREMETHOD=0
    SHMMAX_Req=2139095040
    SHMMAX=`/sbin/sysconfig -q ipc | grep 'shm[_-]max' | awk '{print $NF}'`
    SHMMIN=`/sbin/sysconfig -q ipc | grep 'shm[_-]min' | awk '{print $NF}'`
    SHMMNI=`/sbin/sysconfig -q ipc | grep 'shm[_-]mni' | awk '{print $NF}'`
    SHMSEG=`/sbin/sysconfig -q ipc | grep 'shm[_-]seg' | awk '{print $NF}'`
    new_wire_method=`/sbin/sysconfig -q vm | grep new_wire_method | awk '{print $NF}'`
    per_proc_data_size=`/sbin/sysconfig -q proc | grep '^per[_-]proc[_-]data[_-]size' | awk '{print $NF}'`
    max_per_proc_data_size=`/sbin/sysconfig -q proc | grep '^max[_-]per[_-]proc[_-]data[_-]size' | awk '{print $NF}'`
    max_per_proc_address_space=`/sbin/sysconfig -q proc | grep '^max[_-]per[_-]proc[_-]address[_-]space' | awk '{print $NF}'`
    per_proc_address_space=`/sbin/sysconfig -q proc | grep '^per[_-]proc[_-]address[_-]space' | awk '{print $NF}'`
    per_proc_stack_size=`/sbin/sysconfig -q proc | grep '^per[_-]proc[_-]stack[_-]size' | awk '{print $NF}'`
    max_per_proc_stack_size=`/sbin/sysconfig -q proc | grep '^max[_-]per[_-]proc[_-]stack[_-]size' | awk '{print $NF}'`      
 
       if [ $new_wire_method -gt $NEWWIREMETHOD ]
         then
           echo "Increase kernel parameter new_wire_method to $NEWWIREMETHOD " >> $REPORT
         else
          echo "new_wire_method is set correctly" >> $REPORT
       fi
 
       if [ $max_per_proc_stack_size -lt $STACKSIZE ]
         then
           echo "Increase the kernel parameter max_per_proc_stack_size to atleast $STACKSIZE bytes" >> $REPORT
         else
          echo "max_per_proc_stack_size is set correctly" >> $REPORT
       fi
 
       if [ $per_proc_stack_size -lt $STACKSIZE ]
         then
           echo "Increase the kernel parameter per_proc_stack_size to atleast $STACKSIZE bytes" >> $REPORT
         else
          echo "per_proc_stack_size is set correctly" >> $REPORT
       fi

       if [ $max_per_proc_data_size -lt $MEMBYTE ]
         then
           echo "Increase the kernel parameter max_per_proc_data_size to atleast $MEMBYTE bytes" >> $REPORT
         else
          echo "max_per_proc_data_size is set correctly" >> $REPORT
       fi

       if [ $per_proc_data_size -lt $MEMBYTE ]
         then
           echo "Increase the kernel parameter per_proc_data_size to atleast $MEMBYTE bytes" >> $REPORT
         else
          echo "per_proc_data_size is set correctly" >> $REPORT
       fi

       if [ $max_per_proc_address_space -lt $MEMBYTE ]
         then
           echo "Increase the kernel parameter max_per_proc_address_space to atleast $MEMBYTE bytes" >> $REPORT
         else
          echo "max_per_proc_address_space is set correctly" >> $REPORT
       fi

       if [ $per_proc_address_space -lt $MEMBYTE ]
         then
           echo "Increase the kernel parameter per_proc_address_space to atleast $MEMBYTE bytes" >> $REPORT
         else
          echo "per_proc_address_space is set correctly" >> $REPORT
       fi
 
      ;;   #
 
    Linux )
    
     SHMMAX_Req=2147483648
     SEMMNS_Req=1000
     SEMMSL_Req=250
     SEMMNI_Req=100
     SHMMAX=`/bin/cat /proc/sys/kernel/shmmax | awk '{print $1}'`
     SEMMNS=`/bin/cat /proc/sys/kernel/sem | awk '{print $2}'`
     SEMMSL=`/bin/cat /proc/sys/kernel/sem | awk '{print $1}'`
     SEMMNI=`/bin/cat /proc/sys/kernel/sem | awk '{print $4}'`

 
     ;;
 
 
    *)                    # Platform not supported - should not get here
        echo platform $PLATFORM not supported
        KERNEL_PARAMETERS=-1     # Return -1 if the platform is not supported
 
    esac
 
} # end GetKernelParam

 
GetKernelParam
 
  if [ $KERNEL_PARAMETERS -gt -1 ]

    then
 
    echo "" >> $REPORT
    echo "Running Kernel Parameter Report..."
 
# Verify the kernel parameters for all platforms are set correctly for a typical installation.
   if [ $SHMMAX = NA ]
      then
       :
      else
     if [ $SHMMAX -lt $SHMMAX_Req ]
       then
            echo "Set the kernel parameter SHMMAX to $SHMMAX_Req" >> $REPORT
       else
            echo "SHMMAX set correctly" >> $REPORT
     fi
   fi
 
 if [ $SHMMIN = NA ]
      then
       :  
      else
     if [ $SHMMIN -eq $SHMMIN_Req ]
       then
            echo "SHMMIN set correctly" >> $REPORT
       else
            echo "Set the kernel parameter SHMMIN to $SHMMIN_Req" >> $REPORT
 
     fi
 fi

if [ $SHMMNI = NA ]
     then
     : 
      else
     if [ $SHMMNI_Req -gt $SHMMNI ]
       then
            echo "Set the kernel parameter SHMMNI to atleast $SHMMNI_Req" >> $REPORT
      else
            echo "SHMMNI set correctly" >> $REPORT
 
     fi
  fi                                                                                                                                      

if [ $SHMSEG = NA ]
     then
     :
      else
     if [ $SHMSEG_Req -gt $SHMSEG ]
       then
            echo "Set the kernel parameter SHMSEG to atleast $SHMSEG_Req" >> $REPORT
      else
            echo "SHMSEG set correctly" >> $REPORT
 
     fi
  fi                                                                                                                                      

if [ $SEMMNI = NA ]
     then
     :
      else
     if [ $SEMMNI_Req -gt $SEMMNI ]
       then
            echo "Set the kernel parameter SEMMNI to atleast $SEMMNI_Req" >> $REPORT
      else
            echo "SEMMNI set correctly" >> $REPORT
 
     fi
  fi                                                                                                                                      
if [ $SEMMSL = NA ]
     then
     :
      else
     if [ $SEMMSL_Req -gt $SEMMSL ]
       then
            echo "Set the kernel parameter SEMMSL to atleast $SEMMSL_Req " >> $REPORT
      else
            echo "SEMMSL set correctly" >> $REPORT
 
     fi
  fi                                                                                                                 
if [ $SEMMNS = NA ]
     then
     :
      else
     if [ $SEMMNS_Req -gt $SEMMNS ]
       then
            echo "Set the kernel parameter SEMMNS to atleast $SEMMNS_Req" >> $REPORT
      else
            echo "SEMMNS set correctly" >> $REPORT
 
     fi
  fi                                                                                                                 
   echo "" >> $REPORT
   echo "Note: Any Kernel Parameter that is set using a formula will not be verified and set to 0" >>$REPORT

  fi
 echo "Check the report for Kernel parameter verification\n" 

####################################################
# This takes WORDSIZE from GetWordSize above and   #
# Determines what versions of Oracle RDBMS that    #
# be installed based on the OS being 32bit or 64bit#
# Writes to $REPORT version that can be installed  #
# Written By rneville                              #
####################################################
GetWordSize
echo
echo "" >> $REPORT
echo "" >> $REPORT
echo "Database Version to Wordsize Verification" >> $REPORT
echo "_________________________________________" >> $REPORT
echo "" >> $REPORT
 if [ $WORDSIZE -eq 64 ]
 then
   echo "Operating Sytem is $WORDSIZE bit" >> $REPORT
   case  $PLATFORM  in
    HP-UX )
     echo "All 9.x versions of Oracle RDBMS for $PLATFORM are certified on $WORDSIZE bit OS." >> $REPORT
    ;;

    SunOS )
     echo "All 9.x versions of Oracle RDBMS for $PLATFORM are certified on $WORDSIZE  bit OS." >> $REPORT
     echo "Note that if installing RAC option, you cannot have both 32bit and 64bit Versions of Oracle running at the same time." >> $REPORT
      ;;

    AIX )
     echo "All 9.x versions of Oracle RDBMS for $PLATFORM are certified on $WORDSIZE bit OS."  >> $REPORT 
     echo "Note that there are is a specific cdrom for OS 4.3.3 and a different cdrom for Os version 5L.  Ensure you are installing the correct one."  >> $REPORT
      ;;

    OSF1 )
     echo "All 9.x versions of Oracle RDBMS for $PLATFORM are certified on $WORDSIZE bit OS." >> $REPORT
      ;;   

    Linux )
     echo "There is currently no version of Oracle certified on $WORDSIZE bit for $PLATFORM. " >> $REPORT
     ;;

    *)  # Platform not supported - should not get here
        echo platform $PLATFORM not supported

    esac

    else
     echo "WORDSIZE is $WORDSIZE " >> $REPORT
      case  $PLATFORM  in
       HP-UX )
        echo "There are no version of 9.x that can be installed on $WORDSIZE bit " >> $REPORT
        echo "You can only install Oracle RDBMS versions 8.x and earlier releases on this $WORDSIZE bit OS."  >> $REPORT
        ;;

       SunOS )
        echo "On a $WORDSIZE bit OS you can only install the $WORDSIZE bit Oracle release and not the 64 bit Oracle release." >> $REPORT
        echo "Note that these are distributed on different cdroms" >> $REPORT
         ;;

       AIX )
        echo "It is possible to install Oracle Rdbms 9i on a $WORDSIZE bit OS but you must have a 64bit Processor in order for this to be certified." >> $REPORT
        echo "It is recommended to change to a 64 bit OS." >> $REPORT
         ;;

       OSF1 )
        echo "The script is broken, there is no $WORDSIZE bit OS for $PLATFORM" 
         ;;   

       Linux )
          RELVER=`/bin/cat /etc/issue`
          echo " Your Linux version is:" >> $REPORT
          echo "      $RELVER " >> $REPORT
          echo " Please verify that your Linux version and the version or Oracle RDBMS is listed below as certified together:" >> $REPORT

          echo "OS VERSION       ORACLE VERSION   Certified" >> $REPORT
          echo "----------       --------------   ---------" >> $REPORT
          echo "RedHat 7.0       9.0.1.x              Yes    " >> $REPORT
          echo "RedHat 7.1       9.0.1.x              Yes    " >> $REPORT
          echo "RedHat AS 2.1    9.0.1.x, 9.2.x       Yes    " >> $REPORT
          echo "SuSE 7.1         9.0.1.x              Yes    " >> $REPORT
          echo "SuSE 7.2         9.0.1.x              Yes    " >> $REPORT
          echo "SuSE SLE57       9.0.1.x, 9.2.x       Yes    " >> $REPORT
    echo "Note: RedHat 7.2, 7.3 or 8.x is not certified with any Oracle version!!" >>$REPORT
         ;;

        *)  # Platform not supported - should not get here
            echo platform $PLATFORM not supported

       esac

 fi
#
################################
# Echo to the report that that since version 815, the install requires a GUI env to install
#
echo "" >> $REPORT
echo "" >> $REPORT
echo "Note:" >> $REPORT
echo "-----" >> $REPORT
echo "" >> $REPORT
echo "If you currently have Oracle 8.1.x or Oracle 9.x installed on this machine" >> $REPORT
echo "backup your ORACLE INVENTORY directory prior to installing a new version of Oracle" >> $REPORT
echo "Look at the /var/opt/oracle/oraInventory.loc file to see where your Inventory is located" >> $REPORT
echo "This is just a precaution and will help in the event problems occur on future installations" >> $REPORT
echo "" >> $REPORT
echo "" >> $REPORT
 echo "Note:" >> $REPORT
 echo "-----" >> $REPORT
 echo "" >> $REPORT
 echo "Since Oracle version 8.1.x, an Oracle Install must be executed in" >> $REPORT
 echo "an X-window environment. A character based install is not possible." >>$REPORT
 echo "Regardless if you are doing a normal install or a Silent Install," >>$REPORT
 echo "you must run the commands from a window that is capable of starting and " >> $REPORT
 echo "running X- Window Software. If not, when you start runInstaller the " >>$REPORT
 echo "window will not display and your installation will not start." >> $REPORT
 echo
 echo "As a test, set your DISPLAY env variable to where the install will be" >> $REPORT
 echo "ran from i.e." >> $REPORT
 echo "" >> $REPORT
 echo "sh or ksh: DISPLAY=YourClientIPaddress:0.0; export DISPLAY " >> $REPORT
 echo "csh: setenv DISPLAY YourClientIPaddress:0.0" >> $REPORT
echo "" >> $REPORT
 echo "Then run the xclock utility to see if it successfully places a clock" >>$REPORT
 echo "on your window. If this works, then you can start the runInstaller " >> $REPORT
###############################
rm -f ./261120
echo "Completed."
echo
echo "$REPORT has been generated"
echo
echo "Please review this report and resolve all issues before attempting to"
echo "install the Oracle Database Software "



ebook:
Full Size
Jeep Buyer's
Guide
ebook:
Practical Suggestions
for Microsoft
Windows
Linux Tackles Microsoft
12 hour Video Course by john:
The Art of Linux System Administration
published by O'Reilly Media
Study Guide for the LPIC-2 Certification Exams
search for:
on the internet, or:
JohnMeister.com-fotos
LinuxMeister-Linux
BibleTech-
Bible overview


An overview of Biblical history:
"Promises and Prophets"

Wagoneers

FULL SIZE JEEPS

JeepMeister
"Jeep is America's
only real sports car."
-Enzo Ferrari


MeisterTech
Diesels +

One Page Overview of Linux Commands

click for an image of the 5 essential Linux commands

An Intro to Linux
AMSOIL product guide,
or, AMSOIL web, or 1-800-956-5695,
use customer #283461

Amsoil dealer since 1983
purchase AMSOIL
at Midway Auto on SR9 in Snohomish,
or at Northland Diesel in Bellingham, WA


SJ - 1962-1991

XJ - 1984-2001

WJ - 1999-2004

KJ - 2002-2007

WK - 2005-2010

Find the recommended
AMSOIL synthetics
for your Jeep

CJ-10A - 1984-1986

Jeepsters

MJ - 1984-1992

Willys - 1946-1965

Other Jeeps (FC)