In the upcoming weeks, I will discuss the topics covered in the SAP Certified Technology Associate – SAP HANA certification exam.
This blog is part of a series about all the topics areas:
- Operations of SAP HANA, part 1 (Admin Tools)
- Operations of SAP HANA, part 2 (this blog)
- Monitoring of SAP HANA
- System Architecture
- Users and Authorization
- Backup & Recovery
- Troubleshooting of SAP HANA
- SAP HANA Installation & Upgrade
- Database Migration of SAP HANA
- High Availability & Disaster Tolerance
Operations of SAP HANA, part 2
In this blog, I will discuss starting and stopping SAP HANA, configuration, and table administration. These topics are covered in the HA200 training, Unit 7: Operations and Troubleshooting.
The other exam topics from this unit, Monitoring SAP HANA and Troubleshooting SAP HANA will be covered in the next blog.
Starting and Stopping SAP HANA (lesson 1)
You can start and stop a SAP HANA system on the command line or by using a client tool: SAP HANA studio. In SAP HANA 2.0, the new SAP HANA cockpit can be used as well, of course, for this purpose but cockpit 2.0 is out of scope for this version of the exam.
On the command line, you can use the “HDB start” and “HDB stop” commands.
You run this command as the operating system administration account user, <SID>adm, where the SID is the SAP HANA system identifier, for example HXE (hxeadm). This Linux account is created when HANA is installed and the password is defined during setup.
HDB is not a program but a script.
This HDB (uppercase) script takes several parameters, like start | stop | restart. If you just type ‘HDB’, the script will list the available parameters:
It is not part of the exam, but you can view the contents of the HDB script file with an editor to see what happens behind the scenes.
When you execute ‘HDB start’, for example, the script runs the ‘sapcontrol‘ program for you with a number of flags, for example the instance number (-nr) and the command (-function StartWait).
This is exactly the same what is executed when you start SAP HANA using SAP HANA studio. Now, studio will trigger sapcontrol to be started, only this time you can specify the StartWait Timeout setting yourself. For this reason, you will be prompted to provide the operating system administration account credentials (<SID>adm) needed to run this command.
With SAP HANA, the startup timeout does not apply to a single host system landscape (one computer with HANA) but is relevant only for distributed systems (computer cluster / multiple hosts running a single HANA system).
The reason why you see sapcontrol running with this flag is that sapcontrol is not a HANA-specific program. SAP Basis administrators will already be very familiar with it, as it is part of every SAP system: Business Suite, Business Warehouse, etc.
When you install SAP HANA, the SAP host agent is installed as well. The host agent package includes the sapcontrol program, amongst others. As you can install multiple SAP HANA systems on a single computer and only need one host agent, it is installed under its own account: sapadm.
You can run the sapcontrol program directly using the root account, as well. Required parameters are the instance number and the command. If no startup or shutdown timeout is specified the default value is used.
sapcontrol -nr 00 -function Start sapcontrol -nr 00 -function Stop sapcontrol -nr 00 -function GetProcessList
The GetProcessList flag does the equivalent of HDB stop.
When you stop the system instance(s), apart from a stopwait timeout, you can also specify the shutdown type:
- Soft with date/time value
Hard is the equivalent of the Oracle database SHUTDOWN ABORT command. All processes are closed. Any ongoing transactions are lost.
With a soft shutdown, a savepoint operation is first performed, writing all modified data to disk. This will considerably speed up the startup process.
Apart from starting and stop the entire SAP HANA system, you can also start and stop services.
We have already encountered the bootstrap process, sapstartsrv, started by sapcontrol, but there is also a nameserver service (topology), an indexserver service (SQL), a webdispatcher service (HTTP), and a few more.
The watchdog service is called the daemon (UNIX terminology). This service monitors the entire system and automatically starts any service that is stopped. If the daemon service cannot start a service you can try to do so yourself manually but it is likely that you first need to fix the issue that causes the service not start in the first place. For example, the disk where the process trace file is stored is full.
Other services are optional. For example, there is the preprocessor service used by Text Analysis and the scriptserver service used by the Predictive Analysis Library (PAL). To use these services, you will need to enable them first (to register with the nameserver service) and subsequently start the service.
Services are started using SQL and require the SERVICE ADMIN system privilege.
To (re-)start a service, use the following SQL command specifying service name and options:
ALTER SYSTEM RECONFIGURE SERVICE ('indexserver','',0)
To stop a service, you only need to provide the host on which the service is running together with. the port:
ALTER SYSTEM STOP SERVICE <host_port> [IMMEDIATE [WITH COREFILE]]
You can use the Administration Console, Landcape tab of the SAP HANA studio, or use a SQL prompt to start/stop services.
Some points to note:
- You cannot use the HDB command line script to start and stop a distributed system. For this, you will need to run the sapcontrol command on the master node.
- To start and stop a SAP HANA system using HANA studio, you need to provide operating system account credentials (<SID>adm>). You cannot use the database superuser account SYSTEM as the database is not up.
- You cannot start services using sapcontrol. This command only starts the sapstartsrv process, which then starts the other HANA services. For service management, SQL is used so the database needs to be up.
All you need to know about starting and stopping is covered in the following video tutorial:
Also review the restart sequence, in the SAP HANA Administration Guide:
Configuring SAP HANA (lesson 2)
You configure a SAP HANA system using system parameters. These parameters are stored on the file system in files with the INI extension, so often you come across the term INI parameters as well.
There is a location for INI files with the default values, overwritten with each update, and there is another location for configured (customised) parameters.
There are parameter files for each service (nameserver, indexserver, daemon, etc.), but also files for features/options, like multidb.ini to configure the multitenant database container (MDC) system, or esserver.ini to configure Dynamic Tiering.
You can query them all with the M_INIFILES system view.
Each parameter file is divided into sections. Each parameter file also has its scope: default, system, database, and host. Parameters with a system scope are valid for the entire SAP HANA system. Parameters with host scope, only for a certain host; this implies a distributed system, otherwise the system only runs on a single host. The database scope implies the system runs in MDC mode.
Although the parameters persist in files, changes are made using SQL, not a file editor. To change system parameters, you need the INIFILE ADMIN privilege. You can use a SQL prompt and the ALTER SYSTEM ALTER CONFIGURATION statement.
Alternatively, you can use SAP HANA studio, SAP HANA cockpit, and even DBA cockpit) to perform the same task. These tools will generate the SQL for you
Configuring system properties is discussed in the following video tutorial:
Although not required for the exam, you might find the following SAP note interesting:
- SAP Note 2036111 – Configuration parameters for the SAP HANA system with attachment Frequently_Used_Config_Parameters_in_SAP_HANA_1_2.pdf
SAP HANA Table Administration (lesson 3)
Table management is documented in the SAP HANA Administration Guide. For the exam, you need to know the difference between columnar and row-based data storage and when to use either one.
You should also be familiar with the memory management operations in the column store, with the delta and main storage, and how this works …
… with the different merge types.
… the commands to check the consistency of tables:
CALL CHECK_TABLE_CONSISTENCY ('CHECK', NULL, NULL).
… and how you can use SAP HANA studio to query the catalog and get information about the memory consumption of columnar tables from the table definition, runtime information tab.
Fortunately, all of this is very well documented in the SAP HANA Administration Guide, Managing Tables chapter and I highly recommend getting familiar with its content.
To be continued
In next blog, we will discuss the topic from Unit 7, Operations and Troubleshooting: Monitoring of SAP HANA.
Thank you for watching
The SAP HANA Academy provides free online video tutorials for the developers, consultants, partners and customers of SAP HANA.
Topics range from practical how-to instructions on administration, data loading and modeling, and integration with other SAP solutions, to more conceptual projects to help build out new solutions using mobile applications or predictive analysis.
For the full library, see SAP HANA Academy Library – by the SAP HANA Academy
For the full list of blogs, see Blog Posts – by the SAP HANA Academy