How can I run below SQL commands even after exit from Instance=ABC with one bash script ? I want to execute below procedure in multiple instances. It is working till "EXIT" forĀ SID=ABC but I want it to continue for next Instance=DEF. Any suggestions would be of great help, Thank you in advance.
Oracle Linux Server release 5.11
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Data Mining
and Real Application Testing options
!/bin/bash
echo $ORACLE_SID
ORAENV_ASK=NO
ORACLE_SID=ABC
. oraenv
sqlplus / as sysdba << EOF
set time on echo on
select '-- ABC --' from dual;
spool terminate_ABC_USER1.out
exec TERMINATION_REQUEST('USER1');
spool off
EXIT;
echo $ORACLE_SID
ORAENV_ASK=NO
ORACLE_SID=DEF
. oraenv
sqlplus / as sysdba
set time on echo on
select '-- DEF --' from dual;
spool terminate_DEF_USER2.out
exec TERMINATION_REQUEST('USER2');
spool off
EXIT;
done
EOF