Monitoring SAP HANA
With Instana, you can comprehensively monitor your SAP HANA database to gain real-time visibility into its performance.
To get started, install and configure the Instana agent. The agent automatically deploys and installs the SAP HANA sensor. Configure the SAP HANA sensor to view SAP HANA metrics in the Instana UI. Instana supports both local and remote monitoring of the SAP HANA database.
Supported information
The SAP HANA sensor supports the following operating systems (OS) and runtimes:
Supported OS
Depending on the type of monitoring required, the Instana agent can be installed on different OS for monitoring SAP HANA databases.
-
Local monitoring (Instana agent is installed on the same host as the SAP HANA database):
- Linux (x86 and IBM PowerPC 64-bit LE)
-
Remote monitoring (Instana agent is installed on a different host and connects remotely to the SAP HANA database):
- AIX
- Linux (x86 and IBM PowerPC 64-bit LE)
- Windows
- IBM i (OS/400 PASE)
- Apple macOS (64 bit - Intel and Apple silicon)
Supported runtime
You can monitor the SAP HANA database only if the Instana agent uses Java 8 runtime.
Supported Java 8 JDKs by platform
The following Java 8 JDKs are supported for SAP HANA monitoring, depending on the operating system:
- Azul Zulu JDK 8 (1.8)
- IBM Semeru Runtime™ JDK/J9 8
- Oracle JDK 8
- OpenJDK 8
- AdoptOpenJDK 8 (Eclipse Temurin)
- Amazon Corretto JDK 8
- Azul Zulu JDK 8 (1.8)
- IBM Semeru Runtime™ JDK/J9 8
- Oracle JDK 8
- OpenJDK 8
- AdoptOpenJDK 8 (Eclipse Temurin)
- IBM JDK 8 (included with IBM i)
Configuring the Instana agent
To monitor SAP HANA, you need to configure the static or dynamic agent that is used.
Configuring the static agent
When you use the static agent, you need to provide the com.sap.cloud.db.jdbc:ngdbc driver manually.
To monitor the SAP HANA database with the static agent, complete the following steps:
-
Download the
ngdbc-2.22.12.jardriver from the Maven Central Repository. -
Add the
ngdbc-2.22.12.jardriver to the<agent-installation-dir>/system/com/sap/cloud/db/jdbc/ngdbc/2.22.12directory. -
To configure the agent to use the Java 8 runtime, complete the following steps:
Note: You need to perform the following steps only for Instana release 282 and later or if the agent was set up earlier by using Eclipse OpenJ9 11.-
Go to the
<agent-installation-dir>/bindirectory, and open thesetenvfile. -
Add the line
export JAVA_HOME=<path-to-java-home>afterUNSET JAVA_HOMEas shown in the following example:unset JAVA_HOME export JAVA_HOME=<path-to-java-home> -
Save the changes and close the file.
-
Restart the Instana agent.
-
Configuring the dynamic agent
To configure the agent to use the Java 8 runtime, complete the following steps:
-
Go to the
<agent-installation-dir>/bindirectory, and open thesetenvfile. -
Add the line
export JAVA_HOME=<path-to-java-home>afterUNSET JAVA_HOMEas shown in the following example:unset JAVA_HOME export JAVA_HOME=<path-to-java-home> -
Save the changes and close the file.
-
Restart the Instana agent to apply the changes.
For more information about agent installation prerequisites and supported JDKs, see Installing host agents.
Configuring the SAP HANA sensor
With the SAP HANA sensor, you can monitor the SAP HANA database both locally and remotely. Local monitoring of SAP HANA involves setting up the Instana agent on the same host as your SAP HANA process, while remote monitoring involves setting up the agent on a separate host.
Local monitoring
In local monitoring, the sensor collects both host metrics and HANA database metrics, offering a comprehensive full-stack view of the data.
Depending on the mode in which SAP HANA is run (multiple containers or single container), you can set different username and password combinations in the agent configuration yaml file *instanaAgentDir*/etc/instana/configuration.yaml to connect to the database.
The configuration parameters for local monitoring are shown in the following example:
# SAP HANA
com.instana.plugin.saphana:
local:
singleContainer:
user: ''
password: ''
multiContainer:
my-test-db1:
user: ''
password: ''
my-test-db2:
user: ''
password: ''
The default user is SYSTEM.
Optional configuration parameters
You can optionally specify the instanceNumber parameter to help the sensor establish a connection to a specific SAP HANA instance. This parameter is useful in environments with multiple SAP HANA instances or when you want to ensure that the sensor connects to a specific instance.
# SAP HANA with instance number
com.instana.plugin.saphana:
local:
multiContainer:
my-test-db1:
user: ''
password: ''
instanceNumber: '00'
Remote monitoring
In remote monitoring, the Instana SAP HANA sensor monitors SAP HANA databases that are deployed on different hosts than the one hosting the Instana agent. The SAP HANA sensor can monitor more than one database.
The configuration parameters for remote monitoring are shown in the following example:
# SAP HANA
com.instana.plugin.saphana:
remote: # multiple remote configurations are supported
- host: 'remote.host-1.com'
port: '' #sql port
databaseName: ''
user: ''
password: ''
- host: 'remote.host-2.com'
port: '' #sql port
databaseName: ''
user: ''
password: ''
Using non-SYSTEM user
If you cannot use the SYSTEM user for local or remote monitoring, you can create a dedicated monitoring user with the required privileges.
Creating a monitoring user
To create a new monitoring user (for example, instana_monitoring), log in as the SYSTEM user of your database and execute the following queries:
CREATE USER instana_monitoring PASSWORD Instana123 NO FORCE_FIRST_PASSWORD_CHANGE;
GRANT CATALOG READ TO instana_monitoring;
GRANT SELECT ON SCHEMA _SYS_REPO TO instana_monitoring WITH GRANT OPTION;
GRANT SELECT ON _SYS_STATISTICS.STATISTICS_CURRENT_ALERTS TO instana_monitoring;
NO FORCE_FIRST_PASSWORD_CHANGE option, you must log in manually to the new user and complete the password change prompt before attempting to connect the database by using the Instana agent. Required privileges
Make sure that the monitoring user has the following privileges:
CATALOG READSELECT ON SCHEMA _SYS_REPO(For more information about the _SYS_REPO schema, see SAP HANA Repository).SELECT ON _SYS_STATISTICS.STATISTICS_CURRENT_ALERTS
SSL Support
For the Instana agent to securely connect to your HANA Database by using the Secure Sockets Layer (SSL) protocol, add the following configuration to the agent configuration file <agent_install_dir>/etc/instana/configuration.yaml:
Local monitoring
For local monitoring, add the following configuration:
com.instana.plugin.saphana:
local:
multiContainer:
<DB Name>:
user: ''
password: ''
trustStore: '<path to your truststore file location'
trustStorePassword: '<Your truststore password>'
Remote monitoring
For remote monitoring, add the following configuration:
com.instana.plugin.saphana:
remote:
- host: 'remote.host-1.com'
port: '' #sql port
databaseName: ''
user: ''
password: ''
trustStore: '<path to your truststore file location'
trustStorePassword: '<Your truststore password>'
hostNameInCertificate property to specify the host name to be used in the certificate. This setting makes sure that the host name that is used by the Instana agent matches the host name that is specified in the certificate. This setting is relevant in local monitoring environments where the Instana agent uses the loop back address 127.0.0.1 while the certificate uses a fully qualified host name.Viewing metrics
To view the metrics, select Infrastructure from the navigation menu in the Instana UI, click a specific monitored host, and then you can see a host dashboard with all the collected metrics and monitored processes.
Tracked configuration
The SAP HANA sensor collects the following configuration data:
- Host
- Host Status
- Up Time
- System ID
- Database Name
- Instance Number
- Version
- Database Installed On
- Port
- Usage
- Service Status
- Maximum Number of Sessions
Metrics
The following table outlines the frequency of metric collection by the SAP HANA sensor:
| Metric | Collection frequency |
|---|---|
| Total CPU Utilization | 5 seconds |
| CPU Time | 5 seconds |
| Workload | 5 seconds |
| Workload Rate (per min) | 5 seconds |
| Requests | 5 seconds |
| HANA Memory Usage | 5 seconds |
| Host Memory Usage | 5 seconds |
| Heap Memory Usage | 5 seconds |
| Virtual Memory | 5 seconds |
| Swap Memory Usage | 5 seconds |
| Disk Usage Summary | 5 seconds |
| Disk Usage Percentage | 5 seconds |
| Disk Usage by Type | 5 seconds |
| Sessions | 5 seconds |
| Network Usage | 5 seconds |
| Connections | 5 seconds |
| Connected Users and Applications | 5 seconds |
| Threads | 5 seconds |
| Job Worker Threads | 5 seconds |
| SQL Executor Threads | 5 seconds |
| Column Store | 5 seconds |
| SQL Plan Cache Statistics | 20 seconds |
| Service Details | 1 minute |
| Garbage Collection Statistics | 1 minute |
| Expensive Statements | 1 minute |
| Alerts | 1 minute |
| Service Network I/O Statistics | 1 minute |
| System Events | 1 minute |
| Active Statements | 2 minutes |
| Transaction Statistics | 2 minutes |
| Aggregated Cache Information | 2 minutes |
| Blocked Transactions | 2 minutes |
| Row Store Memory | 2 minutes |
| Shared Memory | 2 minutes |
| Scheduled Jobs | 15 minutes |
| Lock Wait Statistics | 15 minutes |
| Job Progress | 15 minutes |
| Disk Usage by Device Type | 15 minutes |
| Latest Backup | 30 minutes |
| All Backups | 1 hour |
| Table Size | 24 hours |
| I/O Statistics | 1 hour |
| Table Size | 24 hours |
The SAP HANA sensor generates built-in events for various scenarios. For more information, see Built-in Events Reference.
Customizable Properties
All Backups
By default, the All Backups table on the SAP HANA dashboard displays backups from the last 1 hour. To customize this time window, set the backupWindow property to the required time window. For example, to fetch all backups that occurred in the last 24 hours instead of the default 1 hour, use the following property in your configuration.yaml file:
backupWindow: '24'
SQL Plan Cache Statistics
SQL Plan Cache Statistics metrics are not collected by default and need to be explicitly enabled. To enable these metrics, add the following property in your configuration.yaml file:
plan_cache_statistics_enabled: true
Expensive statement trace
You can enable and activate the expensive statements trace in the SAP HANA cockpit or the SAP HANA database explorer. Alternatively, you can modify the parameters in the expensive_statement section of the global.ini configuration file.
To configure expensive statement trace using SQL commands, see the following sections. Log in as the SYSTEM user of your database before executing these commands.
Enabling expensive statement trace for a user
To enable expensive statement trace for a specific user, log in as the SYSTEM user of your database and execute the following SQL command:
ALTER SYSTEM ALTER CONFIGURATION ('global.ini', 'SYSTEM')
SET ('expensive_statement', 'enable') = 'true',
('expensive_statement', 'user') = '<username>'
WITH RECONFIGURE;
Disabling expensive statement trace for a user
To disable expensive statement trace for a specific user, log in as the SYSTEM user of your database and execute the following SQL command:
ALTER SYSTEM ALTER CONFIGURATION ('global.ini', 'SYSTEM')
SET ('expensive_statement', 'enable') = 'false',
('expensive_statement', 'user') = '<username>'
WITH RECONFIGURE;
Changing threshold duration
To modify the threshold duration (in microseconds) for capturing expensive statements, log in as the SYSTEM user of your database and execute the following SQL command:
ALTER SYSTEM ALTER CONFIGURATION ('global.ini', 'SYSTEM')
SET ('expensive_statement', 'threshold_duration') = '<microseconds>'
WITH RECONFIGURE;
For example, to set the threshold to 5 seconds (5,000,000 microseconds):
ALTER SYSTEM ALTER CONFIGURATION ('global.ini', 'SYSTEM')
SET ('expensive_statement', 'threshold_duration') = '5000000'
WITH RECONFIGURE;