SIDGROUP="$1"
if [ "X$1" != "X" ]; then
   SCRIPT="$1"
else
   echo "  parameters required"
   exit 1
fi
ORATAB=/etc/oratab

cat $ORATAB|grep -v '#' | while read LINE
do
   ORACLE_SID=`echo $LINE | awk -F: '{print $1}' -`
   export ORACLE_SID
   ORACLE_HOME=`echo $LINE | awk -F: '{print $2}' -`
   export ORACLE_HOME
   PATH=$ORACLE_HOME/bin:/bin:/usr/bin:/etc ; export PATH
   SQLDBA="sqlplus -s /nolog"
   $SQLDBA <<EOF
connect / as sysdba
@sql/${1}.sql
EOF

#   $SQLDBA <<EOF
#connect / as sysdba
#@sql/${ORACLE_SID}_${1}.sql
#EOF

done
