Page moved!
This page is outdated and it's content has been moved into the new structure under SAP HANA Managed System Setup in SAP Solution Manager.
This page will not be updated with findings or corrections.
Prerequisites
Before settings up System Monitoring for SAP HANA, please make sure the necessary notes are implemented in SAP Solution Manager and the managed systems (ABAP and SAP HANA). You find all required notes here.
If you plan to connect a multi-tenants HANA DB to SAP Solution Manager, please also refer to the dedicated wiki subspace for more information.
Setup Steps on HANA DB and HANA host
Install Diagnostics Agent and SAP Host Agent on HANA hosts
The first step is to install the Diagnostics Agent and the SAP Host Agent on the HANA servers. There are two ways to do it. You can either use HANA Lifecycle Manager or do it manually. As of SAP HANA SP 08 the Diagnostics Agent will no longer be shipped with SAP HANA and cannot be installed with HLM anymore. Please perform the installation manually.
Diagnostics Agent Installation with HLM (only SAP HANA < SP08)
If you want to use HLM (SAP HANA <= SP07) you need access to the original HANA installation media.
Select "Add Solution Manager Diagnostics Agent (SMD)"
In the next step you select the host on which you want to install the agent. You have to install one agent for each HANA node. You also enter the path to the HANA installation media here.
HLM checks if the installation media is valid. Make sure you enter the top-level folder or mountpoint for the installation media (the folder that contains the DATA_UNITS sub-folder and the LABEL.ASC).
In the next step you set the system parameters. The default SID for the Diagnostics Agent is DAA, the default instance number is 98 (In this screenshot this SID/instance number is already in use, so I had to choose another one). The hostname is per default the hostname that you selected in the step before. However, which hostname you have to enter depends on several factors.
As a general rule you need one agent for the hostname the HANA instance on this host runs with. This is the hostname the HANA instance will register with in SLD/LMDB. Per default this is the hostname maintained in the field host in table sys.m_landscape_host_configuration (please refer to SAP note 1052122 for details on hostnames in the SLD).
- If HANA runs with a physical/virtual host or you plan to use agents on-the-fly (e.g. for failover or replication scenarios) you must enter the physical/virtual hostname in the hostname field
- If HANA runs with a logical host and you do not plan to use agents on-the-fly you have to enter the logical hostname
In the next step you can connect the Diagnostics Agent to an SLD. I usually go for the faster direct connect in the next step, but if you don't have access to Solution Manager the SLD connect is necessary to enable the Solution Manager administrator to pick up the agent later on. You also can do both if you want. If the agent is registered in an SLD it is also easier to move him from one Solution Manager to another, if this should ever be necessary.
In step 4 you can connect the agent directly to Solution Manager. This is the fastest way to establish the connection. The usually connection type would be "P4 Connection via SCS Message Server". This way the Solution Manager can distribute the agents autonomously between its Java server nodes. Enter the FQHN of Solution Manager. The port number should be 81XX (XX = instance number of the SCS instance). The user you use here, should be the user created for the agent administration (default SMD_AGT) in Solution Manager basic configuration (System Preparation scenario step 1). If you have a SAP router between SAP HANA and Solution Manager, you have to enter this information here.
In the Summary step you can review your entered information.
When done click "Run" to start the installation. Now you have to wait (In my case the installation took about 20 minutes).
Diagnostics Agent Installation without HLM (manually)
As of SAP HANA SP09 or higher or if you do not have access to the HANA installation media for SAP HANA SP08 or older, you have to install the agent manually. For instructions on the manual installation of the Diagnostics Agent see SAP note 1833501.
The SAP Host Agent will be installed during the installation of the Diagnostics Agent. Also the necessary trusted relationship between the SAP Host Agent and the Diagnostics Agent will be set up.
If you install the Diagnostics Agent manually you should install it with the internal HANA node hostname. If you install it with the physical hostname, you have to activate an on-the-fly agent for the internal HANA node hostname later on.
Please don't forget to patch the SAP Host Agent after the installation. The SAP Host Agent is delivered with a specific patch in the installation sources for the Diagnostics Agent. This is not necessarily the latest version. Follow SAP note 1473974 to set up the auto upgrade functionality for SAP Host Agent.
The Diagnostics Agent is updated automatically by SAP Solution Manager.
To check if the installation of the Diagnostics Agent was successful, please make sure the agent is connected to SAP Solution Manager using the Agent Administration: http(s)://<Solman-host>:<Solman-port>/smd/AgentAdmin. Make sure the agent is connected and that it's Version matches is correct (if it is incorrect it will say so).
For Solution Manager system with SP10 or higher, you can also check the SAP Host Agent in the Diagnostics Agent Admin.
Required SAP Host Agent Version
For SAP HANA monitoring the SAP Host Agent uses the binary SAPDBCTRL. To make sure this works without problems the minimal required patch level for SAP Host Agent in Patch 183. Refer to section 'Upgrading SAP Host Agent' of the 'Diagnostics Agent Maintenance Procedures' WIKI page for information about how to update the SAP Host Agents of the HANA servers.
Setup Monitoring User in HANA
To be able to access monitoring information inside HANA and to connect HANA to DBACOCKPIT in Solution Manager, we need a user in HANA.
Create a new user in HANA:
Make sure that you assign the roles MONITORING and PUBLIC to the user.
If you are running a newer HANA system with an embedded statistics server the role MONITORING will not be sufficient to run the HANA procedures that run to collect the information. The SAP Solution Manager database user needs additional rights to execute the necessary procedures in the _SYS_STATISTICS schema. See SAP note 1917938 for details.
If you want to collect the HANA metrics for SAP liveCache (metric IDs 900+) you also have to add the role DBA_COCKPIT to the user.
Use HANA Studio to log on the HANA with this user for the first time, to change the initial password to a production password.
You also should make sure that the password of this user doesn’t have to be changed anymore. This can be done using this SQL command.
ALTER USER <MONITORING USER> DISABLE PASSWORD LIFETIME
See also SAP note 1702224 for details.
It is very important that the monitoring can collect data all the time, even if the system is under high load, as the monitoring is the only way to notice such a high load situation and get alerted. To make sure that the monitoring user can collect data all the time, it is recommended to give this user a high priority. The priority for users ranges from 0 to 9 with the default value 5. You should set the priority for the monitoring user to something higher than the defaul, e.g. 8.
To do this run the SQL statement:
ALTER USER <MONITORING USER> SET PARAMETER PRIORITY = '8'
See SAP note 2222250 for details on HANA Workload Management.
Setup HDB User Store for SAP Host Agent
The next step is to make sure the SAP Host Agent can connect to HANA and can receive process information. To enable this you need to set up the HDBUSERSTORE on each HANA host.
Log on as <sid>adm to OS level and run the command:
/usr/sap/hdbclient/hdbuserstore SET <SID>SAPDBCTRL <hana-master-host>:3<Sys-No>15 MONITOR password
In newer installations you will find the hdbuserstore executable in the folder /hana/shared/<SID>/hdbclient.
If you have a multi-node HANA database, please add all possible <hana-master-nodes> separated by semicolon surounded by "".
/usr/sap/hdbclient/hdbuserstore SET <SID>SAPDBCTRL "<hana-master-host1>:3<Sys-No>15;<hana-master-host2>:3<Sys-No>15" MONITOR password123
The configuration is also described in SAP note 1625203.
To check your setup, run the command:
/usr/sap/hdbclient/hdbuserstore LIST <SID>SAPDBCTRL
The output should look like this:
You can check the WebService used by SAP Host Agent.
Run the command:
/usr/sap/hostctrl/exe/saphostctrl -function GetDatabaseStatus -dbname <SID> -dbtype hdb
Register HANA in SLD
The last step on the HANA server is to register HANA in SLD. If your HANA is running under an ABAP stack in the Business Suite you might see a HANA database in the SLD already. But be careful, this might be the HANA which is reported via the SLD data supplier in the ABAP’s RZ70. This has only very rudimentary data and is by far not enough.
There are also considerations regarding the hostname, which is reported for HANA to the SLD. Per default the internal hostname on the host currently running the indexserver in MASTER role is reported as “SystemHome”. This is OK for single-node HANA databases that are not used by an ABAP system.
If you run a multi-node (Scale-out) HANA or your HANA runs under an ABAP system, that hostname is not recommendable. This is for 2 reasons:
- If your HANA runs under an ABAP system, the ABAP system most likely knows the external HANA hostname. This doesn’t match the internal HANA hostname and hence the SystemHome of the ABAP system and its HANA DB will not match in LMDB. Since the SLD data supplier in RZ70 also reports a HANA DB you will see 2 HANA DBs in LMDB, one with the internal and one with the external hostname. This is undesirable.
- If you run a multi-node HANA DB (Scale-Out) the hostname on which the indexserver runs in MASTER role can change. A scale-out SAP HANA system can be installed with multiple hosts (multiple nodes). The indexserver can only run in MASTER role on only one of these hosts at a time. The actual master indexserver is assigned on the same host as the nameserver with the actual role MASTER. The host for the nameserver in MASTER role is designated during startup.
Now if the host with the master indexserver fails, the all services will fail over to another host in the scale-out (preferably a standby host, but will take whatever he can get). This called Host Auto-Failover (for more details please refer to SAP Help or this document in SDN). When this happens the hostname of this host is now reported for SystemHome during the next SLD data supplier run and a new SAP HANA technical system is hence created in SLD and LMDB. This would render all your setup pretty much useless. This is also undesirable.
To address this, you can set the hostname with which HANA registers to the SLD using the parameter SLDSYSTEMHOME in the SAP HANA DEFAULT.PFL.
For case 1: The recommended value is the external HANA hostname as known by the ABAP system that is using this HANA DB This parameter is the SAPDBHOST parameter in ABAP.
For case 2: If your scale-out system runs under a SAP ABAP system, please refer to case 1. If you run a Scale-out SAP HANA scenario without SAP ABAP you may set SLDSYSTEMHOME to the hostname of the host which is during the installation configured to run the MASTER indexserver. Basically the main MASTER node of the entire SAP HANA DB.
Please also refer to SAP note 1842630 - Reconciliation of HANA and ABAP/Java SLD Data Supplier for details.
Check the profile parameter SAPDBHOST in transaction RZ10 of the ABAP system:
To find out what the current host is that runs the indexserver in MASTER role you can check HANA Studio. The column "Nameserver Role (Configured)" would indicate which one of the hosts was installed first (MASTER1). However, you can basically choose the hostname of any the hosts that can become a master for the profile parameter.
To set the parameter, log on to the HANA host on OS level and adjust the DEFAULT.PFL of the HANA database. The DEFAULT.PFL for HANA is located under /usr/sap/<SID>/SYS/profile (or just use command cdpro as <sid>adm to jump there). This directory should be shared between all HANA nodes of the HANA DB system.
Add the parameter SLDSYSTEMHOME=<SAPDBHOST known in RZ10> or <MASTER hostname> to the profile.
You have to restart HANA for the parameter change to take effect.
SLD Registration using HLM (SAP HANA < SP08)
Use HANA Lifecycle Manager to register HANA in SLD:
Enter the SLD connection parameters and a user that has write authorizations in SLD.
SLD Registration using HDBLCM (SAP HANA >= SP08)
As of SAP HANA SP08 a new lifecycle management tool was shipped and it is not recommended to use HLM anymore. The tool is called HDBLCM and is an OS-level tool.
In standard installations you can find the HDBLCM in the folder: /hana/shared/<SID>/hdblcm
You have to options to open the tool. The hdblcm executable is console-based, the hdblcmgui is GUI-based. The hdblcm useful if you don't have X available to open the GUI-based version.
To start the HDBLCM please run the executable of your choice.
Select the option for the SLD registration (option 3 in the console-based tool).
Enter the SLD registration parameters and run the registration.
Run the SLD registration.
SAP HANA database Revision 110 - 122.01
Result
You can find HANA in the SLD of Solution Manager under Administration -> Content Maintenance -> HANA Database System:
Make sure that your HANA Database System has more than just 2 associations. 2 associations indicate that this HANA system was reported by the RZ70 SLD data supplier and is incomplete.
There is also a way to run the SLD registration manually. But this is not the recommended way. See the Trouble Shooting section for details.
In case the HANA database doesn't show up in the SLD as expected you should check the sldreg.log for errors. You can find it under the HANA diagnosis files.
In case you need to trigger the SLD registration to run "out of schedule", e.g. because you changed the SLD parameters or the SLDSYSTEMHOME parameter you can trigger it my toggling the parameter sld -> enable. When you set it from yes to no and them back to yes, the SLD registration will be triggered immediately.
After the SLD registration check the SLD and the sldreg.log to make sure the SLD registration was successful.
Setup in Solution Manager and on Solution Manager Host
Install client software on SAP Solution Manager
To enable SAP Solution Manager to connect to HANA via DBACOCKPIT you have to install the HANA client software and the HANA libraries on the Solution Manager host.
The procedure is described in SAP note 1597627. Please change the installation path recommended in this note to: hdbinst -a client -p /usr/sap/hdbclient -s <SID>. Otherwise you might face issues with the path later on. Set the environment variable to the path you used for the installation. Please also note that you have to restart the Solution Manager host to make the path changes required for the client installation take effect.
The libraries needed are part of the SAP kernel. As off kernel release 720 patch 400 and above all DB libraries are included in each SAPEXEDB. Make sure the library dbhdbslib.so is located in the kernel directory of Solution Manager (/usr/sap/<SID>/SYS/exe/run).
The SQL library libSQLDBCHDB.so has to be available in the HANA client directory.
Remark: In case you installed the HANA client under the path /usr/sap/<SID>/hdbclient and face problems when you try to test the DB connection from Solution Manager, please create a sym-link from /usr/sap/hdbclient to /usr/sap/<SID>/hdbclient with command:
ln -s /usr/sap/<SID>/hdbclient /usr/sap/hdbclient
Set DB parameter on Solution Manager
To avoid performance issues with the DB connection to HANA it is recommended to set the profile parameter dbs/hdb/connect_property in the SAP Solution Manager DEFAULT.PFL profile. See SAP note 1761693 for details on how to set additional HANA parameter. Set the parameter to:
dbs/hdb/connect_property: DISTRIBUTION=OFF
Further information: In the general HANA settings "Client Distribution Mode" is enabled. This can lead to performance problems in Solution Manager's DB connection to HANA. This concerns mainly scale-out (multi-node) HANA solutions. This parameter changes this behavior for DB connection from Solution Manager to HANA and disables "Client Distribution Mode" for HANA connection from Solution Manager.
Check LMDB
The next step is to make sure that HANA and the ABAP system are correctly maintained in LMDB. If you changed the SLDSYSTEMHOME for HANA to the SAPDBHOST in ABAP, the assignment between HANA and the ABAP system should happen automatically.
Even if the ABAP system already registered a HANA earlier via the RZ70 SLD data supplier, as long as HANA and the ABAP system register with the same SystemHome value, the assignment between HANA and ABAP system happen automatically. The formerly registered RZ70 HANA system will be enriched with the additional information from the HANA SLD data supplier.
Call transaction LMDB and select you HANA system:
Make sure the product version is supplied automatically.
Check the SAP HANA DATABASE software is marked as Installed on Instance. This should at least be the case for the HANA master node.
Make sure all HANA nodes are reported under Technical Instances. For our database it is just one node, for multi-node HANA databases you should see multiple lines under “SAP HANA Database Server”.
Check that the database known to your ABAP system matches the HANA DB. To do this, open the ABAP system in LMDB and check the database under System Database:
Check BW Content activation
After implementing an support package for Solution Manager you have to make sure that the BW content for the HANA reports in Root Cause Analysis is activated correctly. The easiest way to make sure of this is to rerun the activity "Activate BW content for RCA" is Solution Manager Basic Configuration.
Run Managed System Setup for HANA
The next step is to run the managed system setup for HANA. HANA has its own Technical System Type, unlike other database systems. We run the managed system setup for HANA separately to make sure that the product SAP HANA DATABASE is recognized as diagnostics relevant. As it is not explicitly installed on the ABAP system, this would be missed, if we run only the managed system setup for the ABAP system.
Before you can run the managed system setup, make sure that the Diagnostics Agents for all HANA nodes are available. HANA nodes always register with their internal HANA hostname. So if you installed the agents manually without HLM but with the external HANA hostname you might have to create agents on-the-fly for the internal HANA hostnames. Or you just install the agents with the internal HANA hostname to begin with.
More information on agents on the fly can be found here.
To start the managed system setup for HANA, call transaction SOLMAN_SETUP -> Managed System Configuration. Search for your HANA System. You’ll find it on the tab “Technical Systems”.
In the first step you have to create a product system for HANA and also assign the diagnostics relevance.
You can either use a product system that already exists for the ABAP system (if the ABAP system was already connected to Solution Manager) or create a new one. After all you should use the same product system for ABAP and HANA.
The diagnostics relevance can be set automatically. Click the respective button in the Managed System Setup.
In the next step you check the prerequisites. In step 3 you have to assign the Diagnostics Agents to each HANA node.
In step 4 you have to maintain the system parameters. You only have to set up the DB Connection in this step. Use the same user you created in HANA for monitoring earlier.
If you have any problems creating the DB connection, check if there is a DB connection in table DBCON (transaction DBCO). If yes test the connection using the report ADBC_TEST_CONNECTION. The output of this report will tell you what is wrong and also lead you to the trace file of the workprocess in which the error occurred. If the DB connection doesn't exist yet, please try to create it in DBCO and test it.
The most common reasons for failures here is a not correctly installed HANA client or missing HANA DB libraries. Please refer to the section about the HANA client installation.
Remark:
You might notice that the value for "Database Host" is an IP address. This is correct! What you see in this field depends on the value that is delivered as connect string to the SLD. The origin of this value is the value that is maintained in the HANA view SYS.M_HOST_INFORMATION for the key net_publicname.
Whether this is an IP or a FQDN depends on the parameter use_default_route int he global.ini file of the HANA DB.
But back to SOLMAN_SETUP. In the step "Enter Landscape Parameters" you have to maintain the landscape parameters.
In some cases you will see the installation path as “<Not Defined>” on Technical System Level. You can ignore this. We are currently working on providing this value automatically.
This missing path will lead to an error in the Configuration Check later on:
If you want to fix this (technically you could also ignore this specific error until we fill this value automatically), you can do so by marking the software SAP HANA PLATFORM EDIT. 1.0:HANA database as "Installed on System" in the LMDB.
After this change you will be able to fill in the installation path in the managed system setup and the errors will go away.
The next step is the Automatic Configuration. Execute all and make sure everything finishes successfully. Make sure you see the activity "Database Extractor Setup" as well as "Extractors Setup".
In the step “Configure Manually” you set up the OSS connection to be able to open HANA DB for SAP in case you need remote support.
In the last step you check the configuration and make sure everything is OK.
If you run a multi-node HANA DB you now also have to make sure, that the HANA is still reachable if the master node moves to another host. Unfortunately we cannot do this automatically yet.
To make sure the HANA DB can be monitored and reached by DBACOCKPIT no matter who the master node ist, you have to adjust the DB connection used by DBACOCKPIT. You add all possible HANA master noder servers to the DB connection string.
Call transaction DBCO and open the DB connection for the HANA DB in change mode. Add the server names for all possible master nodes and ports separated by semicolon in the form:
<server1>:3<SysNo>15;<server2>:3<SysNo>15;<server3>:3<SysNo>15
You can test your DB connection using the report ADBC_TEST_CONNECTION.
The concept is also described in SAP note 1983628.
Run Managed System Setup for ABAP System
Run the managed system setup for the ABAP system as usual. You will see that some activities are already done by the SAP HANA Managed System Setup. You don’t need to redo those steps.
Troubleshooting
If you have problem with the managed system setup please refer to the Troubleshooting section of this wiki.
1 Comment
Daniel basis
Hi Andrea,
Good Blog..Please clarify the below queries.
3) I see the /usr/sap/SID/hdbclient in both the app server and HANA db server.?
Are they both same?
Thanks in advance