joeythelips
IS-IT--Management
Hi,
i have 4 oracle instances on my hp-ux 11.0 server.
every night crontab runs a script called backup.sh which shuts down the databases, checks for oracle processes running on the server and if there are none, backs up the software, os, and db files.
However, our backup log produces the following:
IS-INFO: Backup started : Wed Mar 31 00:05:00 BST 2004
ORACLE instance shut down.
Database "testdb" shut down.
ORACLE instance shut down.
Database "nitestdb" shut down.
SVRMGR> ORACLE instance started.
Database "testdb" warm started.
SVRMGR> ORACLE instance started.
Database "nitestdb" warm started.
ORACLE instance shut down.
Database "testdb" shut down.
ORACLE instance shut down.
Database "nitestdb" shut down.
IS-ERROR: Wed Mar 31 00:05:41 BST 2004
IS-ERROR: Oracle background processes are still up and running!
IS-ERROR: Backup aborted!
IS-ERROR: Wed Mar 31 00:05:41 BST 2004
IS-ERROR: Backup ended with errors
IS-ERROR: For more details refer to the backup log
As we have 4 databases, i don't know why only 2 of them are shutdown: this is obviously the reason the backup is failing. Below is the start of the backup script.
How do i ensure that all four databases are shutdown?
DIR=/usr/backup
WEEKDAY=`date +%a`
LOG=$DIR/backup.$WEEKDAY.log
HEADER=$DIR/header.$WEEKDAY
ERROR=false
cd /
echo "IS-INFO: Backup started : `date`" > $LOG
su - oracle -c "dbshut immediate" >> $LOG 2>&1
su - oracle -c "dbstart" >> $LOG 2>&1
su - oracle -c "dbshut" >> $LOG 2>&1
if [ "`ps -ef | grep ora_ | grep -v grep | wc -l`" != "0" ]; then
echo "IS-ERROR: `date`" >> $LOG
echo "IS-ERROR: Oracle background processes are still up and running!" >> $LOG
echo "IS-ERROR: Backup aborted!"
i have 4 oracle instances on my hp-ux 11.0 server.
every night crontab runs a script called backup.sh which shuts down the databases, checks for oracle processes running on the server and if there are none, backs up the software, os, and db files.
However, our backup log produces the following:
IS-INFO: Backup started : Wed Mar 31 00:05:00 BST 2004
ORACLE instance shut down.
Database "testdb" shut down.
ORACLE instance shut down.
Database "nitestdb" shut down.
SVRMGR> ORACLE instance started.
Database "testdb" warm started.
SVRMGR> ORACLE instance started.
Database "nitestdb" warm started.
ORACLE instance shut down.
Database "testdb" shut down.
ORACLE instance shut down.
Database "nitestdb" shut down.
IS-ERROR: Wed Mar 31 00:05:41 BST 2004
IS-ERROR: Oracle background processes are still up and running!
IS-ERROR: Backup aborted!
IS-ERROR: Wed Mar 31 00:05:41 BST 2004
IS-ERROR: Backup ended with errors
IS-ERROR: For more details refer to the backup log
As we have 4 databases, i don't know why only 2 of them are shutdown: this is obviously the reason the backup is failing. Below is the start of the backup script.
How do i ensure that all four databases are shutdown?
DIR=/usr/backup
WEEKDAY=`date +%a`
LOG=$DIR/backup.$WEEKDAY.log
HEADER=$DIR/header.$WEEKDAY
ERROR=false
cd /
echo "IS-INFO: Backup started : `date`" > $LOG
su - oracle -c "dbshut immediate" >> $LOG 2>&1
su - oracle -c "dbstart" >> $LOG 2>&1
su - oracle -c "dbshut" >> $LOG 2>&1
if [ "`ps -ef | grep ora_ | grep -v grep | wc -l`" != "0" ]; then
echo "IS-ERROR: `date`" >> $LOG
echo "IS-ERROR: Oracle background processes are still up and running!" >> $LOG
echo "IS-ERROR: Backup aborted!"