I have written a script to perfrom a cold backup on an oracle database. The script is failing everytime. Can anyone tell me what (stupid) error I am making.
The output from the uname command follows
Linux rayora 2.2.14-6.1.1smp #1 SMP Thu Apr 13 19:55:55 EDT 2000 i686 unknown
The error that I am getting on my script is:
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.1 - Production
With the Partitioning option
JServer Release 8.1.7.0.1 - Production
SVRMGR> Connected.
SVRMGR> Database closed.
Database dismounted.
ORACLE instance shut down.
SVRMGR> Server Manager complete.
/home/rf/bin/oracle_backup.sh: /home/rf/bin/oracle_backup.sh: line 53: syntax error: unexpected end of file
The script that I wrote follows:
#!/bin/sh
########################################################################
# Program Name - backup_full.sh #
# Purpose - To perform a cold backup of the Rayora database and the #
# Archive Logs #
# #
# Author - xxx.xxx.xxx #
# Date last Change - 09/14/2005 #
########################################################################
. /home/rf/common/cron_oracle_env.sh
LOG_FILE=/home/oracle/backup.log
########################################################################
# Execute the backup procedure #
########################################################################
echo `date +%c` >> $LOG_FILE
echo "Database RAYORA BACKUP starting." >> $LOG_FILE
svrmgrl <<EOT
connect internal
shutdown immediate
quit
EOT
if [ $? -eq 0 ]
then
echo "Database RAYORA shut down." >> $LOG_FILE
echo "Previous Backup is being removed." >> $LOG_FILE
touch /home/oracle/backup/junk
rm /home/oracle/backup/*
echo "Cold backup being performed." >> $LOG_FILE
cp -p -f -v /home/oracle/oraInventory/oradata/rayora/* /home/oracle/backup/
echo "Cold backup of archive logs being performed." >> $LOG_FILE
mv -f -v /home/oracle/oraInventory/oradata/arch/* /home/oracle/backup/
echo "Restarting Database RAYORA." >> $LOG_FILE
svrmgrl <<EOT
connect internal
startup
quit
EOT
if [ $? -eq 0 ]
then
echo "Database RAYORA started up." >> $LOG_FILE
else
echo "Database RAYORA will NOT start up." >> $LOG_FILE
fi
echo "Moving the backup files to the NFS share." >> $LOG_FILE
cp -p -f -v /home/oracle/backup/* /usr/local/backup/oracle_back/
echo "Remove Archive Logs older then seven (7) days" >> $LOG_FILE
find /usr/local/backup/oracle_back/ -type f -name "*arc" -mtime 6 -exec rm {}\;
else
echo "Database RAYORA failed to shut down." >> $LOG_FILE
fi
echo `date +%c` >> $LOG_FILE
echo "Database RAYORA BACKUP has completed." >> $LOG_FILE