Learning: Administering using SAP HANA Cockpit
Tags: sap, certification
Published: 2024-04-26 10:26:34

Learning notes from the learning journey: Installing and Administering SAP HANA to take the Certification "SAP Certified Associate - Database Administrator - SAP HANA".

- Starting and Stopping SAP HANA:

 To start or stop the SAP HANA Database it is possible to split the whole system, stop tenant(s), single instance, or Services. 
 In the first case, you can use the Cockpit (<sid>adm, Cockpit User, Database User) and sapcontrol (root, <sid>adm). 
 In the second case, Cockpit or SQL console or hdbsql (<sid>adm, Database user). 
 The third case, HDB (<sid>adm) and SAPControl. 
 And finally, the services, Cockpit and SQL console or hdbsql. 

<u> The SAPControl, you must log on to the SAP System host as a user or as root permissions.</u> Avoid using the SYSTEM user for day-to-day activities. 

 It's important to highlight when working with Individual Tenants, the cockpit supports their start/stop, but the studio does not support it.

When dealing with SAP HANA Database Services, it's possible to stop: Name Server, Preprocessor, Web dispatcher, Compile Server, Index Server, XS Engine. In all the cases, either database services or services of a tenant database are necessary <u>SYSTEM PRIVILEGES. </u>

- Changing Database Configuration Parameters:

Display and change parameters are used Database Configuration App in Cockpit. To make changes, is necessary to have System Privileges. 

There is a hierarchy of parameter values, which SAP stores in configuration files on the op. System Level: 
 1) DEFAULT 
 2) SYSTEM 
 3) DATABASE 
 4) HOST 

- Describing Further Configuration Functions:

RESTRICTED FEATURES: Some features are not required in environments. It's possible to desirable them if you have system privileges, INIFILE ADMIN. 

BLOCKLISTED PARAMETERS: Avoid tenant database administrators to change system properties. Also, need the system privileges INIFILE ADMIN. The changes can be done in the multidb.ini, once you have the System Privilege. 

PARAMETERS: once a few parameters, the system might need to restart and some other analysis. To access this, there are two views in SAP database system:
 1) CONFIGURATION_PARAMETER_PROPERTIES: metadata and properties of public config. 
 2) M_CONFIGURATION_PARAMETER_VALUES: landscape service values.

- Describing the Concept of Delta Merge:

DELTA MERGE PROCESS: It's an operation to move changes collected in the delta storage to the read-optimized main storage (In-Memory). This optimizes compression and write performance. 

 The process consists of three stages:
 1) Before the write operations are done in Delta 1 and read on Main 1 and Delta 1. 
 2) During merge: The Main 1 and Delta 1 are combined in Main 2, meanwhile the write operation happens in Delta 2. The reading is done in all Tables beside Main 2. 
 3) After merge: The Main 1 and Delta 1 are deleted. Main 2 is compressed to the memory and Delta 2 takes the place of Delta 1. 

PERFORM DELTA MERGE OP: Cockpit -> Current Table Distribution app. -> View Current Table Distribution -> Table Distribution card

DELTA MERGE EXPENSES: Creates disk input/output load, main storage is in-memory. 

MERGE MOTIVATIONS FROM DELTA STORAGE TO MAIN STORAGE: 
 1) Automatic System Process:
  a) Auto: mergedog system process is on (AUTO_MERGE_ON). 
  b) Critical Merge: The system initiates a critical merge automatically when a certain threshold is passed. 
 2) User/App task:
  a) Hard/Forced: This can be triggered by SQL when the system is heavy and small tables need to be loaded. 
  b) Smart Merge: Merge is considered only if the criteria are met.

DELTA MERGE FEATURES: They are executed on table level.The operation is decoupled from the execution of the transaction that performs the changes, it happens asynchronously at a later point in time. 

- Working with TRACES: 

Cockpit -> View Trace and diagnostic files // Database Explore -> SYSTEM 
To configure traces must have system privileges. For kernel profiles, and must have SAP_INTERNAL_HANA_SUPPORT standard role.

TYPES OF TRACES:
 1) Database traces: they are always active (the only active by default). Tenant Database inherits the database trace level configured in the system database (default). 
 2) User-specific and End-to-end database
 3) SQL Trace: Collected all the SQL Statements executed on the <u>index server</u> or <u>name server</u>.
 4) Performance trace: Record performance indicator for individual query processing steps in the database kernel. 
 5) Expensive Statement trace: SQL statements whose execution time exceeds a configured threshold. 
 Access: Cockpit -> Trace Config. -> Expensive Statements Trace -> Database Explore -> <u>M_EXPENSIVE_STATEMENTS (view)</u>
 6) Kernel Profiler
 7) Plan Trace: collect SQL queries and execution plans in a time frame. It's checked in the SELECT statement with Plan Trace. 

SQL TRACE ANALYZER: This is a Python tool used to analyze the SQL trace output from SAP.

MANAGE FULL SYSTEM INFORMATION DUMPS APP: collects all the import diagnosis information in ZIP file (support trace analysis).