Describing the System Start and Stop Procedure

Objectives

After completing this lesson, you will be able to:
  • Describe the Start and Stop sequence of Instances
  • Describe the general Start process of AS Java

System Start: Process

The start of an SAP system is a basic prerequisite for being able to work with the system. The start process describes the flow when starting an SAP system with a pure Java stack. A minimum Java-based SAP system will be named during the installation, providing a System Identifier (<SAPSID>). In addition, a database is used and at least two SAP instances: exactly one Central Services Instance (SCS) and one Primary Application Server Instance (PAS). This is the typical architecture directly after the installation. Later on, there might be a scaling by adding Additional Application Server Instances (AAS) to the existing installation. During the Installation procedure an assignment of priorities with so called LEVELS (using numbers) is done. In this step, different types of instances (SCS/PAS/AAS)get assigned priorityLEVELS, in order to specify the start and stop sequence of these processes and services bundles.

Priorities for the Start Process

Priority 1: Instances with an Enqueue Server but without ABAP Dispatcher

Priority 3: Instances without an Enqueue Server

Note

There are further priorities:

Priority 0.3: SAP HANA System

Priority 0.5: Enqueue Replication Server (ERS)

Priority 1.5: TREX (Search and Classification Engine)

Priority 2: Instances with an Enqueue and with an ABAP Dispatcher

These priorities are used in combination with special products/features and/or within earlier releases.

Note

In the directory $(DIR_GLOBAL)/sapcontrol every sapstartsrv daemon/service creates and updates individual files on a regular basis. These files have a prefix, which reflects the corresponding priority of the instance and can also be used for monitoring purposes.

The Enqueue Server plays a special role for the start sequence of an SAP system. It is assigned to exactly one instance, which is nowadays typically the Central Services Instance. In AS Java-based SAP systems, this instance also covers the Message Server and the RFC Gateway Service and must be started before all other SAP instances. The Java Central Services instance (priorityLEVEL 1) does not require a connection to the database. The start of the database is done by scripts, which were provided by the installation, and are used in case the database is installed on the same server as an SAP Application Server (AS) instance (PAS/AAS).

The SAP Management Console (SAP MC) is the recommended graphical tool for starting and stopping SAP systems. There is a special option implemented, which allows you to start and stop a database separately or during the start or stop of the SAP system, regardless of the server where the database is installed.

There are three different core elements, which have to be taken into account when starting an AS Java-based SAP system:

Central Services instance (SCS)

It consists of a Java Message Server, a Java Enqueue Server and an RFC Gateway Service.

Database (DB)

The database is the fundamental element of the entire SAP system and must be in an operational state before SAP Application Server (AS) instances (PAS and/or AAS - generic also called Java instances) are started.

Primary Application Server (PAS) instance and Additional Application Server (AAS) instance

In SAP Java environments, these instances are also simply called Java instances and provide the run-time environment for Java applications.

In principle, the start process is performed in multiple steps. The start process of an AS Java-based SAP system can be done in two different ways concerning the start sequence of the core elements:

Variant A:

SCS - DB - PAS/AAS

Variant B:

DB - SCS - PAS/AAS

The operating system user executing the start-up procedure is typically the <sid>adm which was created during the installation.

Note

The formerly used "Dual Stack Installations"(also called Add-in Installation) with ABAP and Java stack within one <SAPSID> had a very specific architecture and a special start order involving the ABAP Dispatcher in the mechanisms. This kind of system is not supported anymore since the technical release 7.5 and therefore not discussed here.

System Stop: Process

The stop of an SAP system is performed in reverse sequence regarding priorityLEVELS. From an SAP instance perspective, the Central Services instance (SCS) with the Enqueue Service is always stopped last. Depending on the tool used and the underlying operating system, the database (DB) remains running or will be stopped at the end of the procedure. A wide range of customers still use the deprecated OS-dependent start and stop scripts, which were delivered with earlier releases. With these scripts and the default shutdown option, the behavior differs for the DB on Microsoft Windows (DB remains running) and UNIX/Linux environments (DB shutdown). The recommended SAP tool SAP Management Console (SAP MC) does not stop the DB but at least provides an option to stop the DB at the end of the procedure (not valid for all supported DB providers).

Caution

Before stopping an AS Java-based SAP system, ensure all affected users are informed beforehand about the planned downtime. In addition, shortly before executing the stop command, drill down to the session management (e.g. using SAP NetWeaver Administrator) to verify, whether user sessions still exist. Do not forget: it is in the interest of all users (administrators and business users) that the business provided by the SAP system is stable and any inconsistency is avoided.

Note

For details on how the Startup and Control Framework works, refer to a further lesson in this class.

Hard Shutdown

The hard shutdown stops the SAP system or the SAP instance immediately, regardless, if user requests are currently processed or not. Nevertheless, any canceled SQL statement will be rolled-back in the database for consistency reasons. The hard shutdown can be triggered by making use of the graphical tool SAP Management Console (SAP MC) as well as using the program SAPCONTROL from the kernel directory on command line level.

When an SAP system stop was triggered, monitoring functions can be used to observe the action step by step. Details about the different phases are explained in a further lesson.

At the end of the shutdown procedure all resources are dis-allocated and the system is stopped. It depends on the situation and the selected function, whether the database is also stopped.

Soft Shutdown

If the soft shutdown for an AS Java-based instance is triggered, there is no log-on to the instance possible anymore. The instance is removed from the load balancing list of the Message Server. However, requests of logged on users are still dispatched to the related instance by the Message Server (for example http requests).

On the AS Java, every Server Process enters the state preparing to stop, if no critical task is running. And if there is no user session alive, the Server Process stops the application and shuts down. In case that user sessions exist, the Server Process waits until all user sessions have ended.

There is an option to limit the period the system waits for users to finish their work. In this way you can define, how long it should take before the system will execute a hard shutdown (e.g. after 300 seconds). This is a kind of compromise, allowing users to finish their work for a predefined time interval (soft shutdown) before switching to a hard shutdown.

Starting AS Java

When a Java-based SAP system is started, the priorities with the different LEVELS of the instances are taken into account. Typically the database is started first, then the mandatory Central Services instance (SCS) has to be initialized. This instance has priorityLEVEL 1. Finally the AS Java instance(s) (PAS/AAS) is/are started in order to provide Java functions using Server Process(es). Since priorities mainly focus with their LEVELS on the fact, whether the instance holds an Enqueue Server or not, the start sequence of the these AS instances (PAS/AAS) is not relevant, because the priorityLEVEL is identical. Both instance types (PAS/AAS) do not have an Enqueue Server and therefore get assigned the same priorityLEVEL 3. The AS-based instances are initialized and handled by an integrated Instance Controller.

Starting a Java-based SAP system

In an AS Java-based SAP system, the PAS and AAS instances are started and controlled by the Java Startup and Control Framework, which itself is initialized directly by the sapstartsrv. The core element of the Java Startup and Control Framework is the infrastructure that SAP provides for starting and stopping the Java stack. So, it can be called as the Java Instance ControllerJStart. Along with the Internet Communication Manager (ICM) and the Server Process(es), it builds the Java Startup and Control Framework. Using the relevant tools, for example the SAP Management Console (SAP MC) or the SAP Microsoft Management Console (SAP MMC), the start command is passed on to a sapstartsrv, which forwards this to the appropriate Instance Controller and starts the instance.

The Central Services instance is started first because it has priority level 1.

The PAS and AAS are then started (step 4) since they have priority level 3. The sapstartsrv of the PAS and AAS check before the start of the instance (step 3), whether the database is running; if it is not, it is started before the PAS or AAS instance. This is only valid, if the database is installed on the same host as the PAS or AAS instance.

Evaluating the Profiles in the Start Process

Every SAP system holds exactly one default profile for the complete <SAPSID> (System Identifier). In Addition, the SAP instances (SCS/PAS/AAS) building the SAP system, get assigned an individual Instance profile.

Formula: active profiles for one <SAPSID> = <amount of instances> + 1.

Instance profile: Information which processes and/or services have to be started to make the instance available. The instance profile is also used to start the sapstartsrv, which provides the communication (web) interface to the instance. Besides the start section, the Instance profile includes parameters relevant for the specific instance.

Note

If information for the start process is changed in the Instance profile, the sapstartsrv has to be restarted, in order to read the updated parameter(s) and value(s) within the respective profile.

Default profile: Definition of parameters relevant for the complete SAP system (for example referring to common resources like the Central Services). Inheritance of parameters and their values, so that other instances can use them without instance-specific provisioning.

In an AS Java-based SAP system, the sapstartsrv initializes the Startup and Control Framework of the AS instances (PAS/AAS).

Related Information

SAP Help Portal: help.sap.comBrowse by ProductTechnology PlatformSAP NetWeaverSAP NetWeaver 7.5SAP NetWeaver Library: Function-Oriented ViewApplication ServerApplication Server Java

Log in to track your progress & complete quizzes