Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> 9i PreInstallation Script for Unix

9i PreInstallation Script for Unix

From: Mike Alba <mike_at_netplasma.com>
Date: Thu, 23 May 2002 22:12:10 GMT
Message-ID: <3CED6931.4030801@netplasma.com>

#!/bin/sh
####################################################################
# Oracle PreInstallation Check
# Date: May 24 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

  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 "" >> $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 "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

   fi

##################################################
# TEMP Section #
# Receives $PLATFORM from uname above #
# gives you amount of space in /tmp in Kbyte #
# Written by rneville #
##################################################
GetTemp () { # Begin GetTemp function

   case $PLATFORM in

     HP-UX )
     TEMP=`df -k /tmp | grep free | awk '{print $NR}'`

     ;;


     SunOS )
     TEMP=`df -k /tmp | awk '{print $4}' |  sed '1d'`

       ;;

     AIX )
     TEMP=`df -k /tmp | awk '{print $3}' |  sed '1d'`

       ;;

     OSF1 )
     TEMP=`df -k /tmp | awk '{print $4}' |  sed '1d'`

       ;;   #

     Linux )
     TEMP=`df -k /tmp | 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

##################################################
# Generic User and Shell Section #
# Written by rneville #
##################################################

  echo "Unix ORACLE_HOME Directory Verification" >> $REPORT
  echo "_______________________________________" >> $REPORT
  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 "will 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." >> $REPORT
   echo "Ensure it is created and is owned by $USER" >> $REPORT
fi

   echo "" >> $REPORT

echo "Your Operating System is $PLATFORM"
echo "Gathering information... Please wait "
echo "" >> $REPORT


##################################################
# 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 = "HP-UX" ]

      then
       USERCOMMAND=`grep ^$USER: /etc/passwd | awk -F: '{print $1}'`
      else
       USERCOMMAND=`grep -w $USER /etc/passwd | awk -F: '{print $1}'`
    fi
     if [ "$USER" = "$USERCOMMAND" ]
     then
      echo "$USER correctly exists in /etc/passwd " >> $REPORT
      echo "" >> $REPORT
      echo "user test passed "
      echo "" >> $REPORT
      SH=`grep $USER /etc/passwd | awk -F: '{print $NF}' | awk -F/ 
'{print $NF}'`

   else

      echo "The unix user $USER is not in /etc/passwd" >> $REPORT
      echo " - You must add $USER the /etc/passwd file." >>$REPORT
      echo " - NIS managed users are not recommended" >> $REPORT
      echo "Unix USER Verification Failed" >> $REPORT
      echo "user test Failed"

   fi

########################################
# 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 LD_LIBRARY_PATH $OH/lib" >> $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 "LD_LIBRARY_PATH=$OH/lib" >> $REPORT
      echo "PATH=$OH/bin:\$PATH" >> $REPORT
      echo "export \$ORACLE_HOME" >> $REPORT
      echo "export \$LD_LIBRARY_PATH" >> $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_at_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=` 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`
PhyMemLower=261120
PhyMemMid=523264

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 > $PhyMemLower -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 for your 
Physical Memory of $PHYSICAL_MEMORY " >> $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 [ $TEMP -lt 204800 ]
     then
       echo "" >> $REPORT
       echo "You must increase your /tmp space to atleast 20000 Kb" >> 
$REPORT
       echo "" >> $REPORT
       echo "/tmp Check Failed" >> $REPORT
       echo "/tmp test Failed "
       echo
     else
       echo "You have adequate space in /tmp of $TEMP Kbytes" >> $REPORT
       echo "" >> $REPORT
       echo "/tmp test passed "
       echo

    fi
   else
     :

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 / 1014`
      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 / 1014
      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.

       ;;

     OSF1 )
     MEMBYTE=1073741824
     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}'`
     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}'`

      for perproc in per_proc_data_size max_per_proc_data_size max_per_proc_address_space per_proc_address_space

       do

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


       ;;   #

     Linux )
     echo $PLATFORM test

      ;;


     *)                    # 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" >>$REPORT

    echo "By this script and is set to the value of 0" >>$REPORT

   fi
  echo "Check the report for Kernel parameter verification\n"
################################
# 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 "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 " Received on Thu May 23 2002 - 17:12:10 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US