Skip to content
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
Binary file modified tutorials/hana-cloud-mission-trial-2/BTP-entitlements-ft.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@

### Start the Provisioning Wizard

> There are different instructions available to you depending on whether you are using a free tier instance versus a productive instance. Please make sure to select the one that applies to your situation to get the most out of this tutorial.
> There are different instructions available to you depending on whether you are using a free tier instance versus a productive instance. Please make sure to select the one that applies to your situation to get the most out of this tutorial. Additional details can also be found at [Create an SAP HANA Database Instance Using SAP HANA Cloud Central](https://help.sap.com/docs/hana-cloud/sap-hana-cloud-administration-guide/create-sap-hana-database-instance-using-sap-hana-cloud-central).

To create your first instance of SAP HANA Cloud, SAP HANA database, you need to follow these steps:

Expand Down Expand Up @@ -101,7 +101,7 @@
[OPTION END]

[OPTION BEGIN [Production]]
1. In the **Basics** section, enter a name for your instance in the field **Instance Name**, such as `HC_HDB`.

Check warning on line 104 in tutorials/hana-cloud-mission-trial-3/hana-cloud-mission-trial-3.md

View workflow job for this annotation

GitHub Actions / checks / checks

markdown/MD032

Lists should be surrounded by blank lines

![General settings](hdb-instance-name-prod.png)

Expand All @@ -109,15 +109,15 @@

[OPTION END]

2. Insert a password in the **Administrator Password** field.

Check warning on line 112 in tutorials/hana-cloud-mission-trial-3/hana-cloud-mission-trial-3.md

View workflow job for this annotation

GitHub Actions / checks / checks

markdown/MD029

Ordered list item prefix

3. Confirm it by typing it again in the **Confirm Administrator Password** field.

Check warning on line 114 in tutorials/hana-cloud-mission-trial-3/hana-cloud-mission-trial-3.md

View workflow job for this annotation

GitHub Actions / checks / checks

markdown/MD029

Ordered list item prefix

> This password is the admin password for this instance, so make sure to use a strong password. If needed, the password can be reset via the actions menu [Reset DBADMIN Password](https://help.sap.com/docs/HANA_CLOUD/9ae9104a46f74a6583ce5182e7fb20cb/649092e9d9be41c59930179ce4f3d59e.html?locale=en-US) in SAP HANA Cloud Central if your user has the role SAP HANA Cloud Security Administrator.

4. You may also choose the runtime environment. Further details can be found at [What Runtime Environment is my SAP HANA Cloud Instance Using?](https://help.sap.com/docs/hana-cloud/sap-hana-cloud-administration-guide/runtime-environments-for-sap-hana-cloud). For this mission, the runtime environment can be left as the default.

Check warning on line 118 in tutorials/hana-cloud-mission-trial-3/hana-cloud-mission-trial-3.md

View workflow job for this annotation

GitHub Actions / checks / checks

markdown/MD029

Ordered list item prefix

5. Now click on **Next Step** to continue.

Check warning on line 120 in tutorials/hana-cloud-mission-trial-3/hana-cloud-mission-trial-3.md

View workflow job for this annotation

GitHub Actions / checks / checks

markdown/MD029

Ordered list item prefix

### Set up the size and availability of your database

Expand Down Expand Up @@ -149,7 +149,7 @@

One the right, the **total estimate** of how many capacity units the service will consume is provided.

Follow this [link](https://help.sap.com/docs/hana-cloud/sap-hana-cloud-administration-guide/sap-hana-database-size) to learn more about the memory allocation.

Check warning on line 152 in tutorials/hana-cloud-mission-trial-3/hana-cloud-mission-trial-3.md

View workflow job for this annotation

GitHub Actions / checks / checks

markdown/MD059

Link text should be descriptive

Finally, the availability zone can be configured, and a replica can be added to further increase availability.

Expand Down Expand Up @@ -179,7 +179,7 @@

[OPTION END]

2. The Cloud Connector enables connection to be made to an SAP HANA on-premise database. Additional details on the Cloud Connector can be found in the [technical documentation](https://help.sap.com/docs/connectivity/sap-btp-connectivity-cf/cloud-connector) and the [SAP HANA Database Connectivity Documentation](https://help.sap.com/docs/hana-cloud-database/sap-hana-cloud-sap-hana-database-data-access-guide/data-access-in-sap-hana-cloud-sap-hana-database?locale=en-US).

Check warning on line 182 in tutorials/hana-cloud-mission-trial-3/hana-cloud-mission-trial-3.md

View workflow job for this annotation

GitHub Actions / checks / checks

markdown/MD029

Ordered list item prefix

### Check the advanced settings

Expand All @@ -201,11 +201,11 @@

[OPTION END]

2. Enable the natural language processing option. Further details on these features can be found at [Hands-on Tutorial: Machine Learning with SAP HANA Cloud](https://community.sap.com/t5/artificial-intelligence-and-machine-learning-blogs/hands-on-tutorial-machine-learning-with-sap-hana-cloud/ba-p/13683430).

Check warning on line 204 in tutorials/hana-cloud-mission-trial-3/hana-cloud-mission-trial-3.md

View workflow job for this annotation

GitHub Actions / checks / checks

markdown/MD029

Ordered list item prefix

3. Instance mapping enables an instance provisioned into the SAP BTP subaccount to be mapped into a runtime environment such as Cloud Foundry. Step-by-step instructions can be found in the [Create a Development Project in SAP Business Application Studio](hana-cloud-mission-trial-8) tutorial.

Check warning on line 206 in tutorials/hana-cloud-mission-trial-3/hana-cloud-mission-trial-3.md

View workflow job for this annotation

GitHub Actions / checks / checks

markdown/MD029

Ordered list item prefix

4. Click on **Next Step** in the bottom left corner to continue.

Check warning on line 208 in tutorials/hana-cloud-mission-trial-3/hana-cloud-mission-trial-3.md

View workflow job for this annotation

GitHub Actions / checks / checks

markdown/MD029

Ordered list item prefix

### Enable the SAP HANA Cloud, data lake (optional)

Expand Down
117 changes: 58 additions & 59 deletions tutorials/hana-cloud-sqltools-console/hana-cloud-sqltools-console.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
parser: v2
auto_validation: true
time: 10
tags: [tutorial>beginner, software-product-function>sap-hana-cloud--sap-hana-database, software-product-function>sap-hana-cloud--data-lake]
author_name: Dan van Leeuwen
author_profile: https://github.com/danielva
tags: [tutorial>beginner, software-product>sap-hana-cloud, software-product-function>sap-hana-cloud--sap-hana-database, software-product-function>sap-hana-cloud--data-lake]
primary_tag: software-product>sap-hana-cloud
---

Expand All @@ -12,8 +14,7 @@ primary_tag: software-product>sap-hana-cloud

## Prerequisites

- An SAP HANA Cloud database
- You have completed [this](hana-cloud-sqltools-create-schema) tutorial which creates a database schema for an SAP HANA Cloud, SAP HANA database.
- You have completed the first 3 tutorials in this group
- You have completed [this](hana-cloud-dl-clients-overview) tutorial which creates a database schema for an SAP HANA Cloud, data lake Relational Engine

## You will learn
Expand Down Expand Up @@ -47,11 +48,11 @@ This step demonstrates how a SQL console can quickly be opened from within SAP H

3. There are several ways to connect to a database as a different user:

- **From the Instances list:** Click the **three dots** next to the instance and select **Sign in with Different User**. Enter the username and password of the desired user after clicking the "Sign in with a different user" option in the confirmation dialog.
- **From the Instances list:** Click the **three dots** next to the instance and select **Sign in with Different User**. Enter the username and password for the user you wish to connect with.

![Change Credentials in Instances](different-user.png)
![Change credentials in instances](different-user.png)

- **From the SQL console Connect menu:** Select the **Connect to** link, click the **Connect ...** button, and provide the new username and password.
- **From the SQL console Connect menu:** Select the **Connected to** link, click the **Connect ...** button, and provide the new username and password.

![Change credentials](change-credentials.png)

Expand Down Expand Up @@ -88,7 +89,7 @@ This step demonstrates how a SQL console can quickly be opened from within SAP H

- **Using the SAP HANA Cloud Central UI:** Open the instance, go to the **Overview** tab, and scroll down to **User and Authorization Management**. Select **Users**, click on the user you want to update, and choose **Edit** to make your changes.

![Changing User Credentials Using HCC UI](user-ui.png)
![Changing user credentials using the UI](user-ui.png)

5. The current schema can be set and viewed for a SAP HANA database using the SQL statements below or by clicking on the Current Schema link.

Expand All @@ -106,7 +107,7 @@ This step demonstrates how a SQL console can quickly be opened from within SAP H
SELECT CURRENT SCHEMA, CURRENT USER;
```

![set the schema of a data lake RE](set-schema-dl.png)
![Set the schema of a data lake Relational Engine](set-schema-dl.png)

### Execute SQL

Expand All @@ -123,7 +124,7 @@ This step demonstrates how to execute a SQL query, examine the statement help, v

The following error dialog appears. Select **Skip All**.

![SQL Execution Error dialog](error-dialog.png)
![SQL execution error dialog](error-dialog.png)

Notice that there is an error marker beside the lines that could not be executed. Pressing **Alt+E** will display further details and advances to the next error when pressed more than once.

Expand All @@ -133,19 +134,19 @@ This step demonstrates how to execute a SQL query, examine the statement help, v

2. Results can be downloaded as shown below.

![download results](download-results.png)
![Download results](download-results.png)

Options are provided on how to format the data.

![download options](download-options.png)
![Download options](download-options.png)

Rows can also be selected and then copied to the clipboard by pressing Ctrl+C.

![Copy Results](copy-results.png)
![Copy results](copy-results.png)

3. Place the cursor on line four and open the **Syntax Help** panel.

![statement help panel](statement-help.png)
![Statement help panel](statement-help.png)

Notice that for SAP HANA Cloud, SAP HANA databases, links to the related documentation and details on the objects used in the SQL statement are shown including a link which will open the database objects app where additional details of the object can be viewed.

Expand All @@ -169,11 +170,7 @@ This step demonstrates how to execute a SQL query, examine the statement help, v

-->

5. The SQL console provides the ability to search across all open tabs. Navigate to the three dots menu in the SQL console and select **Search Through Tabs** to search for text across all open SQL console tabs.

![Search Through Tabs](search-through-tabs.png)

6. Commonly used shortcut keys are listed below. Try a few of them out.
5. Commonly used shortcut keys are listed below. Try a few of them out.

Action | Shortcut
------ | ------
Expand All @@ -196,19 +193,19 @@ This step demonstrates how to execute a SQL query, examine the statement help, v

For the complete list see [Common Keyboard Shortcuts for the SQL Console](https://help.sap.com/docs/hana-cloud/sap-hana-cloud-administration-guide/keyboard-shortcuts-for-sql-console).

7. Examine the **History** tab.
6. Examine the **History** tab.

![history tab](messages-history-tab.png)
![History tab](messages-history-tab.png)

Notice details for each executed statement are displayed, including metrics such as memory consumption. Statements can be quickly located using the search functionality. Selected statements may be inserted back into the SQL console or copied for further use.

The columns can also be changed by selecting the gear icon in the right corner.

![history-tab-columns tab](history-tab-columns.png)
![History tab columns](history-tab-columns.png)

8. Examine the **SQL Console Settings**.
7. Examine the **SQL Console Settings**.

![connection settings](connection-settings.png)
![Connection settings](connection-settings.png)

- Execute the following SQL which is used to illustrate the result behavior settings.

Expand All @@ -221,43 +218,43 @@ This step demonstrates how to execute a SQL query, examine the statement help, v

Double click on a cell to open the viewer. Notice that only the first 1024 bytes from the column STATEMENT are displayed in the results view for the Blocked Transactions row.

![limit for large objects](settings-result3.png)
![Limit for large objects](settings-result3.png)

Notice that over 6000 rows are in TABLE_COLUMNS.

![one thousand row limit](settings-result1.png)
![One thousand row limit](settings-result1.png)

The first 1000 are displayed.

![one thousand row limit](settings-result2.png)
![One thousand row limit](settings-result2.png)

These limits can be adjusted in the result behavior settings shown below.

![result behavior settings](result-behavior.png)
![Result behavior settings](result-behavior.png)

9. Execute the following SQL which is used to illustrate the result display settings.
8. Execute the following SQL which is used to illustrate the result display settings.

```SQL
SELECT CURRENT_DATE, CURRENT_TIMESTAMP(7), RAND() * 10 FROM DUMMY;
```
```SQL
SELECT CURRENT_DATE, CURRENT_TIMESTAMP(7), RAND() * 10 FROM DUMMY;
```

The below is the result when this setting is disabled.
The below is the result when this setting is disabled.

![no formatting](no-formatting.png)
![No formatting](no-formatting.png)

Enable Result Format Settings in the settings.
Enable Result Format Settings in the settings.

![format settings](result-format-settings.png)
![Format settings](result-format-settings.png)

The below is the result when this setting is enabled.
The below is the result when this setting is enabled.

![result formatted](formatted.png)
![Result formatted](formatted.png)

10. The overall theme for SAP HANA Cloud Central can be set in the settings which also affects the theme of the SQL console.
9. The overall theme for SAP HANA Cloud Central can be set in the settings which also affects the theme of the SQL console.

![theme](theme.png)
![Theme](theme.png)

11. Execute the following SQL statements.
10. Execute the following SQL statements.

```SQL
SELECT HEXTOBIN ('48656C6C6F20776F726C64') BINARY_EXAMPLE FROM DUMMY;
Expand Down Expand Up @@ -306,11 +303,11 @@ This step demonstrates how to execute a SQL query, examine the statement help, v

![SQL results](result-viewer.png)

12. The Auto-save contents of SQL consoles setting can be used to persist the open SQL console tabs and their contents. This setting is on by default.
11. The Auto-save contents of SQL consoles setting can be used to persist the open SQL console tabs and their contents. This setting is on by default.

![Auto-Save](auto-save.png)
![Auto save](auto-save.png)

13. SQL statements can also be executed in the background. This allows users to start a long-running statement, disconnect, and return later to view the results.
12. SQL statements can also be executed in the background. This allows users to start a long-running statement, disconnect, and return later to view the results.

Execute the following statement by clicking the Run dropdown menu and selecting Run Statement in Background:

Expand All @@ -328,17 +325,19 @@ This step demonstrates how to execute a SQL query, examine the statement help, v

The results will appear in the Background Statements tab at the bottom on the console.

14. The actions menu for a SQL console tab offers additional options such as the ability to rename a tab, to move a tab, to open a previously closed tab, or to search through the content of all open SQL console tabs.
13. The actions menu for a SQL console tab offers additional options such as the ability to rename a tab, to move a tab, to open a previously closed tab, or to search through the content of all open SQL console tabs.

![SQL console actions menu](actions-menu.png)

![Search through tabs](search-through-tabs.png)

### Statement library

The statement library is a convenient location in the SQL console to store and retrieve frequently executed SQL statements. It provides a place to store statements that are used frequently as to not type them in repeatedly.

The library is pre-populated with useful statements called ‘SYSTEM’ statements.

![Statement Library System Statements](statement_libaray_system.png)
![Statement library system statements](statement_libaray_system.png)

You may also define custom statements that are only available to you. These are ‘USER’ statements.

Expand All @@ -357,31 +356,31 @@ SELECT * FROM RESERVATION

1. Save your custom statement, add a name and an optional description.

![Statement Library Create User Statements](save_custom_statement.png)
![Create user statement](save_custom_statement.png)

Set the name to `All Future Check-ins`.

![Statement Library Save Statements](save_statement.png)
![Save statement](save_statement.png)

2. View your custom statement in the statement library

![Statement Library View User Statements](statement_libaray_user.png)
![View user statements](statement_libaray_user.png)

3. To run a statement, select one from the statement library and click the Run button.

![Run Saved Statement](run_saved_statement.png)
![Run saved statement](run_saved_statement.png)

If you select multiple saved statements, you additionally have the option to open them together in one tab or in individual tabs.

> It is also possible to export and import SQL statements directly to/from the file system
>
> ![Import or Export Statements](export_import_statements.png)
>
> Files can then be shared using a version control system such as git.
> It is also possible to export and import SQL statements directly to/from the file system
>
> ![Import or export statements](export_import_statements.png)
>
> Files can then be shared using a version control system such as git.

User-defined statements can be edited. From the Statement library, select the desired statement, click open, and make the desired changes. Select Save to overwrite the previous statement.
User-defined statements can be edited. From the Statement library, select the desired statement, click open, and make the desired changes. Select Save to overwrite the previous statement.

![Modify Saved Statements](replace_statement.png)
![Modify saved statements](replace_statement.png)

### GenAI in the SQL console

Expand All @@ -393,7 +392,7 @@ The SQL console also provides GenAI tools that assist with creating, understandi
List all the column store tables and their columns in the schema HOTELS
```

![RunPrompt](RunPrompt.png)
![Run prompt](RunPrompt.png)

2. To understand an existing query, select the SQL statement and click Explain SQL Statement using AI from the same menu. This returns a clear natural-language explanation of what the query does.

Expand All @@ -414,7 +413,7 @@ The SQL console also provides GenAI tools that assist with creating, understandi
c.POSITION;
```

![ExplainAI](ExplainAI.png)
![Explain AI](ExplainAI.png)

3. To improve a query, select the SQL statement and click Optimize SQL Statement using AI. The system will suggest a refined version of the query, often improving readability and performance.

Expand All @@ -430,7 +429,7 @@ The SQL console also provides GenAI tools that assist with creating, understandi
ON TABLE_COLUMNS.TABLE_NAME = TABLES.TABLE_NAME;
```

![OptimizeAI](OptimizeAI.png)
![Optimize AI](OptimizeAI.png)

### Knowledge check

Expand Down
Binary file modified tutorials/hana-cloud-sqltools-console/history-tab-columns.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-sqltools-console/result-behavior.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-sqltools-console/search-through-tabs.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-sqltools-console/set-schema.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading