Home » RDBMS Server » Server Utilities » Help!The following script /etc/rc0.d script errors out
Help!The following script /etc/rc0.d script errors out [message #71263] Thu, 03 October 2002 09:30 Go to next message
Tony
Messages: 190
Registered: June 2001
Senior Member
Hi, The following script to shutdown the database (/etc/rc0.d) (oracle 8i) errors out saying "insufficient privileges" and it doesn't shutdown the database (the error log is at the end of the script). Could someone pl. tell me what is wrong? The same script works fine on a oracle 9i server.

:
#
# $Header: dbshut.sh.pp 03-apr-2001.13:38:20 jboyce Exp $ dbshut.sh.pp Copyr (c) 1991 Oracle
#

###################################
#
# usage: dbshut
#
# This script is used to shutdown ORACLE from /etc/rc(.local).
# It should ONLY be executed as part of the system boot procedure.
#
#####################################

ORATAB=/var/opt/oracle/oratab
ORASSLOGFIL=/var/opt/oracle/orastartshut.log
export ORASSLOGFIL
echo '***********************************************************************************' >> $ORASSLOGFIL
date >> $ORASSLOGFIL

trap 'exit' 1 2 3
case $ORACLE_TRACE in
T) set -x ;;
esac

# Set path if path not set (if called from /etc/rc)
case $PATH in
"") PATH=/bin:/usr/bin:/etc
export PATH ;;
esac
# Save LD_LIBRARY_PATH
SAVE_LLP=$LD_LIBRARY_PATH

#
# Loop for every entry in oratab file and and try to shut down
# that ORACLE
#

cat $ORATAB | while read LINE
do
case $LINE in
#*) ;; #comment-line in oratab
*)
# Proceed only if third field is 'Y'.
if [[ "`echo $LINE | awk -F: '{print $3}' -`" = "Y" ]] ; then
ORACLE_SID=`echo $LINE | awk -F: '{print $1}' -`
if [[ "$ORACLE_SID" = '*' ]] ; then
ORACLE_SID=""
fi
# Called programs use same database ID
export ORACLE_SID
ORACLE_HOME=`echo $LINE | awk -F: '{print $2}' -`
# Called scripts use same home directory
export ORACLE_HOME
# Put $ORACLE_HOME/bin into PATH and export.
PATH=$ORACLE_HOME/bin:/bin:/usr/bin:/etc ; export PATH
# add for bug 652997
LD_LIBRARY_PATH=${SAVE_LLP}:${ORACLE_HOME}/lib ; export LD_LIBRARY_PATH
PFILE=${ORACLE_HOME}/dbs/init${ORACLE_SID}.ora

echo 'Stopping Oracle Listener....'
echo " "
$ORACLE_HOME/bin/lsnrctl stop >> $ORASSLOGFIL

# See if it is a V6 or V7 database
VERSION=undef
if [[ -f $ORACLE_HOME/bin/sqldba ]] ; then
SQLDBA=sqldba
VERSION=`$ORACLE_HOME/bin/sqldba command=exit | awk '
/SQL*DBA: (Release&#124Version)/ {split($3, V, ".") ;
print V[[1]]}'`
case $VERSION in
"6") ;;
*) VERSION="internal" ;;
esac
else
if [[ -f $ORACLE_HOME/bin/svrmgrl ]] ; then
SQLDBA=svrmgrl
VERSION="internal"
else
SQLDBA="dgmgrl"
fi
fi
case $VERSION in
"6") sqldba command=shutdown ;;
"internal") $SQLDBA <<EOF >> $ORASSLOGFIL
connect internal
shutdown
EOF
;;
*) $SQLDBA <<EOF >> $ORASSLOGFIL
connect sys/apl
shutdown
EOF
;;
esac

if test $? -eq 0 ; then
echo "Database "${ORACLE_SID}" shut down." >> $ORASSLOGFIL
else
echo "Database "${ORACLE_SID}" not shut down." >> $ORASSLOGFIL
fi
fi
;;
esac
done

THE LOG : ORASSLOGFIL

***********************************************************************************
Thu Oct 3 10:07:30 PDT 2002

LSNRCTL for Solaris: Version 8.1.7.0.0 - Production on 03-OCT-2002 10:07:30

(c) Copyright 1998 Oracle Corporation. All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC)))
The command completed successfully

Oracle Server Manager Release 3.1.7.0.0 - Production

Copyright (c) 1997, 1999, Oracle Corporation. All Rights Reserved.

Oracle8i Enterprise Edition Release 8.1.7.0.0 - Production
With the Partitioning option
JServer Release 8.1.7.0.0 - Production

SVRMGR> Password:
Password:
ORA-01031: insufficient privileges
SVRMGR> ORA-01012: not logged on
SVRMGR>
Server Manager complete.
Database "proddb1" shut down.

Actually the database is not shutdown, because for some reason the "connect internal" doesn't go through.

Thanks much
Tony
Re: Help!The following script /etc/rc0.d script errors out [message #71265 is a reply to message #71263] Thu, 03 October 2002 11:43 Go to previous message
Tony
Messages: 190
Registered: June 2001
Senior Member
never mind. i figured it out.
Previous Topic: Oracle SQL how to
Next Topic: Re: SQLLDR on Solaris - error message 2100
Goto Forum:
  


Current Time: Sun Apr 28 16:38:02 CDT 2024