SAPControl is the Web service interface of the sapstartsrvservices / daemon and can be used on command line level. It is part of the SAP kernel and is available on all supported uioperating system platforms (UNIX, Linux, Windows). Calling SAPControl without any other option provides the syntax description. The command is case-sensitive and the program itself should be used in lower case letters on OS platform UNIX/Linux, whilst the webmethods and options use a mixture of lower and upper case letters on all operating system platforms. Some basics of the syntax can be seen in the figure below, including an extract of the functions, the so-called webmethods.
Example 1:
sapcontrol -user <sid>adm <password> -nr <instance_number> -function StartSystem LEVEL 1
Webmethod StartSystem is called with the priority parameter LEVEL and the value 1. As with the SAP MC, a sapstartsrvdaemon / service is used to start the instances of an AS Java-based SAP system. "LEVEL 1" means, that all instances (including) priority 1 are started (unless they are already running). In an AS Java-based SAP system this is typically only the Central Services instance (SCS), but no further instances.
Example 2:
sapcontrol -user <sid>adm <password> -nr <instance_number> -function StartSystem LEVEL 3
With StartSystem LEVEL 3 (which corresponds to StartSystem ALL), all the instances of the AS Java-based SAP system are started according to their priorityLEVEL, unless they are already running. This is the same procedure used to start the system using the SAP MC. Overall it is not important, whether the instances are running on the same or on different hosts.
Example 3:
sapcontrol -user <sid>adm <password> -nr <instance_number> -function StopSystem LEVEL 3
This command stops all instances with priorityLEVEL 3 (PAS/AAS instances), but not other instances with a higher priorityLEVEL (e.g. SCS instance with priorityLEVEL 1). StopSystem ALL has the same meaning as StopSystem LEVEL 1.
Example 4:
sapcontrol -prot NI_HTTP -nr <instance_number> -function Start
Here, a Trusted Connection is used to start only one instance. No user name or password is specified because the operating system authentication as "<sid>adm" is sufficient. However, it is only possible to call webmethods for the local host. The function StartSystem LEVEL 3 is not possible, because StartSystem may have to communicate with elements on other hosts, which is not permitted under Trusted Connections. This means only functions based on instances are possible and allowed.
Example 5:
sapcontrol –nr <instance_number> –systempki /usr/sap/<SID>/SYS/profile/<SID>_J<instance no.>_<host name> –function StartSystem ALL
With the option -systempki it is possible to use protected Web methods without the limitation of functions for local instances. In comparison to the former example this option enables the function StartSystem ALL even if the instances of a AS Java-based SAP system are distributed through different servers. In this way the option -systempki makes obsolete the usage of the option -user <user_name> <password>.
Caution
Trusted Connection for UNIX: -prot NI_HTTP; this is the default value.
Trusted Connection for Windows: -prot PIPE
See also SAP Note 927637: https://me.sap.com/notes/927637
SAPControl provides many more functions, especially monitoring capabilities are very useful when starting or stopping AS Java-based SAP systems.