Professional Documents
Culture Documents
Page 1 of 12
TABLE OF CONTENTS
Page 2 of 12
1. Document Overview
This document gives the brief idea on Automating SAP System Start and Stop activity for SAP Application
running on Windows server using Control-M Agent.
2. Objective
SAP system Start and Stop is the most commonly and frequently used task in SAP Basis Administration.
In almost every project the common activity is monthly OS Patching and in some of big projects the
number of Servers are even more. So manually starting and stopping of SAP system in a tight schedule is
a challenging task to perform. In that case automating Start and Stop will reduce so much effort and
time. One other instance is sometimes for the system running on Azure SAP MMC fails to launch due to
some sever issue then without launching SAP MMC using Start and Stop scripts, Start/Stop activity can
be achieved easily. One instance where we are using this automation in our project is as the developers
do not work during off business hours so keeping the servers up during off business hours is waste of
resources. So, every day after business hours the Non-prod systems and Servers go down post business
hours and come up before business logins. By using automation, we save hours of effort daily which
could have been incurred just for Starting and Stopping of SAP System.
This automation is very efficient and can be used anywhere in SAP Basis administration which requires
System Start and Stop.
3. Requirements
For Scheduling SAP Start and Stop automation on Windows Server using Control-M we need Control-M
agent to be installed on those servers. The Start and Stop Jobs can be scheduled on the Control-M agent
which will trigger the Start and Stop Jobs Scripts placed on the SAP server.
For example if we want to Schedule Start and Stop of SAP System “SID” hosted on windows server
“sid-np-db01” with Database SQL Server named “SID” hosted on same server. As a sample, below will be
the required details:
Details Value
System Name/Database Name SID
Windows Server Name sid-np-db01
Control-M User ctladmin
Script path C:\Program Files\SAP\hostctrl\scripts
Start Job Script sid-np-db01_SID_Start.BAT
Stop Job Script sid-np-db01_SID_Stop.BAT
DB start/stop log location C:\Program Files\SAP\hostctrl\Script_DB_Log
SAP start/stop log location C:\Program Files\SAP\hostctrl\script_log
Page 3 of 12
4. Flow Diagram
SAP System “SID”
installed on Server
“sid-np-db01”
End of Stop
Job
Once all the instances are started. Output
will be displayed on Control-M agent and
incase of Job failure the output will be send
to the DL mentioned in agent.
End of Start
Job
Page 4 of 12
5. User Creation to run the script from Control-M
Create OS user “ctladmin” in the OS and add it to the Administrators group. So that it will have admin
rights to perform the required operation. Below screenshot shows the access control that administrator
user has:
Page 5 of 12
6. Script creation
Scripts can be placed at any location in the server. In our case the scripts Batch files and logs directory
where the Start/Stop logs will be written are at below locations.
For preparation of both Start and Stop Script we need the below details:
Page 6 of 12
In our case, for preparing the Start and Stop Script for System “SID” below is the location for Kernel
executables:
For the above-mentioned System details the Stop Job will be as below:
Content:
set CMD_PATH="E:\usr\sap\SID\SYS\exe\uc\NTAMD64"
cd %CMD_PATH%
Page 7 of 12
When the Stop Script is triggered, it will run as follows:
• Set command will first set the path of Kernel executable and then change the directory to that
executable path.
• CI will stop first as per the command with hostname cbsidci.
• ASCS will stop after CI.
• Then at last SQL services will stop.
• No need to set the delay as the next line command will run after the previous line command has
finished its Job.
For the above-mentioned System details the Stop Job will be as below:
Content:
set CMD_PATH="E:\usr\sap\SID\SYS\exe\uc\NTAMD64"
cd %CMD_PATH%
Page 8 of 12
When the Start Script is triggered, it will run as follows:
Once the Scripts windows batch files are prepared, these are ready to use, and the batch files can be
scheduled and triggered using any scheduler. For testing purpose these batch files could be just run by
double clicking on the scripts and the System will Start and Stop as per the Script.
In our scenario for Stopping the System during Off business hours and starting of systems before
business starts, we are scheduling the start and stop jobs through Control-M agent.
Page 9 of 12
7. Scheduling through Control-M agent
We have different options to use above created scripts for automating the SAP system start stop
activity. In our case we are scheduling it on Control-M agent to run the batch files as per schedule.
We will just provide the Server Name, Path where the Script batch files are placed and schedule both
the Start and Stop Job as per the required Schedule on Control-M
Page 10 of 12
8. Conclusion:
This document throws light on the Automation of SAP system Start and Stop activity for the SAP
applications running on Windows Server using Windows batch file with the help of Control-M agent. This
document explains how easily the Scripts can be prepared by providing minimum unique details of the
SAP system and the Start/Stop activity can be automated thus by reducing so much of human effort. This
can be more useful and economical in projects where the number of SAP systems are more, and multiple
System needs to be stopped and started at a certain time.
Below are some of the benefits that can be achieved by Automating Start/Stop on Windows Azure:
• Noncritical SAP Systems and Servers can be snoozed during the off-business hours which are
not in use during that time thus by saving considerable cost on daily basis.
• During Monthly patching where many systems needs to be stopped at a time. This could be
achieved with less resource and effort by using Start/Stop Automation.
• In Windows Azure Cloud, sometimes when Server crashes and SAP Management Console is
unable to launch, we can perform the Start and Stop activity using the Script gracefully.
9. References:
https://help.sap.com/saphelp_tm80/helpdata/en/47/1d6feeff6e0d46e10000000a155369/content.htm?
no_cache=true
https://communities.bmc.com/docs/DOC-59263
https://blogs.sap.com/2019/11/04/automatic-snoozing-of-sap-systems-on-azure/
Page 11 of 12
For Feedback
For any kind of feedback on this document, contact: manishk212@gmail.com
About Author
Manish Kumar is an SAP Basis Consultant with 4 Years of Experience which includes working
in SAP Basis Administration, SAP Upgrades, SAP Migration projects, Certified in Microsoft
Azure Fundamentals. Currently working as Software Development Senior Analyst in Accenture,
India.
Page 12 of 12