Starting and Stopping SAP Systems

Objective

After completing this lesson, you will be able to operate the Tools to Start and Stop

The SAP Management Console (SAP MC)

The SAP Management Console (SAP MC) is an operating system-independent graphical application to start, restart and stop SAP systems and instances (see SAP Notes 1014480 and 995116https://me.sap.com/notes/1014480https://me.sap.com/notes/995116).In addition, the tool provides functions to display monitoring information. The tool is a standalone Java application, which can be started either as an applet or locally. The SAP MC is supplied as standard with the kernel and is ready for use without any additional installation.

The SAP MC is a Java application, which is supplied as a Java applet and was opened by default using a web browser. To use the applet correctly, it required a JRE (Java Runtime Environment) of version 1.4 or higher. In addition, the corresponding Java plugin for the browser had to be activated correctly and the following URLs were used:

http://<host name>:5<instance no.>13

Or, if you have configured https in sapstartsrv (see SAP Note 1036107:https://me.sap.com/notes/1036107):

https://<host name>:5<instance no.>14

Note

Cause of technical restrictions and security issues, the SAP MC nowadays is started locally by using a jnlp-file, which is configured according to the requirements of the customer. A Java Runtime Environment is still needed to make use of Java Web Start.

The SAP MC allows you to start and stop complete SAP systems, as well as any type of SAP instances, like Central Services and AS Java Instances (PAS/AAS). You can also display information about the instances of the SAP system and the employed database (name, manufacturer and name of the host on which the database is located).

The SAP Management Console (SAP MC) indicates the status of all instances of the system using colors. The colors have the following meaning for the SAP system or an SAP instance:

Status Indicators

ColorMeaning
GRAYstopped
YELLOWstarting or stopping
GREENstarted successful or running
REDerror

Starting and Stopping the Database with the SAP MC and SAP Host Agent

The SAP MC provides the option to start and stop the database. This function is not implemented in other tools such as the SAP Microsoft Management Console or SAPControl. With these tools the database is only started if two conditions are fulfilled:

  • The PAS and/or AAS instance are/is started
  • The database has to be installed on the same host as the PAS / AAS instance

On the host on which the database of the SAP system is installed, an SAP Host Agent must be installed, too. It starts and stops the database and provides monitoring data for the SAP MC using operating system collectors. The SAP MC receives the information from SAPControl on which host the database runs and connects with the SAP Host Agent, which starts or stops the database through the port 1128 (or 1129 for secure network communication).

A stopped database is displayed in "gray" and a started database in "green" color. If the database is not started correctly, the database icon is colored "yellow". Expand the database node and select the <DBSID>. In order to start or stop the database, use the context menu and select the function needed.

Hint

If the Database icon in the SAP MC displays in "blue" color, this might have different reasons:

  • Probably no SAP Host Agent is installed on the DB host
  • The SAP Host Agent is outdated
  • No database authentication took place yet (see also hint below)

Hint

Special features of SAP MaxDB:

For an SAP MaxDB a user must be specified with a password, so that the state of the database can be displayed and it can be started or stopped. If no user has been specified with a password, but this is needed, the database is displayed in "blue".

To enter a user name, click on the "blue" database icon. In the upcoming pop-up enter the database user name and password to authenticate.

If the SAP system is started with the SAP MC, then the SAP Host Agent is called first so that it can start the database, if it is in the state Stopped. Then the instances of the SAP system can be started according to their priorityLEVELS. Here, the communication takes place directly between the sapstartsrvdaemon / services and their SAPControl web service. The SAP MC receives information regarding the status of each instance through direct communication with the relevant SAPControl. The instances with priorityLEVEL 1 are typically started after the database was started, although it would be possible to start the Central Services (SCS) instance before the database. The SAP MC has the option to stop the database as an integrated function when stopping the AS Java-based SAP system. If this option is selected, the database will be stopped by the SAP Host Agent after all other instances were shut down.

The start process of an SAP system with the instances of priority 1 and 3 is as follows (see figure above): The administrator starts the SAP MC and sends a start command to the AS Java-based SAP system (complete SID). The sapstartsrv of the instance with the highest priority (SCS with priorityLEVEL 1 - see solid line to the sapstartsrv in the figure above) takes over control. The SAP MC receives information about all other sapstartsrvdaemon / services of the SAP system and their ports (shown as a dashed line in the figure above). Additionally, SAP MC receives the information on which host the database is running and opens the connection to the local SAP Host Agent (ports 1128/1129 - shown also as a dashed line in the figure above) installed on the database host. The connections to the sapstartsrv and to the SAP Host Agent are not technically different. The solid line symbolize only the initial call of the SAP MC to start the AS Java-based SAP system.

The following steps are executed in chronological order:

  1. In the SAP MCStartSystem ALL is executed.
  2. The SAP Host Agent receives the command to start the database.
  3. The SAP Host Agent starts the database, if it is in state "stopped".
  4. The SAPControl of the instance with the priorityLEVEL 1 gets the command to start the instances according to their priorityLEVEL.
  5. The SAPControl of the instance with the priorityLEVEL 1 starts its instance.
  6. The SAPControl of the instance with the priorityLEVEL 1 triggers SAPControl of the instance with the priorityLEVEL 3 to start it.
  7. The SAPControl of the instance with the priorityLEVEL 3 starts its instance.

Note

Instead of using SAP MC alternatively a SAPControl command with the webmethod (function) StartSystem ALL can be used on command line level:sapcontrol -nr <instance_number> -user <user_name> <password> -function StartSystem ALL

On each host on which an SAP instance was installed, an SAP Host Agent should be installed, too (this is not shown in the figure above for reasons of simplification). The SAP MC connects with the SAP Host Agent of the individual instances (assuming the instances are installed on different hosts), providing information about the main memory, the file system, and the operating system processes/services.

Starting and Stopping AS Java

The main tool to start and stop AS Java-based SAP systems is the SAP Management Console (SAP MC).

There is exactly one Central Services instance (SCS) and a mandatory Primary Application Server (PAS) instance (J<instance_number>). In case the AS Java-based SAP system is scaled, further Additional Application Server (AAS) instances (J<instance_number>) exist.

Note

Instances of SAP NetWeaver AS ABAP + Java (Dual-Stack) are deprecated. The support finished with SAP NetWeaver release 7.4 (out of support since end of 2020) With the introduction of SAP NetWeaver release 7.5., this type of system cannot be used anymore. Nevertheless, this combination of AS ABAP and AS Java in one <SAPSID> can also be started and stopped independently of the operating system using the SAP Management Console (SAP MC).

For each instance, SAP MC displays detailed information about the Java processes (see figure below) and the Central Services.

The SAP Management Console also allows you to display the trace files for the individual processes and services. You can use these trace files to analyze problems (see figure below). You can also use the SAP MC to evaluate the developer traces (and further log and trace files), display environment information and profiles.

SAPControl

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.

Special Characteristics of Starting and Stopping on Microsoft Windows

With the Microsoft Windows operating system, you can use both the SAP Management Console (SAP MC) and the SAP Microsoft Management Console (SAP MMC) with an SAP plug-in to start and stop an AS Java-based SAP system.

The SAP MMC allows you to start and stop complete AS Java-based SAP systems, as well as individual instances. For some databases, administrative functions can be used, displaying status information and even start and stop the database.

The functionality of the SAP MMC is similar to range of functions in the operating system independent SAP Management Console (SAP MC).

Special Characteristics of Starting and Stopping on UNIX/Linux

Previously, on AS Java-based SAP systems installed on UNIX/Linux operating system platforms, start and stop actions were executed by using scripts startsap and stopsap delivered by SAP with the installation procedure. These scripts are deprecated since April 2015. The recommended tools to handle start and stop procedures are the graphical SAP Management Console (SAP MC) or the command line tool SAPControl as Web service of sapstartsrv. Both tools are treated to be operating system independent and therefore used for UNIX/Linux environments, as well as for Windows-based SAP installations. Check the following SAP Note for details concerning the tool usage: https://me.sap.com/notes/1763593.

Optional: Tools for Starting and Stopping

Business Example

Caution

In TADM10 classes this exercise has to be done in a group of 2 participants who share one SAP Solution Manager AS Java-based SAP system on a common Clone!
  • Hybrid Class: Ask your Instructor to use dedicated Breakout Sessions in the Conference tool or use the Chat with your partner
  • SAP Live Class: Ask your Instructor to use dedicated Breakout Sessions in the Conference tool or use the Chat with your partner
  • Classroom: Ask your Instructor how to handle the exercise

You are using an AS Java-based SAP system. The operating system independent tool SAP Management Console (SAP MC) can be used on all operating system platforms.

Valid for this Exercise

ParameterValue
SAP ClassroomWTS
SAP System IDSMJ
Host name (FQDN)smhost.wdf.sap.corp
Operating SystemWindows
Operating system user / passwordsmjadm / <password>
Central Services InstanceSCS90
Primary Application Server (PAS)J91
SAP Management ConsoleSAP MC

Task 1: Optional: Stopping an AS Java-based SAP System using the SAP Management Console (SAP MC)

First check the status of the AS Java-based SAP system SMJ and then stop it. Use for both tasks the SAP MC provided on the WTS.

Steps

  1. Check the status of the SAP system SMJ and verify the Instances are running without issues. For those actions use the OS-independentSAP MC on the WTS.

    1. On the Windows-based WTS start a File Explorer by selecting the Windows Start button (Windows logo) in the lower left corner. use the right click and choose File Explorer.

    2. Directly type file.

    3. In the Best match resulting list choose File Explorer (Desktop app).

    4. In the File Explorer on the left in the navigation panel select wdflbmt<number>.

    5. Choose Application (N:) with a double-click on the right (repeat the former step if the drive does not appear yet).

    6. Choose the following file path SAP > SAPMC > servicehttp > sapmc and double-click on .

    7. In folder sapmc locate the file named training_sapmc.jnlp, and double-click on it.

    8. Confirm the Security Warning by flagging the check-box I accept the risk and want to run this application.

    9. Finally select Run.

    10. On the left in the navigation panel of the SAP MC select the SAP System SMJ.

    11. Once you are going to see security relevant information the OS authentication is requested by a pop-up Window Logon at SMJ <Instance name><Instance no.> on smhost. When this is the case use the following log on information:

      • User IDsmjadm
      • Password<password>

      Hint

      The user <sid>adm (generic format) was installed by the installation tool

    12. Finally choose Log on push button or hit the Enter key on your keyboard.

    13. Expand the SAP System SMJ by choosing the small triangle in front of SMJ.

    14. Now check the status of the SMJ Instances J91 on smhost and SCS90 on smhost. Both instances should show a green status.

    15. In the navigation panel on the left of the SAP MC expand the small triangle in front of the corresponding Instance to open all instances.

    16. In instance J91 on smhost flag Process List.

    17. On the right hand side switch to the Content area with the title Process List (<amount of processes>).

    18. Check if the status of the processes show a green icon in front of the process name.

    19. Repeat the last steps for the Central Services Instance SCS10 on smhost.

      Result

      All included Instances SCS90 on smhost and J91 on smhost show green color and are therefore up and running.
  2. On the WTS, stop the SAP system SMJ using the SAP MC.

    Hint

    In case an SAP System is not stopped by making use of the <SID>, but rather selecting the individual instances, you should always stop these instances in reverse priority order. Instances with the lowest priority (= highest no.!) are stopped first and those with the highest priority (= lowest no.!) last.

    PAS/AAS Instances with priority 3 are stopped first.

    SCS Instances with priority 1 are stopped next.

    Further priorityLEVELS might exist (e.g. 0.5 for an ERS instance).

    1. Be sure that the <SID>SMJ is still selected and appears in orange color (if high contrast mode is not selected). Click on SMJ with the left mouse button if needed.

    2. In the navigation panel use the secondary mouse button on SAP System SMJ and select the Stop ... function from the context menu.

    3. The pop-up Stop SAP System(s) provides Options for the stop procedure, based on (a) types of instances, (b) Hard or Soft shutdown and (c) an integrated shutdown function for some supported databases. Keep the default values and confirm with Ok.

    4. Wait until all instances are stopped indicated by a Grey status of SMJ. If one instance is still yellow after some time use on top in the Application Toolbar the blue refresh icon.

Task 2: Optional: Starting an AS Java-based SAP System using SAP Management Console (SAP MC)

Start the SAP System SMJ using the SAP MC, by starting the instances individually in the correct sequence. Observe the startup procedure and check the success of the actions.

Steps

  1. Start the SAP system SMJ using the SAP MC on the WTS.

    Caution

    You should always start the instances regarding their priority. The principle of the priorities is:The lower the priorityLEVEL, the higher the priority. The highest prioritized Instance (= lowest number!) is started first.The priorityLEVEL of an SCS Instance (Java: SCS<instance_number>) is 1The priorityLEVEL of a PAS/AAS Instance (Java: J<instance_number>) is 3

    The start sequence of the Application Server Instances (PAS/AAS) is not relevantDo not confuse <instance no.> (always 2 digits, e.g. 91) with <priority number> or priorityLEVEL (1 digit or e.g. 0.5, e.g. 1.5)Caution: Further priorityLEVELS might exist (e.g. 0.5 for an ERS instance.

    Note

    Further priorityLEVELS might exist (e.g. 0.5 for an ERS instance).

    Note

    If you select the node SMJ of the AS Java-based SAP system in the navigation tree of the SAP MC, you might also be asked for a database user and password (besides the OS authentication described in a former step).

    If the dialog Database user authentication failed appears, enter the database usercontrol with the respective password<password>.

    1. Still on the WTS use the already opened SAP MC and expand SMJ in the navigation area.

      Note

      In case you closed the SAP MC, repeat the former step to start and access the tool.

    2. In the navigation panel of the SAP MC choose the node for the SCS90 on smhost under the <SAPSID> of your AS Java-based SAP system (SMJ).

    3. Use the right mouse button to open the context menu.

    4. Select the Start ... function.

      Caution

      The pop-up will disappear after some seconds.

    5. Wait until the instance SCS90 on smhost was started successful by checking the status in the Process List (see former Exercise).

    6. Now start the Primary Application Server InstanceJ91 on smhost in the same way. Flag the respective instance with the left mouse button and choose the secondary mouse button to Start ... the instance(s).

    7. A further pop-up Start instance J<instance no.> on smhost appears temporarily. Press on Skip ... to monitor live the startup procedure (see next step).

  2. Monitor the start of the services and processes in your SAP System SMJ.

    Note

    Refresh from time to time the lists in the SAP MC to get an up-to-date status information in the content area. You can find the blue refresh icon in the Application Toolbar below the Menus.
    1. In the navigation panel of the SAP MC expand the instances which you recently started (J91 on smhost) as part of SAP System SMJ.

    2. Identify the entry AS Java and expand this node with the small triangle.

    3. Select the Process Table.

    4. Switch from the navigation panel to the content area on the right hand side and observe the values in column State Text for the different processes.

      Hint

      You may experience that the SAP MC jumps back to the Process List of the respective instance. This is an expected behavior and an indicator for an ongoing start or stop action of an <SID> or an <instance>.

    5. Different status information can be seen in the Process Table. Take special care about the JVM called Server process<no.> which is the main part of the Java Kernel:

      • Process Table (SMJJ91AS Java):
      • Waiting for start
      • Starting Framework
      • Starting Apps
      • Running
    6. Different status information can be seen in the Process List Take special care about the JVM called jstart which is the Instance Controller:

      • Process List (SMJJ91AS Java):
      • Deploying Offline Components
      • Synchronizing binaries
      • Starting the processes
      • All Processes Running
  3. Check whether your SAP System SMJ started correctly. To do so, verify in the SAP MC that all services and processes are running.

    1. In the navigation panel of the SAP MC expand the node SMJ and check the status of the included instances SCS90 on smhost, J91 on smhost. A green icon in front stands for a successfully started instance. A yellow icon indicates warnings (e.g. starting/stopping).

    2. With the status inheritance feature you will see already on the highest node the status of the overall SAP System SMJ. Please remember to use the refresh function. In interval of some seconds, the SAP MC is doing a auto-refresh.

    3. Check also the other processes, which were not mentioned In the former Exercise. For example the ICM process of the PAS instance using the path SMJJ91 on smhostAS JavaProcess Table.

Task 3: Optional: Connect to the operation system of your AS Java-based SAP System

Prerequisite for this Task: Connect to the operating system of your SAP System SMJ.

Valid for this Exercise - remember the OS relevant information from the beginning of this exercise:

ParameterValue
SAP System IDSMJ
Host name (FQDN)smhost.wdf.sap.corp
Operating SystemWindows
Operating system user / passwordsmjadm / <password>
Central Services InstanceSCS90
Primary Application Server (PAS)J91

Hint

If you already connected to the operation system you can skip this step and continue with the next step.

Steps

  1. Log on to the server smhost.wdf.sap.corp of your training system with Remote Desktop Connection (XRDP - described here in this exercise), MobaXterm or PuTTY using the smjadm operating system user with password <password>.

    1. On yourWTS choose the Windows Start button in the lower left corner.

    2. In the tiles area scroll down and select tile Remote Desktop...

    3. In dialog Remote Desktop Connection enter the following value into the field Computer: smhost.wdf.sap.corp.

    4. Choose Connect.

    5. Confirm the next security related dialog Remote Desktop Connection with the text The identity of the remote computer cannot be verified. Do you want to connect anyway? with Yes.

    6. On the window Logon to wdflbmt0201 (which is the physical hostname of smhost), enter the following:

      • usernamesmadm
      • password<password>
    7. Choose OK.

Task 4: Optional: Stopping an AS Java-based SAP System using Command Line

Prerequisite for this Task: Connect to the operating system of your SAP System SMJ.

Stop the SAP system SMJ using an operating system command.

Steps

  1. Check whether your SAP system is up and running on operating system level using the Windows Task Manager.

    1. Use the Windows Task Manager within the RDP session on smhost: Use the secondary mouse button on the Windows task bar and select Task Manager.

    2. In the Task Manager choose tab Details.

    3. Scroll down the list and identify processes (column Name) in the context of User nameSAPServiceSMJ.

      Result

      In case the SAP System is up and running, you will see the following processes (and others):
      • sapstartsrv.exe
      • msg_server.exe
      • enserver.exe
      • gwrd.exe
      • jstart.exe
    4. Minimize the Windows Task Manager.

  2. Use a sapcontrol command in a terminal session to stop the entire SAP System SMJ.

    1. In the RDP session on the smhost double-click the CMD icon on the Desktop.

    2. Type D: followed by RETURN.

    3. Navigate to the local kernel folder of the PAS Instance: cd usr\sap\SMJ\J91\exe

    4. Enter the command sapcontrol -user smjadm <password> -nr 90 -function StopSystem ALL to stop your SAP System SMJ.

  3. Observe the shutdown and check the success by using sapcontrol.

    1. Still connected using RDP choose the terminal session used for the last step.

    2. To get details for the processes of one instance enter command sapcontrol -user smjadm <password> -nr 91 -function GetProcessList

      Result

      The output lists the services and/or processes of the respective instance. In case of the above mentioned command it will show the content of the PAS Instance with status information like GREEN, YELLOW or GREY.

      Note

      Exchange the value of the option -nr to get status information for the SCS Instance. Use 90. This is the instance number of the Central Services Instance.

Task 5: Optional: Check whether your AS Java-based SAP system has stopped at operating system level

Steps

  1. Use sapcontrol to check, whether the SAP System was stopped successful.

    1. Still connected using RDP choose the terminal session used for the last step.

    2. Enter the command sapcontrol -user smjadm <password> -nr 90 -function GetSystemInstanceList to stop your SAP System SMJ.

      Result

      Both instances should appear with status GREY. Further statuses could be YELLOW, GREY or RED.

Task 6: Optional: Starting an AS Java-based SAP System using Command Line

Prerequisite for this Task: Connect to the operating system of your SAP System SMJ.

Start the SAP system SMJ step by step in the correct sequence using operating system commands.

Steps

  1. Use the sapcontrol command in a Terminal session to start the Central Services Instance SCS90 on smhost of the SAP system SMJ.

    1. In case you have still open the Terminal session from the former task, you can continue with the next step. If not, open a Terminal session using the following path: In the upper left corner of the XRDP session choose ApplicationsUtilitiesTerminal.

    2. In the Terminal session enter the command sapcontrol -user smjadm <password> -nr 90 -function Start to start the Central Services Instance SCS90 on smhost of the SAP System SMJ.

    3. In the Terminal session enter the command sapcontrol -user smjadm <password> -nr 91 -function InstanceStart smhost 91 to start the Additional Application Server Instance J91 on smhost of the SAP System SMJ.

Related Information

Related Information

Log in to track your progress & complete quizzes