Probably your profile not being run correctly from the cron. We have several boxes (Tru64) where even though we are using cron from the oracle account we need to use the following syntax
00 19 * * * su - oracle -c '/usr/local/bin/script'
otherwise the .profile is not run
HTH
John
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: 19 July 01 08:41
To: Multiple recipients of list ORACLE-L
Subject: Backup script giving error when run by cron
Hi gurus,
Our database is running on Dynix in a Sequent machine.
I tried to put the startup/shutdown script we use in crontab and
schedule it.
I call a script shut.sh which in turn will call the shutdown.sh
script. But it gives me an error saying svrmgrl- not found. I've
given here those scripts..
What am I missing??
This shut.sh is called by the cron
shut.sh
--------------------------------------------------------------------
/data23/tbms/.profile
/data21/app/oracle/admin/TBMS/dba/shutdown.sh
>/data21/app/oracle/admin/TBMS/db
a/shut.log 2>/data21/app/oracle/admin/TBMS/dba/shut.err
---------------------------------------------------------------------
shutdown.sh
-----------
ORACLE_SID=TBMS
export ORACLE_SID
INITIAL_STATUS=`ps -ef|grep "ora_[a-z]*_TBMS"|wc -l`
echo $INITIAL_STATUS
if [ $INITIAL_STATUS != 0 ]; then
svrmgrl <<EOF
connect internal
alter system switch logfile;
shutdown immediate;
exit
EOF
DB_STATUS=`ps -ef|grep "oracleTBMS"`
if [ -n $DB_STATUS ]; then
echo "Starting up the database in restrict mode"
svrmgrl <<EOF
connect internal
startup restrict;
shutdown ;
exit
EOF
echo "Database TBMS shutdown"
else
echo "Error in shutting down database"
exit
fi
else
echo "Database is already shutdown..exiting"
exit
fi
---------------------------------------------------------------------
regards,
Manivannan.M
Enjoy being an Indyan at http://www.indya.com
--
Please see the official ORACLE-L FAQ: http://www.orafaq.com
--
Author:
INET: [EMAIL PROTECTED]
Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
San Diego, California -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from). You may
also send the HELP command for other information (like subscribing).
**********************************************************************
This email and any attachments may be confidential and the subject of
legal professional privilege. Any disclosure, use, storage or copying
of this email without the consent of the sender is strictly prohibited.
Please notify the sender immediately if you are not the intended
recipient and then delete the email from your inbox and do not
disclose the contents to another person, use, copy or store the
information in any medium.
**********************************************************************