Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

root.sh error while upgrading

Status
Not open for further replies.

olmos

Technical User
Oct 25, 2000
135
US

I am trying to upgrade Oracle 9i Standard edition to Enterprise edition on a Solaris 9 system. I uninstalled standard and installed the Enterprise edition software only. When it asked me to run root.sh I recieved the following error. root: not found root.sh 06550: not found.


The root.sh file looks like this:

$ more root.sh
#!/bin/sh
if [ -f $ORACLE_HOME/bin/oradism ]; then
$CHOWN root $ORACLE_HOME/bin/oradism
$CHMOD 06550 $ORACLE_HOME/bin/oradism
fi
if [ ! -d /opt/ORCLfmap ];then
$MKDIR /opt/ORCLfmap
fi
if [ ! -d /opt/ORCLfmap/bin ];then
$MKDIR /opt/ORCLfmap/bin
fi
if [ ! -d /opt/ORCLfmap/etc ];then
$MKDIR /opt/ORCLfmap/etc
fi
if [ ! -d /opt/ORCLfmap/log ];then
$MKDIR /opt/ORCLfmap/log
fi

$CP $ORACLE_HOME/bin/fmputl /opt/ORCLfmap/bin
$CP $ORACLE_HOME/bin/fmputlhp /opt/ORCLfmap/bin
$CHMOD 4550 /opt/ORCLfmap/bin/fmputl
$CHMOD 550 /opt/ORCLfmap/bin/fmputlhp
if [ ! -f /opt/ORCLfmap/etc/filemap.ora ];then
$CP $ORACLE_HOME/rdbms/install/filemap.ora /opt/ORCLfmap/etc
fi


How do I fix this ?

Thanks,
Olmos
 
Hi,
The obvious questions:
if you do a ls *.sh do you see root.sh?

Is it correctly flagged as an executable?

Have you tried
./root.sh


[profile]
 
yes, it is executable.

-rwxr-xr-x 1 sdb dba 657 Oct 21 16:47 root.sh

and I tried ./root.sh


 
Hi,
My root.sh is longer:
Code:
#!/bin/sh
#
# $Header
# $Copyright
#
#
# root.sh
#
# This script is intended to be run by root.  The script contains
# all the product installation actions that require root privileges.
#
# IMPORTANT NOTES - READ BEFORE RUNNING SCRIPT
#
# (1) ORACLE_HOME and ORACLE_OWNER can be defined in user's
#     environment to override default values defined in this script.
#
# (2) The environment variable LBIN (defined within the script) points to
#     the default local bin area.  Three executables will be moved there as
#     part of this script execution.
#
# (3) Define (if desired) LOG variable to name of log file.
#

AWK=/bin/awk
CAT=/bin/cat
CHOWN=/bin/chown
CHMOD=/bin/chmod
CP=/bin/cp
ECHO=/bin/echo
  $ECHO "" > $LOG
fi

#
# Display abort message on interrupt.
#

trap '$ECHO "Oracle9 root.sh execution aborted!"|tee -a $LOG;exit' 1 2 3 15

#
# Enter log message
#

$ECHO "Running Oracle9 root.sh script..."|tee -a $LOG

#
# Default values set by Installer
#

ORACLE_HOME=/eo/OraHome1
ORACLE_OWNER=oracle

#
# check for root
#

RUID=`/usr/bin/id|$AWK -F\( '{print $2}'|$AWK -F\) '{print $1}'`
if [ ${RUID} != "root" ];then
  $ECHO "You must be logged in as root to run root.sh."| $TEE -a $LOG
  $ECHO "Log in as root and restart root.sh execution."| $TEE -a $LOG
  exit 1
fi

#
# Determine how to suppress newline with $ECHO command.
#

case ${N}$C in
  "") if $ECHO "\c"| $GREP c >/dev/null 2>&1;then
        N='-n'
      else
        C='\c'
      fi;;
esac

#

$ECHO "\nThe following environment variables are set as:"| $TEE -a $LOG
$ECHO "    ORACLE_OWNER= $ORACLE_OWNER"| $TEE -a $LOG
$ECHO "    ORACLE_HOME=  $ORACLE_HOME"| $TEE -a $LOG

#
# Get name of local bin directory
#

$ECHO ""
$ECHO $N "Enter the full pathname of the local bin directory: $C"
DEFLT=${LBIN}; . $ORACLE_HOME/install/utl/read.sh; LBIN=$RDVAR
if [ ! -d $LBIN ];then
  $ECHO "Creating ${LBIN} directory..."| $TEE -a $LOG
  $MKDIR -p ${LBIN} 2>&1| $TEE -a $LOG
  $CHMOD 777 ${LBIN} 2>&1| $TEE -a $LOG
fi

#
# Move files to LBIN, and set permissions
#

DBHOME=$ORACLE_HOME/bin/dbhome
ORAENV=$ORACLE_HOME/bin/oraenv
CORAENV=$ORACLE_HOME/bin/coraenv
FILES="$DBHOME $ORAENV $CORAENV"

for f in $FILES ; do
  if [ -f $f ] ; then
    $CHMOD 755 $f  2>&1 2>> $LOG
    short_f=`$ECHO $f | $SED 's;.*/;;'`
    lbin_f=$LBIN/$short_f
    if [ -f $lbin_f ] ; then
      $ECHO $n "The file \"$short_f\" already exists in $LBIN.  Overwrite it? (y/n) $C"
      DEFLT='n'; . $ORACLE_HOME/install/utl/read.sh; OVERWRITE=$RDVAR    
    else
      OVERWRITE='y'; 
    fi
    if [ "$OVERWRITE" = "y" ]; then
      $CP $f $LBIN  2>&1 2>>  $LOG
      $CHOWN $ORACLE_OWNER $LBIN/`$ECHO $f | $AWK -F/ '{print $NF}'` 2>&1 2>> $LOG
      $ECHO "   Copying $short_f to $LBIN ..."
    fi
  fi
done
$ECHO ""


#
# Make sure an oratab file exists on this system
#

if [ ! -s ${ORATAB} ];then
  $ECHO "\nCreating ${ORATAB} file..."| $TEE -a $LOG
  if [ ! -d ${ORATABLOC} ];then
    $MKDIR -p ${ORATABLOC}
  fi

  $CAT <<!>> ${ORATAB}
#

# This file is used by ORACLE utilities.  It is created by root.sh
# and updated by the Database Configuration Assistant when creating
# a database.

# A colon, ':', is used as the field terminator.  A new line terminates
# the entry.  Lines beginning with a pound sign, '#', are comments.
#
# Entries are of the form:
#   \$ORACLE_SID:\$ORACLE_HOME:<N|Y>:
#
# The first and second fields are the system identifier and home
# directory of the database respectively.  The third filed indicates
# to the dbstart utility that the database should , "Y", or should not,
# "N", be brought up at system boot time.
#
# Multiple entries with the same \$ORACLE_SID are not allowed.
#
#
!

fi

$CHOWN $ORACLE_OWNER ${ORATAB}
$CHMOD 664 ${ORATAB}

#
# If there is an old entry with no sid and same oracle home,
# that entry will be marked as a comment.
#

FOUND_OLD=`$GREP "^*:${ORACLE_HOME}:" ${ORATAB}`
if [ -n "${FOUND_OLD}" ];then
  $SED -e "s?^*:$ORACLE_HOME:?# *:$ORACLE_HOME:?" $ORATAB > $TMPORATB
  $CAT $TMPORATB > $ORATAB
  $RM -f $TMPORATB 2>/dev/null
fi

#
# Add generic *:$ORACLE_HOME:N to oratab
#

$ECHO "Adding entry to ${ORATAB} file..."| $TEE -a $LOG
$CAT <<!>> ${ORATAB}
*:$ORACLE_HOME:N
!

$ECHO "Entries will be added to the ${ORATAB} file as needed by"| $TEE -a $LOG
$ECHO "Database Configuration Assistant when a database is created"| $TEE -a $LOG

#
# Change mode to remove group write permission on Oracle home
#

$CHMOD -R g-w $ORACLE_HOME

$ECHO "Finished running generic part of root.sh script."| $TEE -a $LOG
$ECHO "Now product-specific root actions will be performed."| $TEE -a $LOG


Are you running the correct one?
Of course, perhaps the update version is different..


[profile]
 
I'm running bourne shell. Should I use a different version of root.sh ?

olmos
 
No. Do as it says on the tin, but remove any ^M's from the file (use dos2unix or similar). Use Korn, cd to the directory (as root, natch) and ./root.sh

Post back if problems persist.
 
I added the following to the script

AWK=/bin/awk
CAT=/bin/cat
CHOWN=/bin/chown
CHMOD=/bin/chmod
CP=/bin/cp
ECHO=/bin/echo
$ECHO "" > $LOG
fi

since the root.sh script seemed to be missing those variables. It ran with no errors this time.

When I started up the database and checked the
version. It still says it is standard edition. I am not sure why because I did select Enterprise. Is this a bug ?

Olmos.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top