Introducing Different Tools for Start and Stop Procedures

Objectives

After completing this lesson, you will be able to:
  • Start the SAP Management Console (SAP MC) using a configuration file
  • Use SAPControl on operating system level
  • Start the SAP Microsoft Management Console (SAP MMC)

SAP MC Layout

The SAP Management Console (SAP MC) provides a common framework for centralized system management. It allows you to monitor and perform basic administration tasks on the SAP system centrally, thus simplifying system administration.

The structure of the graphical tool is quite simple. On the left there is a navigation tree, which typically provides one or more SAP system landscapes. Every SAP system is visualized in a hierarchical structure and can be expanded or collapsed.

Whenever a node is selected in the Navigation Pane, the Result Pane on the right hand side shows details about the selected entry. Functions are mainly provided by the context menu of an individual node.

The other areas of the SAP MC are self-explanatory. There is a small menu bar, an Application toolbar, and in the lower right corner a link to the operations log. The minimalistic help section First steps only appears in the Result Pane if initially nothing is selected in the Navigation Pane on the left.

Dynamic behavior is a core characteristic of the Java-based graphical tool. The system icons and the nodes for instances, processes, and alerts are displayed in different colors depending on their state:

  • Gray: Unknown state, only outdated values, system/instance/process/service is offline
  • Green: Running
  • Yellow: Starting or stopping or warning (not all elements are running)
  • Red: Error

When selecting a node in the tree structure of the Navigation Pane, the status of the individual elements (for example, SAP systems or instances) is also shown in the section on the right with detailed status information, which is very useful in case there is a one-to-many relationship between the relevant elements on the left and on the right.

Further functions like filters, sorting (descending/ascending), progress bar, and other features can be used in combination with selected content.

The list of tree nodes in the Navigation Pane is exhaustive. The SAP system hierarchy covers the included instances, process lists and process tables, current status and open alerts for monitoring, as well as sessions, caches, log and trace files, and many more useful information.

You can view the SAP MC version in the menu by selecting the question mark icon ?About in the Application toolbar.

SAP MC: Background Information

SAP Management Console (SAP MC) is a platform-independent application that allows you to display monitoring information and perform administrative tasks, such as starting and stopping, in the same user interface on different operating systems and databases. SAP MC is a standalone Java application that is supplied as standard with the SAP kernel and is ready for use without any additional installation.

According to the SAP recommendation customers should always use the latest version of the SAP MC, otherwise certain features might not be available.

The SAP MC is provided with the SAP kernel and can found in the explicit kernel sub-directories /servicehttp/sapmc on UNIX/Linux and \servicehttp\sapmc on Windows at the well known kernel locations. As already discussed in a previous lesson, the global kernel is replicated during startup of the SAP system to the local (instance-specific) directories. Global sources of the SAP MC are the following locations:

  • UNIX/Linux: /sapmnt/<SAPSID>/exe/<codepage>/<platform>/servicehttp/sapmc
  • Windows: \\<SAPGLOBALHOST>\sapmnt\<SAPSID>\SYS\exe\<codepage>\<platform>\servicehttp\sapmc

The SAP MC is a Java application and - in former times - it was typically started as a Java applet by making use of a Java Runtime Environment (JRE 5.0 or higher) and a URL in combination with some mandatory browser settings (for example, Java Plugin installed and scripting of Java applets enabled). But the Java Plugin is a third-party component and was only supported until March 2019. As a consequence of the end-of-life date for the browser support, a different method should be used to start the Java application SAP MC, which is a local configuration on a frontend computer making use of Java Web Start (see next section in this lesson for more information).

More information is provided by the following SAP Notes:

  • 1014480 - SAP Management Console (SAP MC)

  • 2283330 - SAP browser information about the Java Plugin

Because the start of the SAP MC via an URL is still defined as default start option within the default configuration file sapmc.jnlp, and for the sake of completeness, the URLs are still mentioned here as follows:

  • http://<host name>:5<instance_number>13
  • https://<host name>:5<instance_number>14

With the above URLs the sapstartsrvdaemon or service uses its web service function and sends the Java applet to the browser that is starting the SAP Management Console.

The communication with and the use of sapstartsrv always raises security relevant questions, which have to be answered in the context of the individual customer scenario. Depending on the requirements and guidelines further configuration has to be done by security experts.

Note

Security relevant features and configurations are not covered in this class. Please refer to the relevant Security Guide of the product in use and the appropriate section in the online documentation.

The following examples might be security relevant topics in combination with sapstartsrv:

  • The use of Transport Layer Security (TLS) requires https configuration steps for sapstartsrv. The steps are described in the following SAP Note: 1036107 - Using SAP MC via HTTPS

  • The sapstartsrv process manages an internal list of protected operations. These can be changed, if necessary, with the instance profile parameter service/protectedwebmethods.

  • Determine the IP address and host name to which the web service port should be connected (default: all / 0.0.0.0) to limit accessibility in the network with the instance profile parameter service/hostname. Refer to SAP Note 927637 - Web service authentication in sapstartsrv as of release 7.00.

SAP MC: Start Using a Locally Configured jnlp-file

To start the SAP MC with a locally configured jnlp file based on Java Web Start, the complete content of folder sapmc has to be provided in combination with a locally installed Java Runtime Environment (JRE 5.0 or higher).

The configuration of the start file for the local call of the SAP MC is a minimalistic approach. It can be enhanced by a simple landscape file, specifying the SAP systems and SAP instances to be handled within the tool. So, the focus here is on the adjustment of the by default delivered jnlp-file and in addition on providing a customer-specific landscape file, which links the SAP MC to the respective resources.

The default sapmc.jnlp file within the above mentioned kernel sub-directory provides a specification of which codebase should be used. The standard codebase is still a URL and points to the host (or PC or front end) where the referencing jnlp-file is provided. Even if you want to make use of this method, the hostname has to be adjusted according to your local environment.

Steps to Configure SAP MC locally

  1. Configure in the <jnlp_file> the following entries:
    • codebase: file instead of http
    • <hostname>: adjust according to your front end
    • <file_path><jnlp_file>: adjust according to your front-end
  2. Create a <landscape_file> and refer to it in the <jnlp_file>
    • Create file <landscape_file>
    • Insert into the <landscape_file>: <instance_hostname> and <instance_number> of SAP instances (in csv format)
    • Insert into the <jnlp_file>: argumentlandscape=file: with <path><landscape_file>

Step 1 - Details

Assuming Java Web Start should be used as method to start the SAP MC, you are forced to change the codebase and (maybe) the hostname. Instead of using a URL via a web browser, the keyword file indicates a fully qualified path to the respective jnlp-file, which should be used (see step 1 in the figure above for an example).

By purely changing the codebase the SAP MC would not provide any content by means of SAP systems and SAP instances. In contrast, the start method using a URL in a web browser already provides a dedicated host and port of the instance-specific sapstartsrv and with the default setting Always show all SAP instances (on the same host) of an SAP system are initially already visible.

Provide the full path to the <jnlp_file> and save the file on OS level of your front end (PC).

Step 2 - Details

Create a file in the same directory as the <jnlp_file> using a text editor and provide a list of SAP instances, which should be displayed when starting the SAP MC locally on your front end (PC). Take care of the expected csv format and put into one explicit row only one SAP instance by specifying <instance_hostname>,<instance_number>= (see figure above for an example).

Finally insert the following argument as parameter in the <jnlp_file> underneath section <application-desc main class="...">:

  • <argument>landscape=file:<path>/<landscape_file>
  • <argument>
  • </application-desc>

Further configuration can be made within the <jnlp_file>, for example the configuration of permissions and adjustments of the memory consumption.

SAP MC: Loading SAP Systems, SAP Instances, and System Landscapes

The SAP MC can be used to register single SAP systems or SAP instances manually or even predefine complete system landscapes in file format and load them as needed into the tool. For both approaches the SAP MC offers a comfortable reuse of loaded content based on the existing history.

Register complete SAP systems or individual SAP instances

There are two different options to register content in the SAP MC:

  • Registering Instances of SAP systems by Specifying the SAP instance Host Parameters
  • Registering complete SAP systems by Use Message Server parameters

Both options offer a complete scan of the respective resource by using the flag Always show all SAP instances. In this way the user is not forced to repeatedly use the same wizard, if there are multiple instances detected on the specified host.

Saving and Loading Landscapes

There are also two different ways to load Landscapes in the SAP MC:

  • Load a Landscape via menu path FileLoad Landscape...
  • Load a Landscape initially with the start of the SAP MC using the argumentlandscape=file:<path><landscape_file> as configuration in the <jnlp_file> (see figure Start SAP Management Console (SAP MC) with jnlp file above in this lesson).

To force a consolidated customer environment based on administrative personnel sharing the same or comparable responsibilities, it makes sense to agree on a common structure, which can be defined as a Landscape definition file and provided for all team members. In case individual adjustments have to be done, you are still flexible in configuring your own SAP MC environment.

Start the SAP Management Console (SAP MC) and Verify Some Settings

Prerequisites

Business Example

As a system administrator, you want to make use of the graphical tool SAP Management Console (SAM MC). to make yourself familiar with the start of the console and the internal structure.

In this exercise, when an object name or value contains ##, replace ## by the number your instructor assigned to you.

Steps

  1. Start the SAP Management Console (SAP MC) within the WTS training environment with a pre-configured jnlp file.

    1. On the training WTS, start File Explorer.

    2. Select the Windows logo and type file

    3. Select File Explorer in the Best match results list.

    4. Choose at the left of the File Explorer the entry wdflbmt<number>.

    5. In the area Devices and drives select Application (N:) with a double-click.

    6. Now choose the following path by selecting in the following order the corresponding folders: SAP > SAPMC > servicehttp > sapmc

    7. Select the file named training_sapmc.jnlp and execute it with a double-click.

    8. Confirm the Security Warning: The application's digital signature has an error. Do you want to run this application? ... in the dialog box with push-button Run.

      Result

      The SAP MC should be started and will be opened.
    9. Wait until the stop signs at the left Navigation Pane disappear.

  2. Check the Settings of the SAP Management Console (SAP MC) to be prepared when performing some actions later on.

    1. In the SAP Management Console (SAP MC) select via the menu ToolsSettings.... Alternatively in the Application toolbar choose the icon Show settings dialog.

    2. In the dialog box Settings in the area Connection check the settings of Automatic Update.

    3. The parameter Autoupdate: should be activated (flag is set) and under Update every: appears a value in seconds (default: 5).

      Note

      The Autoupdate interval cannot be changed to a value lower than 5 seconds in the SAP Management Console (SAP MC).
    4. Further settings in different areas are possible, but not covered here in this exercise.

      Hint

      If there are bad lighting conditions, for example high sun exposure, select in the Settings dialog Accessibility and then High Contrast Mode (restart required), choose Apply and Ok. Finally restart the SAP Management Console (SAP MC).
  3. Optional: Have a short look at your SAP system by expanding the <SAPSID> assigned to you by your instructor.

    Replace <X> by D, Q or P depending on the training systems assigned to you.

    There are 3 options for your assignment to an SAP system, S4D, S4Q or S4P. These are the available and individually assigned <SAPSID>'s.

    The PAS instance of the training system has the following instance number:

    • S4D: replace <$$> with 11
    • S4Q: replace <$$> with 21
    • S4P: replace <$$> with 31
    1. In the SAP Management Console (SAP MC) expand the node of the SAP system assigned to you (see above).

    2. You might experience that a pop-up Logon at <SAPSID> <instance_name><instance_number> on <hostname> will be shown, asking for OS credentials.

    3. Enter the operating system User ID (<sid>adm in lower case letters) and the Password provided by the instructor.

    4. Identify the instances ASCS<instance_number>, D<PAS instance_number>, and D<AAS instance_number>.

    5. Do not stop any SAP system(s) or instance(s) yet!

    6. Keep the SAP Management Console (SAP MC) open, you will need it later again.

      Result

      You are prepared to make use of the SAP Management Console (SAP MC) and know where and how to maintain their Settings.

Optional: Create an Individual jnlp File and Include Your Assigned SAP System

Business Example

As a system administrator, you need to manage stopping and starting actions for SAP systems. Initially, you want to specify your own SAP MC environment. Later on, when the tool was opened for the first time, your SAP system can be added or, alternatively, a System Landscape can be defined and loaded.

This task is typically done on a front-end computer. In this exercise, your log-on to the WTS training environment represents such a device.

Hint

In this exercise, when an object name or value contains ##, replace it with the 2-digit number assigned to you by the instructor.

Note

Replace <X> by D, Q or P depending on the training system assigned to you.

There are 3 options for your assignment to an SAP system, S4D, S4Q or S4P. These are the available and individually assigned <SAPSID>'s.

The SAP systems in the training environment have the following instance numbers:

  • S4D: instance numbers 10, 11, 12
  • S4Q: instance numbers 20, 21, 22
  • S4P: instance numbers 30, 31, 32

Note

These host names are needed as input values in a specific step of the exercise. The OS user is only necessary (in combination with the password), in case you are asked for authentication within the SAP MC when selecting the SAP system.

  • S4D: s4dhost with OS user s4dadm
  • S4Q: s4qhost with OS user s4qadm
  • S4P: s4phost with OS user s4padm

Prerequisites

You are logged on to the WTS training environment with your individually assigned user, as already done in the context of the preceding exercises in this class.

Steps

  1. Optional: Locate the default sapmc.jnlp file provided within the WTS training logon.

    1. On the training WTS, start File Explorer.

    2. Select the Windows logo and type file

    3. Select File Explorer in the Best match results list.

    4. Choose at the left of the File Explorer the entry wdflbmt<number>.

    5. In the area Devices and drives select Application (N:) with a double-click.

    6. Now choose the following path by selecting in the following order the corresponding folders: SAP > SAPMC > servicehttp > sapmc

    7. Select the file named sapmc.jnlp and create a copy by using the context menu a select Copy.

    8. Paste the copy of the file with CTRL+V into the same directory.

    9. Rename the newly created file using the appropriate option from the context menu to a name including your assigned 2-digit number (represented by ##): sapmc<##>.jnlp or any other individual name.

      Note

      Most importantly keep the extension of the file! It should be still jnlp
    10. Now edit the renamed file sapmc##.jnlp with the option Notepad from the context menu.

    11. Edit the codebase according to the following source and target information:

      Source: <jnlp spec="1.0+" codebase="http://hostname" href="sapmc.jnlp"> - this corresponds to the current entry within the jnlp file and has to be replaced by the target entry.

      Target: <jnlp spec="1.0+" codebase="file:/N:/SAP/SAPMC/servicehttp/sapmc" href="sapmc<##>.jnlp"> - this is what you will have to enter.

      Note

      Remember to replace variable ## with your individually assigned 2-digit number! In case you named the jnlp file differently, you have to provide the corresponding name here.
    12. Save the file and close it via FileSave and FileExit.

    13. Select the file named sapmc<##>.jnlp and execute it with a double-click.

    14. Confirm the question Do you want to run this application? in the dialog box with push-button Run.

    15. Keep the SAP MC open.

      Result

      The SAP MC should be started and will open up.
  2. Optional: Add your assigned SAP system to the newly initialized (and still open) SAP MC.

    1. In the still open SAP MC, use the path FileNew... or choose icon Add new instance (ctrl pressed N) in the Application toolbar.

    2. In the upcoming dialog box New System specify one of your Instance Nr. (see Note above at the beginning of this exercise) in the corresponding field. The SAP system was assigned to you by your instructor at the beginning of this class.

      Note

      It is irrelevant, which of the 3 instance numbers assigned to your SAP system is chosen, if you do not deselect the check-box in front of Always show all SAP instances.
    3. Enter the Instance Host (see Note above at the beginning of this exercise) in the next field (s4dhost or s4qhost or s4phost).

    4. As an option use push-button labeled Ping... for a simple test, whether the host can be reached and close the dialog box with OK.

    5. Select Finish in order to see the result of this action.

    6. On the left in the Navigation Pane expand your newly appearing SAP system by selecting the triangle icon.

    7. Keep the SAP MC open.

      Result

      The instances ASCS<instance_number_ASCS>, D<instance_number_PAS>, and D<instance_number_AAS are visible and can be expanded in addition. Your individual SAP MC was initialized and filled with the SAP system assigned to you for this training.

    Hint

    According to the default settings in the SAP MC, when re-opening the tool with the same jnlp file, the SAP MC remembers the included SAP system(s) or SAP instances. There is a History of included entries, which can be accessed via the MenuToolsSettings.... Here, the added entries are listed under Connect at startup. This is a feature, but can be configured at this place if unwanted.
  3. Optional: Create a Landscape file and close the SAP MC.

    In our training environment we use this option to show how the Landscape file is created via the SAP MC and then (next exercise step) changed manually to add entries.

    Note

    Because any course participant gets only one SAP system assigned, we will enter manually the underlying SAP HANA database system when manipulating the Landscape file. So, as a result of this exercise step, you should have a Landscape file reflecting your SAP landscape in terms of the assigned SAP system and the corresponding SAP HANA database system.
    1. In the still open SAP MC, use the path FileSave Landscapes....

    2. In the dialog box Save new landscape specify the following path. Scroll up to Drive Application (N:) using the selection icon of field Save In:

    3. Select the folders and use for each one the ENTER key in the following order: SAPSAPMCservicehttpsapmc

    4. Provide a File name in the corresponding field for the name of your Landscape file:

      • Development if you are assigned to the SAP system S4D SAP system
      • QualityAssurance if you are assigned to the SAP system S4Q SAP system
      • Production if you are assigned to the SAP system S4P SAP system
    5. Keep all other values and choose Save.

    6. Now close the SAP MC.

      Note

      This is important. Close the SAP MC!
  4. Edit the Landscape file manually to enter a further SAP system or an SAP instance, in order to provide it for other administrative personnel working with the same SAP environment.

    1. If you have still open the File Explorer, switch to the tool. If not, have a look at Step 1a) - 1f) in this exercise.

    2. Open the path to access the Landscape file: N:\SAP\SAPMC\servicehttp\sapmc

    3. Find the formerly created Landscape file with the suggested name:

      • Development if you are assigned to the SAP system S4D SAP system
      • QualityAssurance if you are assigned to the SAP system S4Q SAP system
      • Production if you are assigned to the SAP system S4P SAP system
    4. Change the Landscape file using the context menu with the option Notepad.

    5. Enter a new line at the end of the file and provide the meta data for your SAP HANA database system as follows (only 1 entry per participant):

      • For S4D: hadhost,10=
      • For S4Q: haqhost,20=
      • For S4P: haphost,30=
    6. Save the file and close it via FileSave and FileExit.

    7. Open the SAP MC.

    8. Open the path to access the Landscape file: N:\SAP\SAPMC\servicehttp\sapmc

    9. Select the file named sapmc<##>.jnlp and execute it with a double-click.

    10. Use the path FileLoad Landscape....

    11. In the dialog box Open specify the following path. Scroll up to Drive Application (N:) using the selection icon of field Look In:

    12. Select the folders and use for each one the ENTER key in the following order: SAPSAPMCservicehttpsapmc

    13. Select the Landscape file which you have changed in the last exercise step: Development or QualityAssurance or Production and choose Open.

    14. You should see your own landscape in the Navigation Pane on the left.

Explain the Basic Idea of the SAPControl Web Service

The SAP Start Service (sapstartsrv) provides basic management services for systems and instances and single server processes. These core functions and many further options are exposed by the SOAPWeb Service Interface named SAPControl.

SAPControl is part of the SAP kernel and is available on all operating system platforms supported by SAP.

Note

The startsap and stopsap commands are deprecated since April 2015. SAP recommends that you do not use them any longer. For more information, see SAP Note 1763593 - Starting and stopping SAP system instances - startsap/stopsap are deprecated.

The Web Service Interface builds an abstraction layer on top of the SAP Start Service and therefore goes well with the operating system independent strategy of SAP. Specifically in heterogeneous environments it is feasible to use SAPControl, for example in the context of scripting, without being forced to change the content when migrating to another platform (there are only some OS-specific exceptions).

In addition SAPControl offers significantly improved functionality with respect to platform independent monitoring.

Most methods use similar in and out parameters and return information in a table like data structure. The interface is using SOAP exception and HTTP error code for error handling.

Hint

For more information on SAPControl, read the following document: How to use the SAPControl Web Service Interface - https://www.sap.com/documents/2016/09/0a40e60d-8b7c-0010-82c7-eda71af511fa.html

Check the Bandwidth of SAPControl Commands

You can use SAPControl to start or stop an SAP system from the command line and use a variety of options to handle SAP systems and their elements, like instances, processes, and services.

Note

Be aware of the following:

SAPControl is the official name, but the core element is the command line tool, which is treated to be case-sensitive on OS-level. It has to be used according to the correct syntax, by means of sapcontrol itself always in lower case letters, whilst the functions and/or options require a specific mixture of upper and lower case characters.

Some core functions and the synopsis can be seen in the figure above.

Hint

Calling sapcontrol in the command line without any other options displays the syntax description. Alternatively use sapcontrol -h.

For more information and examples on how to use the command line tool sapcontrol, use the following link:Starting and Stopping SAP Systems Using SAPControl

Check the Status of the SAP System and Instances

An important preparatory task for start and stop actions of SAP systems is the verification of the status. Besides the usage of a graphical tool like the SAP MC, the command line interface of SAPControl offers a variety of so called Webmethods to check the status of the elements building an SAP system.

The following checks are most often used:

  • Overall Status of the SAP instances for an SAP system using WebmethodGetSystemInstanceList

    This method returns a list of all instances of the SAP system with its assigned priorityLEVEL. The column features identifies the instance type specifying the core processes and/or services (for example, ABAP, MESSAGESERVER, and so on).

  • Overall Status of one SAP instance using WebmethodGetProcessList

    This method returns a list of all processes directly started by the respective sapstartsrvWeb service according to the Instance profile.

Additional useful checks:

  • Version information using WebmethodGetVersionInfo

    This method returns a list of version information for the most important files of the instance.

  • List and status of Work Processes for one SAP instance using WebmethodABAPGetWPTable

    This method returns a list of the ABAP work processes, similar to transaction SM50

  • List the content of the ABAP Syslog using WebmethodABAPReadSyslog

    This method reads the ABAP Syslog and returns it as an array of entries, similar to transaction SM21

Status checks are often repeatedly executed. For this, SAPControl offers a feature with the option -repeat <N> <D> (<N> is a number for the amount of repetitions and <D> stands for a delay in seconds between the repetitions).

Use the SAP MMC

With the Microsoft Windows operating system, you can use both graphical tools, the SAP MC and the SAP Microsoft Management Console with an SAP snap-in (SAP MMC) to start, stop, and monitor an SAP system.

The SAP MMC allows you to start and stop the instances of SAP systems. For some databases, you can also display administrative information and the status of the database. Further database types can also be administered using the SAP MMC.

The look and feel of the SAP MMC is very similar to the SAP MC. The same applies to the information displayed, as well as the functions provided.

In contrast to the SAP MC, SAP instances are not named with their physical directory name in the file system (for example, D<instance_number>), but with the host name and instance number. The identification of the instance type has to be done using the <instance_number> or drilling down to the Process List and verifying the allocated processes and services.

Hint

A leading zero as part of the 2-digit <instance_number> will be hidden in the navigation tree of the SAP MMC.

Using functions in the SAP MMC is not different in comparison to the recommended SAP MC. The SAP MMC also asks for authentication with an OS user like the <sid>adm (or the SAPService<SID> on Windows platforms) when the first function based on an SAP system or instance will be addressed. It also takes care of the assigned priorities in case complete systems are started or stopped. Manual handling of individual instances is also possible.

Log in to track your progress & complete quizzes