-
Issue with Script - suggestion please
Dear Sir,
I am getting an error :
./auto_gather_Statistics.ksh[22]: 0403-057 Syntax error at line 42 : `<' is not matched.
from the follwing code:
######## From auto_db_monitor.ksh ######## oemprod 10.4.1.238
. $HOME/.profile
DATE_VAR=$(date '+%Y%m%d_%H:%M')
CURR_TIME=$(date '+%H%M%S')
CURR_DAY=$(date '+%A')
SCRIPTS_HOME=/oracle/admin/dba/scripts
########--ERR_LOG=/oracle/log/auto_db_monitor_$DATE_VAR
ERR_LOG=/oracle/log/Gather_Stats/auto_db_GatherStats_$DATE_VAR
########--- find /oracle/log/auto_db_monitor* -mtime +7 -exec rm -f {} \;
find /oracle/log/Gather_Stats/ -name "auto_db_GatherStats*" -mtime +7 -exec rm -f {} \;
errorcount=0
while read SERVER_NAME INSTANCE_NAME BLACKOUT_DAY BLACKOUT_START BLACKOUT_END SPACE_CHECK THRESHHOLD SPACE_OWNER; do
cstring=`echo $SERVER_NAME|cut -c 1-1`
if [ $cstring = "#" ]; then
continue
else
if [ $BLACKOUT_DAY = $CURR_DAY \
-a $CURR_TIME -gt $BLACKOUT_START \
-a $CURR_TIME -lt $BLACKOUT_END \
-o $BLACKOUT_DAY = 'Daily' \
-a $CURR_TIME -gt $BLACKOUT_START \
-a $CURR_TIME -lt $BLACKOUT_END ];
then
continue
else
if [[ ! -a ${SCRIPTS_HOME}/connect_${SERVER_NAME}_${INSTANCE_NAME}.sql ]]; then
echo "File connect_${SERVER_NAME}_${INSTANCE_NAME}.sql does not exist"
let errorcount=errorcount+1
else
########$ORACLE_HOME/bin/sqlplus /nolog < EOF
########$ORACLE_HOME/bin/sqlplus /nolog<
$ORACLE_HOME/bin/sqlplus system/PWD@pcc<<-EOF ##### whenever sqlerror exit 99
######## @${SCRIPTS_HOME}/connect_${SERVER_NAME}_${INSTANCE_NAME}.sql --------Connect to the da
tabase through sqlplus
select * from v\$instance;
"auto_gather_Statistics.ksh" 83 lines, 3058 characters
###### RECIPIENT_LIST=""
###### while read fn
###### do
###### RECIPIENT=`echo $fn|awk -F# '{print $1}'`
###### RECIPIENT_LIST="${RECIPIENT_LIST} ${RECIPIENT}"
###### done < $SCRIPTS_HOME/Gather_Stats/recipient_list.txt
#########if [ $errorcount > 0 ]; then
########## if [[ $RET_VAL -gt 0 ]];
##########then
##############mail -s "DB Monitor" $RECIPIENT_LIST < $ERR_LOG
uuencode $ERR_LOG |/bin/mailx -s " DB Gather Stats " krishnad@michaels.com
fi
The relevant line 42 is given in bold..... The above script is basically trying to connect to the different databases and gather the statistics.
Can anyone help me with what that error means and how it can be resolved please
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|