Ah, yes, I understand now. (I completely misunderstood what you wanted to do, I believe.)
I you wish to cycle through a list of Oracle instances and shut them down from within the SQL*Plus environment, then you can do so provided the following:
On each target database that you want to remotely shutdown:
1) Ensure that you have the following instance parameter set:
Remote_login_passwordfile=EXCLUSIVE
2) You have used the "orapwd" utility to create an Oracle "password file".
On the client SQL*Plus from which you wish to remotely shutdown another database (i.e., in your words, "change ORACLE_SID"):
Code:
sqlplus /nolog
connect sys/<pw>@<TNS alias for Instance 1> as sysdba
shutdown immediate
connect sys/<pw>@<TNS alias for Instance 2> as sysdba
shutdown immediate
et cetera
If you have residual questions about any of the above, please advise us.
![[santa] [santa] [santa]](/data/assets/smilies/santa.gif)
Mufasa
(aka Dave of Sandy, Utah, USA)
[I can provide you with low-cost, remote Database Administration services: see our website and contact me via
www.dasages.com]