Start and stop a SAP HANA and SAP environment with sapcontrol
Ordered start and stop of a HANA database, SAP systems (sapcontrol) and an NFS server on Linux.
Procedure to start and stop, in order, a SAP test environment on Linux: one SAP HANA database and two SAP systems, each with two instances (numbers 00 and 10). Adapt the <sid>adm user names to your own SIDs.
Important: the server exporting NFS must be up before any other, because the other SAP servers mount their file systems from it.
Start-up
- Power on the NFS server first, then the other servers of the environment.
- On the database server, start SAP HANA:
su - hdbadm -c "HDB start"
Wait 5 to 10 minutes for the database to start and load into memory. Watch memory with:
free -m
- Start the instances of the first SAP system:
su - sid1adm
sapcontrol -nr 00 -function StartSystem ALL
sapcontrol -nr 10 -function StartSystem ALL
exit
- Check the application status:
su - sid1adm
sapcontrol -nr 00 -function GetProcessList
sapcontrol -nr 10 -function GetProcessList
sapcontrol -nr 00 -function GetSystemInstanceList
exit
- Repeat steps 3 and 4 for the second SAP system (user
sid2adm).
Shutdown
Shutdown is done in reverse order: applications, database, then servers.
- Stop the instances of each SAP system (instance 10, then instance 00):
su - sid1adm
sapcontrol -nr 10 -function StopSystem ALL
sapcontrol -nr 00 -function StopSystem ALL
exit
Do the same with sid2adm.
- Stop the SAP HANA database:
su - hdbadm -c "HDB stop"
- Power off each server, the NFS server last:
shutdown -h now
Notes
sapcontrol -nr <NN>targets the instance numbered<NN>;StartSystem ALLandStopSystem ALLact on all instances of the system.- Server names and SIDs from the original note were replaced by generic values.