Starting and Stopping the SAP System Using Scripts (Unix) 
You can start and stop the SAP system by running the startsap and stopsap scripts.
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
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
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>.
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>.
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>.
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.
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
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.
In a distributed system, proceed as follows:
On the host running the database instance, execute the following command:
startdb
Note
Make sure that you always start the database first because otherwise the other instances cannot start.
On the host running the primary application server instance, execute the following command:
startsap
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
In the following example, only the central services instance is running on the switchover cluster.
On the switchover cluster, use the failover cluster software to start the ABAP central services (ASCS) instance.
On the database host, execute the following command:
startdb
On the host of the primary application server instance, execute the following command:
startsap
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
Make sure that the SAP system is up and running before you start or restart additional application server instances.
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
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.
In a distributed system, proceed as follows:
On the host running the central services (SCS) instance, execute the following command:
startsap
On the host running the database instance, execute the following command:
startdb
Note
Make sure that you start the database before you start the primary application server instance, because otherwise the other instances cannot start.
On the host running the primary application server instance, execute the following command:
startsap
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
In the following example, only the central services instance is running on the switchover cluster.
On the switchover cluster, use the failover cluster software to start the central services (SCS) instance.
On the database host, execute the following command:
startdb
Note
Make sure that you start the database before you start the primary application server instance, because otherwise the other instances cannot start.
On the host of the primary application server instance, execute the following command:
startsap
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
Make sure that the SAP system is up and running before you start or restart additional application server instances.
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
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.
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.
In a distributed system, proceed as follows:
On the host running the central services (SCS) instance, execute the following command:
startsap
On the host running the database instance, execute the following command:
startdb
On the host running the primary application server instance, execute the following command:
startsap
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
In the following example, only the central services instance is running on the switchover cluster.
On the switchover cluster, use the failover cluster software to start the ABAP central services (ASCS) instance and the (Java) central services (SCS) instance.
On the database host, execute the following command:
startdb
Note
Make sure that you start the database before you start the primary application server instance, because otherwise the other instances cannot start.
On the host of the primary application server instance, execute the following command:
startsap
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
Make sure that the SAP system is up and running before you start or restart additional application server instances.
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.
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
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.
In a distributed system, proceed as follows:
On the host(s) running the additional application server instances, execute the following command:
stopsap <instance ID of additional application server instance>
On the host running the primary application server instance, execute the following command:
stopsap
Note
Make sure that you stop the primary application server instance before you stop the database instance because otherwise the database cannot be stopped.
On the host running the database instance, execute the following command:
stopdb
In a high–availability system, proceed as follows:
Note
In the following example, only the ABAP central services (ASCS) instance is running on the switchover cluster.
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>
On the host running the primary application server instance, execute the following command:
stopsap
Note
Make sure that you stop the primary application server instance before you stop the database instance because otherwise the database cannot be stopped.
On the host running the database instance, execute the following command:
stopdb
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
Make sure that no SAP instance is running before you execute stopdb on a standalone database server. No automatic check is made.
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.
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
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.
In a distributed system, proceed as follows:
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>
On the host running the primary application server instance, execute the following command:
stopsap
Note
Make sure that you stop the primary application server instance before you stop the database instance because otherwise the database cannot be stopped.
On the host running the database instance, execute the following command:
stopdb
On the host running the central services (SCS) instance, execute the following command:
stopsap
In a high–availability system, proceed as follows:
Note
In the following example, only the central services instance is running on the switchover cluster.
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>
On the host running the primary application server instance, execute the following command:
stopsap
Note
Make sure that you stop the primary application server instance before you stop the database instance because otherwise the database cannot be stopped.
On the host running the database instance, execute the following command:
stopdb
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
Make sure that no SAP instance is running before you execute stopdb on a standalone database server. No automatic check is made.
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.
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
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.
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.
In a distributed system, proceed as follows:
On the host(s) running the additional application server instances, execute the following command:
stopsap <instance ID of additional application server instance>
On the host running the primary application server instance, execute the following command:
stopsap
Note
Make sure that you stop the primary application server instance before you stop the database instance because otherwise the database cannot be stopped.
On the host running the central services (SCS) instance, execute the following command:
stopsap
On the host running the database instance, execute the following command:
stopdb
In a high–availability system, proceed as follows:
Note
In the following example, only the central services instance is running on the switchover cluster.
On the hosts running the additional application server instances, execute the following command:
stopsap <instance ID of additional application server instance>
On the host running the primary application server instance, execute the following command:
stopsap
Note
Make sure that you stop the primary application server instance before you stop the database instance because otherwise the database cannot be stopped.
On the host running the database instance, execute the following command:
stopdb
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
Make sure that no SAP instance is running before you execute stopdb on a standalone database server. No automatic check is made.