Show TOC

Starting and Stopping SAP Systems Using SAPControlLocate this document in the navigation structure

You can use SAPControl to start or stop an SAP system from the command line.

Prerequisites

You are logged on to the SAP system host as user <sapsid>adm.

Context

Note

The startsap and stopsap commands are deprecated. SAP recommends that you do not use them any longer. For more information, see SAP Notes 1763593 Information published on SAP site and 809477 Information published on SAP site.

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

Procedure

  • Starting an SAP System or Instance
    • Starting an SAP System:

      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

    • Starting an SAP System Instance

      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

  • Stopping an SAP System or Instance
    • Stopping an SAP System

      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

    • Stopping an SAP System Instance

      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

      Note

      The database is not stopped by these commands. You have to stop the database using database-specific tools or commands.

  • Checking System Instance and Processes
    • With the following command you get a list of system instances, their status, and the ports used by them (<Instance_Number> can be the number of any instance of the SAP system):

      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

    • With the following command you get a list of instance processes and their status:

      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

  • Troubleshooting

    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.