[62247] in SAPr3-news

home help back first fref pref prev next nref lref last post

Re: ups shutdowns scripts for sap / oracle on win 2003

daemon@ATHENA.MIT.EDU (riggor9999)
Tue Nov 3 12:16:08 2009

To: sapr3-news@mit.edu
Date: Tue, 3 Nov 2009 12:15:33 -0500
From: "riggor9999" <riggor9999@nospam_yahoo.com>
Message-ID: <hcpofn$id$1@news.eternal-september.org>
Reply-To: "riggor9999" <riggor9999@nospam_yahoo.com>

Thanks for your fast reply ....

"Werner Flamme" <werner.flamme@ufz.de> wrote in message 
news:7lb3atF3cpr58U1@mid.dfncis.de...
> riggor9999 [03.11.2009 16:34]:

> Do the parameters r3 and db not work with Windows? I used "stopsap r3"
> to fire up my system after the DB was running (which I did with "lsnrctl
> stop" plus the scripted sqlplus shutdown command - but "stopsap db" has
> worked sometimes, too). But I did this with Linux, I was never condamned
> to run SAP on Windows :->

==>  no - they behave differently ....

>
>> The other factor is that I have two SAP instances and two Oracle 
>> instances -
>> which probably need two diff scripts running under diff userids.
>
> I think so, yes, because the Unix' "su" command is not widespread under
> Windows ;-) And since each SAP instance and DB instance has its own
> owner, you will have to run multiple scripts.

==> I have tried using one sid1adm to do both - it does not work
==> I have tried using the windows "RUNAS" command for each line in the 
script - but it prompts for password an I have not found a way to hard code 
it

>> Bottom line is - I need a windows 2003 cmd script to run an automated sap
>> and oracle shutdown when the OS / UPS sense a power loss  /  low battery
>> condition.
>
> Can't you use the "net stop %SAPSERVICENAME%" command? AFAIK there are
> SAP Services in the system control board, and they usually can be
> started an stopped via Windows' "net" command. I do not know about
> Oracle, though.

==>  The services are different than the running applications / and running 
databases.

Here is my script.  I have figured out the -confirm force issue .... I had 
it at the end but it has to be before the -f dbshut.  The only issue now is 
how to get this script either to do both ... or to separate it into two 
scripts and have each run under each SID's ID.  The problem I have now - is 
the UPS power utility can only run one script, and it can only run as one 
user.

REM
REM ***** stopping SAP Instances ******
REM
E:\usr\sap\SID1\SYS\exe\uc\NTAMD64\stopsap.exe name=SID1 nr=00 
SAPDIAGHOST=hostname
E:\usr\sap\SID1\SYS\exe\uc\NTAMD64\stopsap.exe name=SID1 nr=01 
SAPDIAGHOST=hostname
E:\usr\sap\SID2\SYS\exe\uc\NTAMD64\stopsap.exe name=SID2 nr=02 
SAPDIAGHOST=hostname
E:\usr\sap\SID2\SYS\exe\uc\NTAMD64\stopsap.exe name=SID2 nr=03 
SAPDIAGHOST=hostname
REM
REM
REM ***** stopping Oracle Instances *****
REM
brspace -p initSID1.sap -c force -f dbshut -m immediate -i SID1
brspace -p initSID2.sap -c force -f dbshut -m immediate -i SID2  <== problem 
running this for SID #2 ... need to be sid2adm
REM
REM
REM ***** stopping SAP services *****
REM
net stop SAPSID1_00
net stop SAPSID1_01
net stop SAPSID2_02
net stop SAPSID2_03
net stop SAPOsCol
REM
REM
REM ***** stopping Oracle Services *****
REM
net stop OracleSID1102TNSListener
net stop OracleServiceSID1
net stop OracleJobSchedulerSID1
net stop OracleServiceSID2
net stop OracleJobSchedulerSID2
net stop OracleSID1102iSQL*Plus


Thanks .......





home help back first fref pref prev next nref lref last post