SAP HANA can be started / stopped by using SAP HANA Studio / OS Command prompt.
To Start/ stop HANA DB we should have credentials for <SID>ADM which is created during the installation.
In other way , we can start the HANA DB with Root user ( HANA is available only on RHLX and SUSE LX ). This is possible only with OS command prompt.
When you execute the start command, the standard sapstartsrv service will start all the mandatory HANA services 1) Index service 2) Name service 3) statistic service.
When HANA started the below activities will happen in sequence
- DB will receive the last committed transaction
- All the committed transactions which were not written to DATA volume area are re applied
- all uncommitted transactions will be rolled back
- All row Tables will be loaded to In-memory, except, those tables which are configured to load on demand or which are not marked for pre-load.
- Save point will be performed with consistent status
- Column tables are loaded asynchronously
HANA DB can be stopped in 3 ways
- Hard stop – will stop all DB services on all instances immediately
- Soft stop – Will initiate a Save point before stopping the services , a time out can be given after which Hard shutdown can be invoked
- Stop wait timeout – This value waits for the time mentioned before stopping the services after which the services will be stopped.
This start / stop can be done either from HANA studio / with OS commands
At OS level , we have two ways to start / stop
- Hostcontrol
- HDB
usr/sap/hostcontrol/exe/sapcontrol -nr <Instance number> – function start/stop ( Also with root / sidadm )
usr/sap/SID/<Instance>/HDB start/stop ( only with SIDADM)
To start / stop in HANA studio , need to provide SIDADM credientials where as at OS level this can be done even with root id access.
Point to note is , when system is start/stop / restart and when no SQL connection is available, HANA studio will open in diagnosis mode.
To display process list, either you can give command getprocesslist from hostcontrol path with root or hdb info from HDB path.
Incase of distributed system ( scale out), we can stop the system from hostcontrol path with either SIDADM or root access. Please note the start /stop from HDB command prompt is local hence can not be used to start/stop a scale out environment.