Professional Documents
Culture Documents
Start and Stop SAP Systems Using Sapcontrol Command
Start and Stop SAP Systems Using Sapcontrol Command
command
28104,811
sapstartsrv is the first service to be started before starting ASCS or SCS instance and then DB instance
and then PAS instance.
ABAP Central Service instance ASCS01 and instance number is 01. D00 is the CI instance and instance
number is 00. SID = XYZ
Sapcontrol command calls or communicate sapstartsrv process. Hence sapstartsrv process must be available
(i.e. it is the first process to be started else executing sapcontrol command fails )
The sapstartsrv is a service in windows Operating system. In Unix it is scheduled as a daemon process .
There is a separate sapstartsrv process for each instance (i.e. sapstartsrv process for ASCSxx
instance – ABAP Central Service instance , another sapstartsrv process for D00 instance – PAS
instance , Dialog instances etc.) which is responsible for starting and stopping the instance.
What happens if you issue the StopService option of first sapcontrol command .
The sapstartsrv receives the signal from sapcontrol, the sapstartsrv process recognizes which
other sapstartsrv process of that instance is still active and starts or stops them accordingly.
sapcontrol -nr 00 -function StopService means sapstartsrv process will be stopped and
sapstartsrv process daemon will not be present in the output of unix command “ps -eaf|grep
sapstartsrv”.
If the sapstartsrv process is stopped then subsequent sapcontrol command will not able to execute
the command i.e. sapcontrol -nr 00 -function StopSystem ALL will give error message
“NIECONN refused, connection refused” as shown in the screenshot below
Summary:
sapstartsrv is the first service to be started before starting ASCS or SCS instance and then DB instance
and then PAS instance.
sapstartsrv –>ASCS (ABAP) or SCS (Java stack) –> Database instance –> PAS (CI) (if the CI+CS and
DB reside on the same host).
sapstartsrv-->DB instance –>ASCS or SCS (Java stack)–> PAS (CI) and AAS (if additional dialog instances
installed). (if all reside on the same host)
PAS and AAS (if additional dialog instances installed) —>ASCS or SCS (Java stack)—
>DB —>sapstartsrv
However, it is not necessary to stop or kill sapstartsrv process. sapstartsrv process should be
remained active after issuing stop ASCS and Dxx instances or SCS and Jxx instances. where xx is
The first command to stop system for PAS and AAS (Additional Dialog instances)
Login to each Dialog instances i.e. Application server host and then switch to <sid>adm unix account
sapcontrol -nr xx -function StopSystem ALL (This will stop PAS or Dialog instance present in the
host)
SID = XYZ
sapcontrol -nr 00 -function StopService ( This will stop sapstartsrv process.It is not
required to execute this command)
sapcontrol -nr 01 -function StopSystem ALL (This will stop ASCSxx or SCSxx instance )
sapcontrol -nr 01 -function StopService (This will stop sapstartsrv process of ASCS or SCS
Incase if the host is rebooted then issue the command to start sapstartsrv process. The command to
sapcontrol -nr xx -function StartService <SID> (where xx is the instance number and SID is the
system identification).
unix command “ps -eaf|grep sapstartsrv” . If it is not present then issue the command
If the process is present in the output of “ps -eaf|grep sapstartsrv” then no need to execute his command)
Example as follows
SID = XYZ
sapcontrol -nr 01 -function StartService XYZ (This will start sapstartsrv process of 01 instance
number if sapstartsrv process is not started as you can see the output of “ps -eaf | grep sapstartsrv”)
sapcontrol -nr 00 -function StartService XYZ (This will start sapstartsrv process of 01 instance
number if sapstartsrv process is not started as you can see the output of “ps -eaf | grep sapstartsrv”)
sapcontrol -nr 00 -function StartSystem ALL (This will start D00 instance)
Written by
A Prasad Rao
———————————————————-End———————————————————————