SAP shutdown sequence, Stopping SAP instance and shutdown
command stopsap, stopsap R3...
SAP Shutdown Sequence
Here are some of the Conditions/situations where we have to stop an SAP System ------------------------------------------------------------------------------------------- SAP system may need to be stopped due to maintenance purposes which include below activities: Activating the changed profile parameters in RZ10 Taking an offline database backup Upgrading the SAP kernel Upgrading the SAP instance Restarting due to system performance issues Follow the below Sequence to Stop an SAP system Stop all Dialog Instances one by one (there is no sequence to be followed here) Stop the Central Instance Stop the Database Instance
-------------------------------------------------------------- Steps for Stopping the SAP Instance -------------------------------------------------------------- Shutting down or stopping an SAP instance is the reversal of the startup Process; stop the SAP instance, stop the Oracle Listener,
1. Log on to the appropriate server as user "<SID>adm" and type the following command: "stopsap" 2. In some cases, you might have the requirement only to stop SAP and not the Database, and then use command: "stopsap r3" (Ex: In case of system Export procedure, you should shutdown SAP only but DATABASE must be up and running). 3. Now you can stop Oracle listener, Log on to the same server as "ora<SID>" and type in the following command: "lsnrctl stop" 4. Log on to the same server as user "root" and type in the following: "cd /usr/sap/<SID>/SYS/exe/run" and execute the command as given to stop the SAP OS collector ./saposcol k Note If SAPOSCOL is not present in the above path then download latest and paste here. 5. Finally, Log off the server or shutdown the server.
SAP startup sequence, Starting SAP instance and startup command startsap, startsap DB
Sequence of Startup
As the SAP System comprises of Database Instance, Central Services and other multiple Dialog Instances. It is very important to know the sequence of startup, where incorrect sequence of startup may lead to inconsistency.
To startup the SAP Application Server, you should login to SAP with the OS user "<SID>adm" In UNIX, LINUX OS platforms this "<SID>adm" OS user belongs to the group called sapsys. In windows platforms this Os level user belongs to the Group called and Group "<SID>adm" SAP_<SID>_GlobalAdminAdministrators. As you might know that the underlying element of the SAP system is the database instance. Therefore DATABASE has to be started first Central Service Instance (CI) will be started next, including the startup of Enqueue and the Message service. An independent program called SAP OS Collector (saposcol) which collects statistical data from the operating system such as CPU and Memory usage parameters is started along with the remaining ABAP work processes in the Central Instance. The dispatcher work process is started next. And finally, the individual dialog instances can be started.
Starting the SAP Instance:
SAP instance start up Process will vary between Window, Linux, and UNIX platforms and will consists of three phases: Starting the database (if Oracle start Listener manually) Starting SAP instance Starting OS collector (will automatically start with startsap script)
------------------------------------------------------------------- Starting SAP instance (Linux, UNIX flavors): ------------------------------------------------------------------- Logon to SAP OS level with user <SID>adm and execute the script startsap, then immediately startsap script will check for DB connection using R3trans executable. If DB is available then script starts the SAP instance and SAP OS collector as well. If DB is not available, then startsap script first starts the underlying database using startdb script and later triggers SAP instance.
In all the SAP Instances with Oracle as Database, a communication channel is established in between SAP and DB with the help of Oracle listener, this normally runs of port 1527. So before starting DB of SAP you need to make sure that oracle listener is up and running. To do so logon at Os level with user ora<SID> and execute command: lsnrctl status. If not running, then logon to SAP OS level as user ora<SID> and start the Oracle Listener using command lsnrctl start.
Later logon to OS level <SID>adm and run the SAP startup script startsap as mentioned earlier. startsap script takes care of the SAP OS Collector. If anything goes wrong, then check the logs in work directory /usr/sap/<SID>/ DVEBMGS00/work or check startup logs in /home/<SID>adm.
Follow below steps to start SAP: 1. Verify that the SAP instance is down. 2. Log on to the SAP server as user ora<SID> and type in the following: lsnrctl start 3. Log on to the same server as user <SID>adm and type in the following: startsap 4. In some cases, you might have the requirement only to start the database and not the SAP instance, and then use command: startsap DB Wait until you see the SAP instance startup messages. There may be other minor programs that start at the time as well. If you try to logon and are refused connection, check the logs in the /home/<SID>adm for applicable errors.
Verifying that the SAP Instance is up: ---------------------------------------- One of easiest way to check whether the SAP instance has started successfully is to log on to the instance. Use command dpmon to check the status of SAP work process using command: dpmon Or sometimes might need to use command followed by path to SAP profiles as below dpmon pf=/usr/sap/<SID>/SYS/profile/<SID>_DVEBMGS00_MYHOST If it has not started successful, look at the logs in the /home/<SID>adm directory. Sort them using command ls ltr is see the list sorted in descending order. If nothing is found, as said earlier go to the /usr/sap/<SID>/DVEBMGS00/work directory and check the last modified logs in this directory. The most useful information can be found in the dev_wx, dev_ms, dev_disp, dev_rfcx, and stderrx files. If you need further assistance, please refer to the section SAP System Startup Troubleshooting.