How to Stop and Start on SAP HANA DB

How to Stop and Start SAP HANA DB

I will explain how to stop and start SAP HANA DB.

Starting and stopping HANA DB is the same as other databases. The difference is that the HANA DB is divided into a single node and a multi-node distributed system.

 

  1. How to Stop in Single Node

At OS-level, Command as <SID> adm user.

>HDB stop

Or Single Node, you can stop it with sapcontrol command as below.

>sapcontrol -nr <InstNo> -function Stop

Execute the command to check whether the process is stopped normally.

>sapcontrol -nr <InstNo> -function GetSystemInstanceList

It can be confirmed that GRAY has stopped normally.

  1. How to Start a Single Node

At OS-level, Command as <SID> adm user. It is only Sart on Local Node.

>HDB start

Alternatively, you can use the sapcontrol command.

>sapcontrol -nr <InstNo> -function Start

Execute the command to check if the process is normally started.

>sapcontrol -nr <InstNo> -function GetSystemInstanceList

It can be confirmed that GREEN has started normally.

  1. Check the process of HANA DB.

>HDB info

>HDB proc

  1. If you have multiple HANA nodes, use the following command on the corresponding Multi-Node.This case corresponds to the Distributed system. It is a command to stop / start / status all the HANA DB processes in several nodes at once.

Log in as the root user.

 Action Command
Start the HANA system /usr/sap/hostctrl/exe/sapcontrol -nr <instance_number> -function StartSystem
Stop the HANA system /usr/sap/hostctrl/exe/sapcontrol -nr <instance_number> -function StopSystem
Query current host status /usr/sap/hostctrl/exe/sapcontrol -nr <instance_number> -function GetSystemInstanceList

 

  1. Execute the command to stop SAP HANA DB.

Command as root user at OS-level.

>sapcontrol -nr <InstNo> -function StopSystem

Execute the command to check whether the process is stopped normally.

>sapcontrol -nr <InstNo> -function GetSystemInstanceList

It can be confirmed that GRAY has stopped normally.

  1. Execute the command to start SAP HANA DB.

Command as root user at OS-level.

>sapcontrol -nr <InstNo> -function StartSystem

  1. Execute the command to check if the HANA DB process is running normally.

Command as root user at OS-level

>sapcontrol -nr <InstNo> -function GetSystemInstanceList

  1. I will explain how to connect to HANA Studio first and explain how to stop and start using HANA Studio.

When you install HANA Studio, click HANA Studio on the desktop of Widows 7.

Or Click Start -> All Programs -> SAP HANA -> SAP HANA Studio.

9.On the SAP HANA Administration Console screen, click Open Administration console.10.Select System and click Add System.11.Enter the IP address in Host Name, and enter 00 in Instance Number.12.In Authentication by database user (Authentication as DB user), enter User Name: SYSTEM, Password.13.Click Finish to complete the HANA Studio connection setup.14.This is the screen to access HANA DB normally.

15.Now let’s explain how to stop DB using HANA Studio.

When stopping through HANA Studio, when it is Single Node or one HANA Database is stopped. And even in case of Multi-node, all HANA DB will be stopped (all HANA databases will be stopped).

Select “System”, right-click, and select “Configuration and Monitoring” -> “Stop System”.

If so, enter <SID> adm / Pasword in the Operating System (OS).

  1. The way to start DB using HANA Studio is the same as the stop method above.

When Multi-Node is started, HANA Studio Start of all HANA DB starts.

Select System and click the right mouse button. Then click “Configuration and Monitoring” -> “Start System”.

At this time, enter <SID> adm / Pasword of OS (Operating System).

  1. How to kill a process with hdbrsutil Tool

After shutdown hdbrsutil process will be running to keep row tables in memory. This allows for a faster HANA startup.

If you wish to stop these processes (for example to reboot the host server), run the following command

>hdbrsutil -f -k -p <port number (e.g. 3xx03)>

You can find the port number from the command “HDB proc”