cancel
Showing results for 
Search instead for 
Did you mean: 

Restart CI and App Servers Automatically On Windows

0 Kudos

What is the best way to automatically restart SAP on a system with a CI and multiple app servers? Currently, we simply use the Windows task scheduler to run a script that runs the command line to stop SAP on each system (CI and multiple App Servers). But, there is no dependencies built in to the script. Meaning, the CI doesn't know if the app servers are stopped/started and vice versa.

I am not well versed in command line scripting in Windows, but I think I can figure it out if someone can tell me this is possible and what the best method to use might be.

How do I connect to the app servers from the CI server to run the stop/start scripts and to verify the status of SAP (whether it is indeed stopped or is indeed started)? Basically, how do I do via the command line what the SAP Management Console does automatically when you tell it to stop/start all servers for a system? Or is there a way to schedule the SAP Management Console to stop/start a system?

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Michael,

I assume that you have 1 CI and DI in your SAP installation. So, you can execute the script below in order to start SAP system,

D:\usr\sap\<SID>\SYS\exe\nuc\NTAMD64\sapsrvkill.exe <ci_hostname>_<SID>_<instance#>
D:\usr\sap\<SID>\SYS\exe\nuc\NTAMD64\sapsrvkill.exe <SID>_D<instance#>_<di_hostname>
D:\usr\sap\<SID>\SYS\exe\nuc\NTAMD64\sapntwaitforhalt pf=D:\usr\sap\<SID>\SYS\profile\START_DVEBMGS<instance#>_<ci_hostname> SAPDIAHOST=<ci_hostname> 120
D:\usr\sap\<SID>\SYS\exe\nuc\NTAMD64\brconnect -u / -c -f dbshut

net stop Oracle<SID>102TNSListener
net stop OracleService<SID>

net stop SAP<SID>_00
net stop SAPOsCol

After the stop operation completed respectfully, in order to start the system, execute the script below;

net start Oracle<SID>102TNSListener
net start OracleService<SID>

net start SAP<SID>_00
net start SAPOsCol

@rem D:\usr\sap\<SID>\SYS\exe\nuc\NTAMD64\brconnect -f dbstart
D:\usr\sap\<SID>\SYS\exe\nuc\NTAMD64\sapstart.exe pf=D:\usr\sap\<SID>\SYS\profile\START_DVEBMGS<instance#>_<ci_hostname> SAPDIAHOST=<ci_hostname>
D:\usr\sap\<SID>\SYS\exe\nuc\NTAMD64\sapstart.exe pf=D:\usr\sap\<SID>\SYS\profile\START_D<instance#>_<di_hostname> SAPDIAHOST=<di_hostname>

Please note that you should execute these scripts on CI. By doing so, at the first stage, your application server will be down. Then the CI will be shutdown. After these operations, the DB will be shutdown automatically. Then. you can restart the system. At the startup stage, CI will start DB automatically. Then the DI will be started. I hope that it solves your problem.

Best regards,

Orkun Gedik

SAP Senior Netweaver and Development Consultant

SAP Technical Architect

Former Member
0 Kudos

Hi Michael,

try to set "Autostart = 1" (it's case sensitive) in the Start Profile.

Regards

Edited by: David Trivino on Mar 29, 2011 8:26 AM

Former Member
0 Kudos

Hi Michael,

To check is SAP system is alive, you can use the sapinfo program that comes with the sapgui

The syntax of SAPINFO is: sapinfo ashost=host sysnr=nn