Could some one please tell me what is wrong in this script ? It is a script
written to backup oracle database. It works when the ' write results of this
script code' is commented out.
Any help is appreciated. Thanks in advance for help.
regards,
Dan
Complete script to follow
------------------
#!/bin/ksh
# Perform full back for the current instance
#
DESTINATION=/u02/backup/dti
export DESTINATION
#
echo echo ""
echo "Database name -->" $ORACLE_SID
echo ""
echo "Destination ---->" $DESTINATION
echo ""
echo "Is this imformation correct? (y/n)"
read answer
if [ $answer = "n" ]
then
echo "try again ..."
exit
fi
# Write the results of this script to 'make.result' in the
# current directory as well as to the screen.
ksh << EOF 2>&1
#
echo "DESTINATION="$DESTINATION
echo "\n\nShuting down $ORACLE_SID database ...\n"
svrmgrl << EOD
connect internal
shutdown immediate
disconnect
EOD
echo ""
for file in /u0*/oradata/dti/*.log
do
echo "Copying $file to $DESTINATION ..."
cp -p $file $DESTINATION
done
echo "\n\nStarting up $ORACLE_SID database ...\n"
svrmgrl << EOD
connect internal
startup
disconnect
EOD
echo ""
echo "Backup is done!!!"
echo ""
# Establish the end of the self-logging script.
EOF