You can use SAPControl to start or stop an SAP system from the command line.
You are logged on to the SAP system host as user <sapsid>adm.
The startsap and stopsap commands are deprecated. SAP recommends that you do not use them any longer. For more information, see SAP Notes 1763593 and 809477 .
This section only lists the basic commands how to start or stop an SAP system. You can find a detailed list of all SAPControl options and features in the command line help, which you can call as follows:
UNIX: |
/usr/sap/hostctrl/exe/sapcontrol --help |
Windows: |
%ProgramFiles%\SAP\hostctrl\exe\sapcontrol.exe --help |
You can start an SAP system by executing the following commands from the command line (<Instance_Number> can be the number of any instance of the SAP system):
UNIX |
/usr/sap/hostctrl/exe/sapcontrol -nr <instance_number> -function StartSystem |
Windows |
%ProgramFiles%\SAP\hostctrl\exe\sapcontrol.exe -nr <instance_number> -function StartSystem |
You can start an SAP system instance by executing the following commands from the command line:
UNIX |
/usr/sap/hostctrl/exe/sapcontrol -nr <instance_number> -function Start |
Windows |
%ProgramFiles%\SAP\hostctrl\exe\sapcontrol.exe -nr <instance_number> -function Start |
For remote instances, the syntax is slightly different, because you also have to apply the -host and -user parameters:
UNIX |
/usr/sap/hostctrl/exe/sapcontrol –nr <instance_number> -host <remote host> –user <sapsid>adm <password> -function Start |
Windows |
%ProgramFiles%\SAP\hostctrl\exe\sapcontrol.exe –nr <instance_number> -host <remote host> –user <sapsid>adm <password> -function Start |
You can stop an SAP system by executing the following commands from the command line (<Instance_Number> can be the number of any instance of the SAP system):
UNIX |
/usr/sap/hostctrl/exe/sapcontrol -nr <instance_number> -function StopSystem |
Windows |
%ProgramFiles%\Program Files\SAP\hostctrl\exe\sapcontrol.exe -nr <instance_number> -function StopSystem |
You can stop an SAP system instance by executing the following commands from the command line:
UNIX |
/usr/sap/hostctrl/exe/sapcontrol -nr <instance_number> -function Stop |
Windows |
%ProgramFiles%\SAP\hostctrl\exe\sapcontrol.exe -nr <instance_number> -function Stop |
For remote instances, the syntax is slightly different, because you also have to apply the -host and -user parameters:
UNIX |
/usr/sap/hostctrl/exe/sapcontrol –nr <instance_number> -host <remote host> –user <sapsid>adm <password> -function Stop |
Windows |
%ProgramFiles%:\Program Files\SAP\hostctrl\exe\sapcontrol.exe –nr <instance_number> -host <remote host> –user <sapsid>adm <password> -function Stop |
The database is not stopped by these commands. You have to stop the database using database-specific tools or commands.
UNIX |
/usr/sap/hostctrl/exe/sapcontrol –nr <instance_number> -host <remote host> –user <sapsid>adm <password> -function GetSystemInstanceList |
Windows |
%ProgramFiles%\SAP\hostctrl\exe\sapcontrol.exe –nr <instance_number> -host <remote host> –user <sapsid>adm <password> -function GetSystemInstanceList |
UNIX |
/usr/sap/hostctrl/exe/sapcontrol –nr <instance_number> -host <remote host> –user <sapsid>adm <password> -function GetProcessList |
Windows |
%ProgramFiles%\SAP\hostctrl\exe\sapcontrol.exe –nr <instance_number> -host <remote host> –user <sapsid>adm <password> -function GetProcessList |
If you get an error like "FAIL: NIECONN_REFUSED", execute sapcontrol -nr <Instance_Number> -function StartService <SAPSID> to ensure that sapstartsrv is running. Then execute again the start or stop command.