Thanks jlliagre , I was having a bit of an off-day when I posted that!
Back on topic:
Quote:
@/opt/oracle/scripts/sql/arch_del_$ORACLE_SID_pri.sql
rman target sys/$SPW@MYDB_primary log /opt/oracle/logs/arch_del_$ORACLE_SID_pri
.log << EOF
@/opt/oracle/scripts/rman/arch_del_$ORACLE_SID_pri.rcv
cat /opt/oracle/logs/arch_$ORACLE_SID_pri.log >> $RMAN_LOG_FILE
In each of these lines the substitution of
$ORACLE_SID does not work (Shell looks for a variable called
$ORACLE_SID_pri ). It should probably be
${ORACLE_SID}_pri .
Quote:
if [ "$RSTAT" = "0" ]
then
mailx -s "MYDB archivelog backup and deletion completed successfully"
developer@ABC.com < $RMAN_LOG_FILE
else
mailx -s "MYDB archivelog backup and deletion ended in error"
developer@ABC.com < $RMAN_LOG_FILE
There is a
fi missing in this if-then-else-fi statement.
As jlliagre deduces, the main problem is in the unposted portion of the script which probably has an errorneous Here Document with a missing or extra quote which is causing the rest of the script to be treated as data (hence no error for the missing "fi").
If your style is consistent you might find it with:
[CODE]grep "EOF" scriptname | sed -n l[/EOF]
The sed is designed to make end-of-line and control characters visble. A common issue is extraneous characters around the Here Document start or end string.