Having the following message returned:
FIND REDLOG FILES.....
ksh: dbfFILe: parameter not set
When I attempt to perform the script below....
#!/bin/ksh
. $HOME/.profile
# Initial Script Prerequisites
ORACLE_SID=MDirect ; export ORACLE_SID
REDOLOGDIR=$ARCLOGDEST ; export REDOLOGDIR
dbfFILE=$REDOLOGDIR/dbflist.txt ; export dbfFILE
# Log into Oracle to perform Switch of REDOLOGS.
echo "Oracle to perform SWITCH."
sqlplus /nolog << EOF
connect / as sysdba ;
alter system switch logfile ;
EOF
# Take a nap (300=5min)
echo "SLEEP TIME (5mins)"
sleep 300
cd $REDOLOGDIR/tmp
# Find all .dbf files newer than the timefile and put listing into
# the dbfFILE to be read.
echo "FIND REDLOG FILES....."
find $REDOLOGDIR -name \*.dbf -type f -newer $REDOLOGDIR/tmp/timefile -exec ls {
} \; > $dbfFILE
while read dbfEntry; do
echo $dbfEntry
echo "cp: " $REDOLOGDIR/$dbfEntry " to " $REDOLOGDIR "/tmp"
cp $REDOLOGDIR/$dbfEntry .
echo "compress :......."
compress *.dbf
echo "cp: to MDDEV/U02/...."
cp -p $REDOLOGDIR/tmp/*.Z /mddev/u02/oracle/admin/MDirect/arch
if [ $? != 0 ]
then
echo
echo "ERRORS encountered with Redolog Move"
echo "with file: " $dbfEntry
echo
rm $REDOLOGDIR/tmp/*.dbf*
exit # EXIT from script.
else
echo "rm: " $REDOLOGDIR"/tmp/"$dbfEntry
rm $REDOLOGDIR/tmp/*.dbf*
echo "TOUCH PERFORMED..."
touch $REDOLOGDIR/tmp/timefile
fi
done < $dbfFILe
I initially thought it was a result of the FIND statement and have tried redirecting the output of the `-exec ls {}` statement in the above form and (initially)...
find $REDOLOGDIR -name \*.dbf -type f -newer $REDOLOGDIR/tmp/timefile -exec ls {} > $ dbfFILE \;
Any suggestions? Not sure what to do to resolve.