![]() |
|
|||||||
| Newsgroup de.alt.comp.sap-r3 Betriebswirtschaftliche Standardsoftware SAP R/3. |
![]() |
|
|
Themen-Optionen | Ansicht |
|
#1
|
|||
|
|||
|
Hello -
We normally run Unix / Oracle but I now have a sandbox running two SAP instances (Sol Man 7.0 and NetWeaver 7.0) on Windows 2003. I am trying write windows scripts to stop SAP and stop Oracle when the UPS senses a power failure / low battery. This was very easy with Unix as "stopsap" will stop SAP and Oracle. While in windows "stopsap" only stops SAP, not Oracle. Years ago - on Win2K / 4.6C ... I could issue a "sapdba -shutdown" command and that worked just fine, but I am now having trouble with brtools and brspace at the command line. When I issue a "brspace -f dbshut -mode normal -confirm force" ... I still get the brtools menu to confirm / interact. I need this to be automated without human interaction. Does anyone have any experience with this? I have googled and searched but have not found a simple / elegant way. The other factor is that I have two SAP instances and two Oracle instances - which probably need two diff scripts running under diff userids. 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. Thanks in advance. -- to reply via email, remove the "nospam_" from the return address |
|
|
||||
|
||||
|
|
|
#2
|
|||
|
|||
|
riggor9999 [03.11.2009 16:34]:
> Hello - > > We normally run Unix / Oracle but I now have a sandbox running two SAP > instances (Sol Man 7.0 and NetWeaver 7.0) on Windows 2003. > > I am trying write windows scripts to stop SAP and stop Oracle when the UPS > senses a power failure / low battery. This was very easy with Unix as > "stopsap" will stop SAP and Oracle. While in windows "stopsap" only stops > SAP, not Oracle. 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 :-> > 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. > 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. HTH Werner |
|
#3
|
|||
|
|||
|
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 ....... |
|
#4
|
|||
|
|||
|
Hi,
riggor9999 schrieb: > > ==> 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 Run the script as administrator - Shortcut on desktop and then shift + right mouse button... Included commands will be executed with rights from script starting user. I don't know where but I know that the shortcut can be forced to run as an other user everytime. Hope that helps, -- Kind regards Steffen |
|
#5
|
|||
|
|||
|
Hi,
riggor9999 schrieb: > > ==> 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 Run the script as administrator - Shortcut on desktop and then shift + right mouse button... Included commands will be executed with rights from script starting user. I don't know where but I know that the shortcut can be forced to run as an other user everytime. Hope that helps, -- Kind regards Steffen |
|
#6
|
|||
|
|||
|
riggor9999 schrieb:
> ==> 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 Use the /savecred option of runas. The first time it asks for the password ans then stores it. Use the user login that is supposed to run the UPS scripts. HTH and best regards Christian |
|
#7
|
|||
|
|||
|
riggor9999 schrieb:
> ==> 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 Use the /savecred option of runas. The first time it asks for the password ans then stores it. Use the user login that is supposed to run the UPS scripts. HTH and best regards Christian |
|
#8
|
|||
|
|||
|
"Christian Knappke" <chknews*gmx.net> wrote in message news:hcrm7h$ls6$1*news.sap-ag.de... > riggor9999 schrieb: > >> ==> 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 > > Use the /savecred option of runas. The first time it asks for the > password ans then stores it. Use the user login that is supposed to > run the UPS scripts. > > HTH and best regards > Christian Thanks - I will give it a try. If this works - I can have one script that will be able to issue all the shutdown commands using different id / passwords. |
|
#9
|
|||
|
|||
|
"Christian Knappke" <chknews*gmx.net> wrote in message news:hcrm7h$ls6$1*news.sap-ag.de... > riggor9999 schrieb: > >> ==> 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 > > Use the /savecred option of runas. The first time it asks for the > password ans then stores it. Use the user login that is supposed to > run the UPS scripts. > > HTH and best regards > Christian Thanks - I will give it a try. If this works - I can have one script that will be able to issue all the shutdown commands using different id / passwords. |
|
#10
|
|||
|
|||
|
riggor9999 schrieb am 11.04.2009:
> "Christian Knappke" <chknews*gmx.net> wrote in message > news:hcrm7h$ls6$1*news.sap-ag.de... >> riggor9999 schrieb: >> >>> ==> 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 >> >> Use the /savecred option of runas. The first time it asks for the >> password ans then stores it. Use the user login that is supposed to >> run the UPS scripts. >> >> HTH and best regards >> Christian > Thanks - I will give it a try. > If this works - I can have one script that will be able to issue all the > shutdown commands using different id / passwords. Hi, we have two systems with two oracle-db on one server. We start both SAP-systems with one batch- file und some sub-batch-files. In the main batchfile for starting we call ths first sub-batch-file to set the enviroment for SY1 and then we start the services, the db and at last the SAP-system SY1. After this the main batchfile call the second sub-batch-file to set the enviroment for SY2 and then we start the services, the second db and at last the SAP-system SY2. If we want to stop both systems, we are using a stop-routine like the start-batch-files. If you want more informations, send a mail to me. best regards gerd |
|
|
|
|
![]() |
| Themen-Optionen | |
| Ansicht | |
|
|
Ähnliche Themen
|
||||
| Thema | Erstellt von | Forum | Antworten | Letzter Beitrag |
| ODBC Treiber für Oracle, "Oracle RDB Driver" der richtige für einen System.DSN? | Michael Schmitz | Newsgroup microsoft.public.de.german.entwickler.dotnet.datenbank | 7 | 08-15-2009 08:15 PM |
| Pfad des Scripts | Philipp Kraus | Newsgroup de.comp.os.unix.shell | 27 | 07-03-2009 07:24 PM |
| WinXP fehlerhafte shutdowns | Helmut Rauber | Newsgroups microsoft.public.de.german.windowsxp.active.directory | 5 | 05-04-2009 10:31 PM |
| Oracle-ODBC: Alle Zeilen denselben Inhalt (Acc 2003) | Stefan Dase | Newsgroup microsoft.public.de.access.clientserver | 18 | 02-22-2008 12:46 PM |
| Oracle 9.2, Windows 2003, Arbeitsspeicher | Dieter Hummel | Newsgroup de.comp.datenbanken.misc | 4 | 01-15-2008 06:03 PM |