Skip to content

update to alerts tutorial #23982

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions tutorials/hana-cloud-alerts/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"SAP HANA Database Explorer.Use Objects Definition For SQL Generation": true
}
Binary file modified tutorials/hana-cloud-alerts/alert-threshold.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tutorials/hana-cloud-alerts/ans-basic.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tutorials/hana-cloud-alerts/ans-sub-complete.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tutorials/hana-cloud-alerts/ans-sub-condition-assign.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tutorials/hana-cloud-alerts/ans-sub-create.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tutorials/hana-cloud-alerts/ans-sub.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tutorials/hana-cloud-alerts/ans.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tutorials/hana-cloud-alerts/create-action-email-details.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tutorials/hana-cloud-alerts/create-action-email.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tutorials/hana-cloud-alerts/create-action.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tutorials/hana-cloud-alerts/create-condition-dl.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tutorials/hana-cloud-alerts/create-condition.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tutorials/hana-cloud-alerts/data-lake-condition.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tutorials/hana-cloud-alerts/email-action-enabled.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tutorials/hana-cloud-alerts/entitlements.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
96 changes: 38 additions & 58 deletions tutorials/hana-cloud-alerts/hana-cloud-alerts.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,58 +31,44 @@ Alternatively, alert details can be pushed to several configured channels such a
### Examine SAP HANA Cloud, HANA Database alert definitions
In this step, the SAP HANA cockpit will be used to examine three alert definitions.

1. Open the SAP HANA cockpit from HANA Cloud Central.
1. Open Alerts from HANA Cloud Central.

![Open SAP HANA Cockpit](open-cockpit.png)
![Open Alerts](open-alerts.png)

2. In the Monitoring view, open the Alert Definitions app.
>SAP HANA Cloud Central has an alerts app to view triggered alerts. It displays alerts for all instances in a subaccount and additionally displays additional alerts that do not originate from the SAP HANA embedded statistics server (ESS). Events corresponding to ESS alerts have an alert ID.

![alerts app in the cockpit](alerts-app-cockpit.png)
2. The three alerts that will be triggered in step 2 of this tutorial are `HDBCSTableRecordCount`, `HDBLongRunningStatement`, and `HDBTestAlert`.

>SAP HANA Cloud Central also has an alerts app to view triggered alerts. It displays alerts for all instances in a subaccount and additionally displays additional alerts that do not originate from the SAP HANA embedded statistics server (ESS). Events corresponding to ESS alerts have an alert ID.
You can find these alerts by selecting Configure Alert Rules.

3. The three alerts that will be triggered in step 2 of this tutorial are shown below.
![Configure Alert Rules](configure-alert-rules.png)

![alerts definitions in the cockpit](alert-defintions-cockpit.png)
Then select an instance and search for the alerts.

Notice that alerts have a name, ID, description, category, and a suggested user action such as an SAP Note.
![Configure Alert Rules Search](configure-alert-rules-search.png)

![restarted-services-alert-details](alert-definitions-cockpit-details.png)
> Notice that alerts have a name, description, and categories.

The categories are shown below.

| SAP HANA Database Categories |
| ----------- |
| Other |
| Availability |
| Memory |
| Disk |
| Configuration |
| Sessions/Transactions |
| Backup |
| Diagnosis Files |
| Security |

4. Alerts may have severity and threshold levels.

| Severity |
| ----------- |
| High |
| Medium |
| Low |
| Information |
| Schedule |
| Interval |
| Threshold |


As an example, long-running statements (ID 39), has its threshold values set to 60 minutes for Medium, 45 minutes for Low, and 30 minutes for Info. These will be set to much lower thresholds of 3, 2 and 1 minutes in step 2.
3. Alerts may have threshold levels.
As an example, long-running statements, has its threshold values set to 60 minutes for Warning, 45 minutes for Notice, and 30 minutes for Information. These will be set to much lower thresholds of 3, 2 and 1 minutes in step 2.

![long running statement updated thresholds](long-running-thresholds.png)

5. Alert checks are scheduled to run at a specified interval and can be enabled or disabled. For example, record count of non-partitioned column-store tables ( ID 17 ) has an interval value of 1 hour, meaning that this check is performed each hour and is currently enabled.
4. Alert checks are scheduled to run at a specified interval and can be enabled or disabled. For example, record count of non-partitioned column-store tables (`HDBCSTableRecordCount`) has an interval value of 1 hour, meaning that this check is performed each hour and is currently enabled.

![enabled and interval](restarted-services-interval.png)

Note that the check for an alert can be manually triggered by pressing the **Check Now** button.

6. Alerts also have a retention period. Once triggered, depending on their type, they will remain for a set duration such as 14 or 42 days.
5. Alerts also have a retention period. Once triggered, depending on their type, they will remain for a set duration such as 14 or 42 days.

For additional details, consult [Alerts in SAP HANA Cloud](https://help.sap.com/docs/hana-cloud-database/sap-hana-cloud-sap-hana-database-administration-guide/alerts-in-sap-hana-cloud) in the administration guide for SAP HANA cockpit.

Expand All @@ -99,33 +85,32 @@ The following instructions demonstrate a few examples of triggering alerts in a
2. Execute the following query in the SQL console to trigger a high (indicated by the parameter value of 4) severity test alert.

```SQL
CALL _SYS_STATISTICS.Trigger_Test_Alert(?, 4, 'High test alert');
CALL _SYS_STATISTICS.Trigger_Test_Alert(?, 4, 'High test alert');
```
![Severity Test Alert](severity_test_alert.png)

> The alert will be viewed in the alerts app in step 3.

3. Trigger the long-running statements (ID 39) alert.
3. Trigger the long-running statements alert.

* Go to the **Long-running statements** alert in the **Alert Definitions** app.

Click **edit** to set the thresholds and interval.

Set the thresholds to 180, 120, and 60 seconds with an interval time set to 1 minute.
Click **Configure Alert Rules** and select your instance. Then, search for the **Long-running statements** alert (`HDBLongRunningStatement`) in search bar.

Select **Edit** and set the thresholds to 180, 120, and 60 seconds. The interval time set to 5 minutes by default.

![Threshold setting](alert-threshold.png)
![Threshold setting](alert-threshold.png)

* Execute the following SQL
Execute the following SQL.

```SQL
DO BEGIN
USING SQLSCRIPT_SYNC AS SYNCLIB;
CALL SYNCLIB:SLEEP_SECONDS( 300 ); --runs for 5 minutes
-- Now execute a query
SELECT * FROM M_TABLES;
END;
```
```SQL
DO BEGIN
USING SQLSCRIPT_SYNC AS SYNCLIB;
CALL SYNCLIB:SLEEP_SECONDS( 300 ); --the SQL runs for 5 minutes
-- Now execute a query
SELECT * FROM M_TABLES;
END;
```

4. The record count of non-partitioned column-store tables (ID 17) alert can be triggered by executing the following SQL.
4. The record count of non-partitioned column-store tables alert can be triggered by executing the following SQL.

```SQL
--The default threshold for 'Record count of non-partitioned column-store tables' is 300 million
Expand Down Expand Up @@ -153,23 +138,17 @@ The following instructions demonstrate a few examples of triggering alerts in a
-- DROP TABLE MYTABLE;
```

As the default interval time for this check is 1 hour, the check can be manually trigged by pressing the Check Now button in the alert definitions app within the SAP HANA cockpit.

![check now](check-now.png)

> Note that two other alerts may also be triggered by the above SQL: table growth of non-partitioned column-store tables and record count of column-store table partitions.

### View SAP HANA database alerts using the alerts app

The following instructions will show how to view a triggered SAP HANA database alert in SAP HANA Cloud Central.

1. In SAP HANA Cloud Central, alerts can be seen for all instances in an SAP BTP subaccount.

Navigate to the alerts tab.
1. In SAP HANA Cloud Central, alerts can be seen for all instances in an SAP BTP subaccount. Navigate to the alerts tab.

![subaccount alerts view](subaccount-alerts-view.png)

A filter can be set for Type, Severity, Instance, Instance Type, and Time Range.
A filter can be set for Type, Severity, Instance, Instance Type, and Time Range.

![alerts view in HCC](alerts-hcc.png)

Expand Down Expand Up @@ -267,9 +246,10 @@ In this step, the Alert Notification Service will be configured to act on the in

>---

>If the SAP Alert Notification service does not appear, it may be that the entitlement needs to be added to the subaccount. To do so, navigate to the subaccount, select Entitlements, Configure Entitlements, Add Service Plans, and Alert Notification.
>If the SAP Alert Notification service does not appear, it may be that the entitlement needs to be added to the subaccount. To do so, navigate to the subaccount, select **Entitlements**, **Edit**, **Add Service Plans**, and **Alert Notification**.

>![Add entitlements](entitlements.png)
>![Add Alert entitlement](entitlements-alerts.png)

2. Provide a name for the Alert Notification service instance and press the **Create** button.

Expand Down
Binary file modified tutorials/hana-cloud-alerts/long-running-thresholds.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tutorials/hana-cloud-alerts/open-alerts.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tutorials/hana-cloud-alerts/restarted-services-interval.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.