Procedure documentationStarting and Stopping the SAP System Using Scripts (Unix) Locate this document in the navigation structure

 

You can start and stop the SAP system by running the startsap and stopsap scripts.

Prerequisites

  • You have checked the default profile /<sapmnt>/<SAPSID>/profile/DEFAULT.PFL for parameter login/system client and set the value to the correct production system client. For example, the entry must be login/system_client = 001 if your productive client is 001.

  • You have logged on to the SAP system hosts as user <sapsid>adm.

  • For more information about how to start or stop database-specific tools, see the database-specific information in this documentation and the documentation from the database manufacturer.

  • If you want to use startsap or stopsap (for example, in a script) and require the fully qualified name of these SAP scripts, create a link to startsap or stopsap in the home directory of the corresponding user.

    Caution Caution

    If there are multiple SAP instances on one host – for example, a primary application server instance and an additional application server instance – you must add an extra parameter to the scripts:

    startsap <instanceID>

    stopsap <instanceID>

    For example, for the primary application server instance of an SAP system with AS ABAP execute the following command:

    startsap DVEBMGS00

    For example, for the primary application server instance of an SAP system with AS Java execute the following command:

    startsap J00

    End of the caution.

    Note Note

    SAP system based on AS ABAP and AS Java (dual-stack system): The instance name (instance ID) of the primary application server instance is DVEBMGS<Instance_Number>, the instance name of the central services instance is SCS<Instance_Number>, and the instance name of an additional application server instance is D<Instance_Number>.

    High-availability only: The instance name of the ABAP central services instance is ASCS<Instance_Number>.

    End of the note.

    Note Note

    SAP system based on AS Java (Java only system): The instance name (instance ID) of the primary application server instance is J<Instance_Number>, the instance name of the central services instance is SCS<Instance_Number>, and the instance name of a Java additional application server instance is J<Instance_Number>.

    End of the note.

    Note Note

    SAP system based on AS ABAP (ABAP only system): The instance name (instance ID) of the primary application server instance is DVEBMGS<Instance_Number>, the instance name of an additional application server instance is D<Instance_Number>.

    High-availability only: The instance name of the ABAP central services instance is ASCS<Instance_Number>.

    End of the note.
  • In a high-availability system you must use the failover cluster software of your hardware vendor to start or stop all instances that are running on the switchover cluster.

    You can only use startsap and stopsap scripts for instances that are not running on the switchover cluster.

Procedure

Starting an SAP System
Starting an SAP system based on AS ABAP (ABAP-only system)
  • To start all instances on the central system host (that is all instances run on one single host), execute the following command:

    startsap

    This starts the database instance, the primary application server instance, and additional application server instances if they exist.

    Note Note

    You can start the SAP system instances separately by executing the following commands in the following sequence:

    startsap DB

    startsap R3 <instance ID of primary application server instance>

    startsap R3 <instance ID of additional application server instance>

    Make sure that you start the database before you start the primary application server instance because otherwise the other instances cannot start.

    End of the note.
  • In a distributed system, proceed as follows:

    1. On the host running the database instance, execute the following command:

      startdb

      Note Note

      Make sure that you always start the database first because otherwise the other instances cannot start.

      End of the note.
    2. On the host running the primary application server instance, execute the following command:

      startsap

    3. For additional application server instances, execute the following command on the relevant host:

      startsap R3 <instance ID of additional application server instance>

  • In a high-availability system, proceed as follows:

    Note Note

    In the following example, only the central services instance is running on the switchover cluster.

    End of the note.
    1. On the switchover cluster, use the failover cluster software to start the ABAP central services (ASCS) instance.

    2. On the database host, execute the following command:

      startdb

    3. On the host of the primary application server instance, execute the following command:

      startsap

    4. For additional application server instances, execute the following command on the relevant host:

      startsap R3 <instance ID of additional application server instance>

  • For an additional application server instance, execute the following command on the relevant host:

    startsap R3 <instance ID of additional application server instance>

    Note Note

    Make sure that the SAP system is up and running before you start or restart additional application server instances.

    End of the note.
Starting an SAP system based on AS Java (Java-only system)
  • To start all instances on the central system host (that is all instances run on one single host), execute the following command:

    startsap

    This starts the central services (SCS) instance, the database instance, the primary application server instance, and additional application server instances if they exist.

    Note Note

    You can start the SAP system instances separately by executing the following commands in the following sequence:

    startsap J2EE <instance ID of central services instance>

    startsap DB

    startsap J2EE <instance ID of primary application server instance>

    startsap J2EE <instance ID of additional application server instance>

    Make sure that you start the database before you start the primary application server instance, because otherwise the other instances cannot start.

    End of the note.
  • In a distributed system, proceed as follows:

    1. On the host running the central services (SCS) instance, execute the following command:

      startsap

    2. On the host running the database instance, execute the following command:

      startdb

      Note Note

      Make sure that you start the database before you start the primary application server instance, because otherwise the other instances cannot start.

      End of the note.
    3. On the host running the primary application server instance, execute the following command:

      startsap

    4. For additional application server instances, execute the following command on the relevant host:

      startsap J2EE <instance ID of additional application server instance>

  • In a high-availability system, proceed as follows:

    Note Note

    In the following example, only the central services instance is running on the switchover cluster.

    End of the note.
    1. On the switchover cluster, use the failover cluster software to start the central services (SCS) instance.

    2. On the database host, execute the following command:

      startdb

      Note Note

      Make sure that you start the database before you start the primary application server instance, because otherwise the other instances cannot start.

      End of the note.
    3. On the host of the primary application server instance, execute the following command:

      startsap

    4. For additional application server instances, execute the following command on the relevant host:

      startsap J2EE <instance ID of additional application server instance>

  • For an additional application server instance, execute the following command on the relevant host:

    startsap J2EE <instance ID of additional application server instance>

    Note Note

    Make sure that the SAP system is up and running before you start or restart additional application server instances.

    End of the note.
Starting an SAP system based on AS ABAP and AS Java (dual-stack system)
  • To start all instances on the central system host (that is all instances run on one host), execute the following command:

    startsap

    This starts the central services (SCS) instance, the database instance, the primary application server instance, and additional application server instances if they exist.

    Note Note

    For SAP systems based on AS ABAP and AS Java (dual-stack systems), you can execute either the command startsap R3 or startsap J2EE to start the SAP instance comprising both ABAP and Java. The parameter J2EE is a synonym for the parameter R3.

    End of the note.

    Note Note

    You can start the SAP system instances separately by executing the following commands in the following sequence:

    startsap R3 <instance ID of central services instance>

    startsap DB

    startsap R3 <instance ID of primary application server instance>

    startsap R3 <instance ID of additional application server instance>

    Make sure that you always start the database before you start the primary application server instance, because otherwise the other instances cannot start.

    End of the note.
  • In a distributed system, proceed as follows:

    1. On the host running the central services (SCS) instance, execute the following command:

      startsap

    2. On the host running the database instance, execute the following command:

      startdb

    3. On the host running the primary application server instance, execute the following command:

      startsap

    4. For additional application server instances, execute the following command on the relevant host:

      startsap R3 <instance ID of additional application server instance>

  • In a high-availability system, proceed as follows:

    Note Note

    In the following example, only the central services instance is running on the switchover cluster.

    End of the note.
    1. On the switchover cluster, use the failover cluster software to start the ABAP central services (ASCS) instance and the (Java) central services (SCS) instance.

    2. On the database host, execute the following command:

      startdb

      Note Note

      Make sure that you start the database before you start the primary application server instance, because otherwise the other instances cannot start.

      End of the note.
    3. On the host of the primary application server instance, execute the following command:

      startsap

    4. For additional application server instances, execute the following command on the relevant host:

      startsap R3 <instance ID of additional application server instance>

  • For an additional application server instance, execute the following command on the relevant host:

    startsap R3 <instance ID of additional application server instance>

    Note Note

    Make sure that the SAP system is up and running before you start or restart additional application server instances.

    End of the note.
Stopping an SAP System
Stopping an SAP system based on AS ABAP (ABAP-only system)

Note Note

When you use stopsap in a Multiple Components in One Database (MCOD) system with two primary application server instances, only one primary application server instance and the database are shut down. Therefore, you must first stop the other SAP system with stopsap R3 or make sure that it has already been stopped.

End of the note.
  • If you have a central system (that is all instances run on one single host), execute the following command to stop all instances on the central system host:

    stopsap

    This stops additional application server instances if they exist, the database instance, and the primary application server instance.

    Note Note

    You can stop the SAP system instances separately by executing the following commands in the following sequence:

    stopsap R3 <instance ID of additional application server instance>

    stopsap R3 <instance ID of primary application server instance>

    stopsap DB

    Make sure that you stop the primary application server instance before you stop the database instance because otherwise the database cannot be stopped.

    End of the note.
  • In a distributed system, proceed as follows:

    1. On the host(s) running the additional application server instances, execute the following command:

      stopsap <instance ID of additional application server instance>

    2. On the host running the primary application server instance, execute the following command:

      stopsap

      Note Note

      Make sure that you stop the primary application server instance before you stop the database instance because otherwise the database cannot be stopped.

      End of the note.
    3. On the host running the database instance, execute the following command:

      stopdb

  • In a high–availability system, proceed as follows:

    Note Note

    In the following example, only the ABAP central services (ASCS) instance is running on the switchover cluster.

    End of the note.
    1. On the hosts running the additional application server instances, execute the following command for each additional application server instance:

      stopsap <instance ID of additional application server instance>

    2. On the host running the primary application server instance, execute the following command:

      stopsap

      Note Note

      Make sure that you stop the primary application server instance before you stop the database instance because otherwise the database cannot be stopped.

      End of the note.
    3. On the host running the database instance, execute the following command:

      stopdb

    4. On the switchover cluster infrastructure, use the failover cluster software to stop the ABAP central services (ASCS) instance.

  • For an additional application server instance, execute the following command on the relevant host:

    stopsap R3 <instance ID of additional application server instance>

Caution Caution

Make sure that no SAP instance is running before you execute stopdb on a standalone database server. No automatic check is made.

End of the caution.
Stopping an SAP system based on AS Java (Java-only system)

Note Note

When you use stopsap in a Multiple Components in One Database (MCOD) system with two primary application server instances, only one primary application server instance and the database are shut down. Therefore, you must first stop the other SAP system with stopsap R3 or make sure that it has already been stopped.

End of the note.
  • If you have a central system (that is all instances run on one single host), execute the following command to stop all instances on the central system host:

    stopsap

    This stops additional application server instances if they exist, the primary application server instance, the database instance, and the central services (SCS) instance.

    Note Note

    You can stop the SAP system instances separately by executing the following commands in the following sequence:

    stopsap J2EE <instance ID of additional application server instance>

    stopsap J2EE <instance ID of primary application server instance>

    stopsap DB

    stopsap J2EE <instance ID of central services instance>

    Make sure that you stop the primary application server instance before you stop the database instance because otherwise the database cannot be stopped.

    End of the note.
  • In a distributed system, proceed as follows:

    1. On the hosts running the additional application server instances, execute the following command for each additional application server instance:

      stopsap <instance ID of additional application server instance>

    2. On the host running the primary application server instance, execute the following command:

      stopsap

      Note Note

      Make sure that you stop the primary application server instance before you stop the database instance because otherwise the database cannot be stopped.

      End of the note.
    3. On the host running the database instance, execute the following command:

      stopdb

    4. On the host running the central services (SCS) instance, execute the following command:

      stopsap

  • In a high–availability system, proceed as follows:

    Note Note

    In the following example, only the central services instance is running on the switchover cluster.

    End of the note.
    1. On the hosts running the additional application server instances, execute the following command for each additional application server instance:

      stopsap <instance ID of additional application server instance>

    2. On the host running the primary application server instance, execute the following command:

      stopsap

      Note Note

      Make sure that you stop the primary application server instance before you stop the database instance because otherwise the database cannot be stopped.

      End of the note.
    3. On the host running the database instance, execute the following command:

      stopdb

    4. On the switchover cluster infrastructure, use the failover cluster software to stop the central services SCS instance.

  • For an additional application server instance, execute the following command on the relevant host:

    stopsap J2EE <instance ID of additional application server instance>

Caution Caution

Make sure that no SAP instance is running before you execute stopdb on a standalone database server. No automatic check is made.

End of the caution.
Stopping an SAP system based on AS ABAP and AS Java (dual-stack system)

Note Note

When you use stopsap in a Multiple Components in One Database (MCOD) system with two primary application server instances, only one primary application server instance and the database are shut down. Therefore, you must first stop the other SAP system with stopsap R3 or make sure that it has already been stopped.

End of the note.
  • If you have a central system (that is all instances run on one single host), execute the following command to stop all instances on the central system host:

    stopsap

    This stops the primary application server instance, central services instance, and database.

    Note Note

    For SAP systems based on AS ABAP and AS Java (dual-stack systems), you can execute either the command stopsap R3 or stopsap J2EE to start the SAP instance comprising both ABAP and Java. The parameter J2EE is a synonym for the parameter R3.

    End of the note.

    Note Note

    You can stop the SAP system instances separately by executing the following commands in the following sequence:

    stopsap R3 <instance ID of additional application server instance>

    stopsap R3 <instance ID of primary application server instance>

    stopsap DB

    stopsap R3 <instance ID of central services instance>

    Make sure that you stop the primary application server instance before the database instance because otherwise the database cannot be stopped.

    End of the note.
  • In a distributed system, proceed as follows:

    1. On the host(s) running the additional application server instances, execute the following command:

      stopsap <instance ID of additional application server instance>

    2. On the host running the primary application server instance, execute the following command:

      stopsap

      Note Note

      Make sure that you stop the primary application server instance before you stop the database instance because otherwise the database cannot be stopped.

      End of the note.
    3. On the host running the central services (SCS) instance, execute the following command:

      stopsap

    4. On the host running the database instance, execute the following command:

      stopdb

  • In a high–availability system, proceed as follows:

    Note Note

    In the following example, only the central services instance is running on the switchover cluster.

    End of the note.
    1. On the hosts running the additional application server instances, execute the following command:

      stopsap <instance ID of additional application server instance>

    2. On the host running the primary application server instance, execute the following command:

      stopsap

      Note Note

      Make sure that you stop the primary application server instance before you stop the database instance because otherwise the database cannot be stopped.

      End of the note.
    3. On the host running the database instance, execute the following command:

      stopdb

    4. On the switchover cluster, use the failover cluster software to stop the ABAP central services (ASCS) instance and the (Java) central services (SCS) instance.

  • For an additional application server instance, execute the following command on the relevant host:

    stopsap R3 <instance ID of additional application server instance>

Caution Caution

Make sure that no SAP instance is running before you execute stopdb on a standalone database server. No automatic check is made.

End of the caution.