Skip to content

Updates to the database explorer tutorials #23043

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
May 10, 2023
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
2 changes: 1 addition & 1 deletion tutorials/hana-cloud-migration/hana-cloud-migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ Different versions of SAP HANA databases will have slightly different features.


### Self-Service Migration tool
The Self-Service Migration tool is used when performing a migration. This tool is accessed from SAP HANA Cloud Central, the main tool for creating and configuring SAP HANA Cloud instances. For more information about SAP HANA Cloud Central, see [SAP HANA Cloud Administration Guide](https://help.sap.com/docs/HANA_CLOUD/9ae9104a46f74a6583ce5182e7fb20cb/48e1b509c9494d61a6f90e7eaa6f225b.html).
The Self-Service Migration tool can be used when performing a migration. It automates the migration process and can reduce the cost and effort of a migration. It is a free service and SAP manages the temporary storage used during the migration. This tool is accessed from SAP HANA Cloud Central, the main tool for creating and configuring SAP HANA Cloud instances. For more information about SAP HANA Cloud Central, see [SAP HANA Cloud Administration Guide](https://help.sap.com/docs/HANA_CLOUD/9ae9104a46f74a6583ce5182e7fb20cb/48e1b509c9494d61a6f90e7eaa6f225b.html).

![Migrations in SAP HANA Cloud Central](migrations.png)

Expand Down
Binary file modified tutorials/hana-dbx-connections/api-endpoint-hc.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-dbx-connections/dbx-hdi-hc.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-dbx-connections/dbx-hdi-hc2.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-dbx-connections/deploy-hc.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-dbx-connections/dev-space.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
67 changes: 35 additions & 32 deletions tutorials/hana-dbx-connections/hana-dbx-connections.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,43 +6,43 @@ tags: [ tutorial>beginner, software-product-function>sap-hana-cloud--sap-hana-da
primary_tag: software-product>sap-hana-cloud
---

# Add Databases to the SAP HANA Database Explorer
<!-- description --> This tutorial will explore different database connection types, such as SAP HANA Cockpit Database, SAP HANA Cloud, data lake Relational Engine, and SAP HANA Deployment Infrastructure (HDI), along with the different operations that can be performed on them.
# Add Databases to the SAP HANA Database Explorer
<!-- description --> This tutorial will explore different instance types, such as SAP HANA Cockpit Database, SAP HANA Cloud, data lake Relational Engine, data lake Files, and SAP HANA Deployment Infrastructure (HDI) that can be added, along with the different operations that can be performed on them.

## Prerequisites
- An SAP HANA database such as SAP HANA Cloud free tier, trial or the SAP HANA, express edition that includes the SAP HANA database explorer

## You will learn
- How to add different database types in the SAP HANA database explorer
- Additional operations that can be performed on a database
- How to add different instance types in the SAP HANA database explorer
- Additional operations that can be performed on an instance

## Intro
Database connections in the SAP HANA database explorer represent SAP HANA or data lake Relational Engine databases that you browse and interact with.
Instances in the SAP HANA database explorer represent SAP HANA, data lake Relational Engine, or data lake Files connections that you browse and interact with.

SQL consoles are associated with a database connection.
SQL consoles are associated with a database instance.

![sql console connection](sql-console-connection.png)

---

### Add an SAP HANA cockpit database connection
### Add an SAP HANA cockpit database instance


Databases defined in the SAP BTP cockpit or the SAP HANA cockpit can be opened in the SAP HANA database explorer.
Instances defined in SAP HANA Cloud Central, the SAP BTP cockpit, or in SAP HANA cockpit can be opened in the SAP HANA database explorer.

1. From SAP HANA Cloud Central, choose **Open in SAP HANA Database Explorer**.

![Open in the database explorer](from-directory.png)

>You may be prompted to enter database login credentials at this point. Enter the DBADMIN or SYSTEM user credentials that were set when the database instance was created.
>You may be prompted to enter database login credentials at this point. Enter the DBADMIN or SYSTEM user credentials that were set when the instance was created.

>---

>The credentials can be saved so they do not need to be re-entered if they are entered into the SAP HANA cockpit.
>The credentials can be saved so they do not need to be re-entered if they are entered into SAP HANA Cloud Central, or SAP HANA cockpit.

Notice that when the SAP HANA database explorer opens, the selected database is the one from the selected tile or administered database. Also note that the URL contains a `&databaseid=`.
Notice that when the SAP HANA database explorer opens, the selected instance is the one from the selected tile or administered database. Also note that the URL contains a `&databaseid=`.

If this URL is saved as a bookmark, each time the page is opened, the matching database will be selected in the catalog browser.
If this URL is saved as a bookmark, each time the page is opened, the matching instance will be selected in the catalog browser.

![databaseid parameter](open-in-dbx2.png)

Expand All @@ -52,13 +52,13 @@ Databases defined in the SAP BTP cockpit or the SAP HANA cockpit can be opened i

### Add an SAP HANA database connection

Databases can also be added directly to the SAP HANA database explorer. To connect to an SAP HANA Cloud or on-premise database, the host, port, user name, and password must be provided.
Instances can also be added directly to the SAP HANA database explorer. To connect to an SAP HANA Cloud or on-premise database, the host, port, user name, and password must be provided.

1. In the SAP HANA database explorer, press the **+** button to add a new database.
1. In the SAP HANA database explorer, press the **+** button to add a new instance.

![Add a new database](new-connection0.png)

2. For database type, choose **SAP HANA Database**.
2. For Instance Type, choose **SAP HANA Database**.

![Database types](connection-type.png)

Expand All @@ -68,22 +68,26 @@ Databases can also be added directly to the SAP HANA database explorer. To conn

![encrypted connection](encrypted.png)

>Remember to remove the colon and port number from the host name and add the port to the port field.

>---

>When connecting to an SAP HANA Cloud instance, the database connection must use TLS.
>When connecting to an SAP HANA Cloud instance, the connection must use TLS.

>![connect using TLS](encryption2.png)

>The public root certificate of the certificate authority (CA) that signed the SAP HANA Cloud instance's server certificate is required. This certificate is likely already available in the system certificate store on the operating system and accessible by the browser, but if not, it can be pasted into the UI. For more information see [Secure Communication Between SAP HANA Cloud and JDBC/ODBC Clients](https://help.sap.com/viewer/c82f8d6a84c147f8b78bf6416dae7290/cloud/en-US/dbd3d887bb571014bf05ca887f897b99.html).

>---

>For a HANA Cloud database, the host and port values can be copied from SAP HANA Cloud Central.

>---

>![copy host and port](host-and-port.png)

>Remember to remove the colon and port number from the host name and add the port to the port field.

![Image of where the port number is](remove-port-number.png)

>---

>If you are using an SAP HANA, express edition or on-premise database, the port numbers for a system or tenant database can be determined by running the following query against the **System** database.
Expand All @@ -94,7 +98,7 @@ Databases can also be added directly to the SAP HANA database explorer. To conn

>![SQL port query](sql-port.png)

4. After pressing OK, a new database will appear whose type is SAP HANA Database.
4. After pressing OK, a new instance will appear whose type is SAP HANA Database.

![new database](new-connection.png)

Expand All @@ -112,9 +116,9 @@ Databases can also be added directly to the SAP HANA database explorer. To conn
>These values can be seen by opening a SQL console and noticing the schema that the database is using or by executing the following queries.

>```SQL
>SELECT * FROM M_SESSION_CONTEXT WHERE CONNECTION_ID=current_connection;
>SELECT * FROM SYS.M_CONNECTIONS WHERE CONNECTION_ID=current_connection;
>SELECT ISOLATION_LEVEL FROM PUBLIC.M_TRANSACTIONS where CONNECTION_ID = current_connection;
>SELECT * FROM M_SESSION_CONTEXT WHERE CONNECTION_ID = current_connection;
>SELECT * FROM M_CONNECTIONS WHERE CONNECTION_ID = current_connection;
>SELECT ISOLATION_LEVEL FROM M_TRANSACTIONS where CONNECTION_ID = current_connection;
>```
>
>For additional details, see [Add Instances to the SAP HANA Database Explorer](https://help.sap.com/viewer/a2cea64fa3ac4f90a52405d07600047b/cloud/en-US/4e2e8382f8484edba31b8b633005e937.html) and the [SET Statement](https://help.sap.com/docs/HANA_CLOUD_DATABASE/c1d3f60099654ecfb3fe36ac93c121bb/20fd82b675191014b22c8af08d0b319c.html).
Expand All @@ -128,7 +132,7 @@ A data lake Relational Engine is a column oriented, disk based relational store

![add a data lake](add-data-lake.png)

Ensure that the allowed connections list is set to **Allow all IP addresses**.
If this is a non-production database, the allowed connections list can be set to **Allow all IP addresses**.

![allowed connections](allow-all.png)

Expand Down Expand Up @@ -180,29 +184,29 @@ A [data lake Files container](https://help.sap.com/viewer/b239ed4bb73a4f07886657

### Additional database connection features

Databases have additional actions that can be performed on them such as renaming, connecting as a different user, changing the connection of a SQL console, and viewing an overview of the connected database.
Instances have additional actions that can be performed on them such as renaming, connecting as a different user, changing the connection of a SQL console, and viewing an overview of the connected SAP HANA Cloud, SAP HANA database.

1. To rename a connection, right-click a database and choose **Properties**.
1. To rename an instance, right-click on an instance and choose **Properties**.

![database properties](properties.png)

You may wish to rename the default database display name. Press **OK** to save the changes and close the window.

![renaming a connection](properties2.png)

2. To connect to the same database but with different credentials, right-click a database and choose **Add Database with Different User**. This can be useful when you wish to connect to the same SAP HANA database but with a different set of credentials perhaps because you need elevated permissions. The USER1 database user will be created in the next tutorial.
2. To connect to the same instance but with different credentials, right-click an instance and choose **Add Database with Different User**. This can be useful when you wish to connect to the same instance but with a different set of credentials perhaps because you need elevated permissions. The USER1 database user will be created in the next tutorial.

![connecting as a different user](clone.png)

3. When a SQL console opens, it connects to the currently selected database connection and displays the current schema and connection.
3. When a SQL console opens, it connects to the currently selected database instance and displays the current schema and instance name.

![SQL Console connections](SQL-Console-Connections.png)

It is possible to connect, disconnect, or change the connection via the toolbar items highlighted above.

> Subsequent tutorials assume the connected user is DBADMIN or SYSTEM.

4. To see information about an SAP HANA database, right-click a database and choose **Show Overview**. This provides a quick overview of the database that you are connected to including the database version.
4. To see information about an SAP HANA database, right-click on an instance and choose **Show Overview**. This provides a quick overview of the database that you are connected to including the database version.

![database overview](overview.png)

Expand Down Expand Up @@ -242,7 +246,7 @@ SAP HANA cockpit databases can be grouped together. This enables SQL statements

![run on multiple](run-on-multiple.png)

1. With SAP HANA Cloud, all databases created in a space are placed in a group. As seen below, the space name is dev.
1. With SAP HANA Cloud, all databases created in a Cloud Foundry space are placed in a group. As seen below, the space name is dev.

![group by space](group-by-space.png)

Expand All @@ -260,6 +264,8 @@ SAP HANA cockpit databases can be grouped together. This enables SQL statements

![run on multiple databases in HXE](run-on-multiple-hc.png)

>This feature does not apply to SAP HANA Cloud instances deployed to the subaccount or when used with the multi-environment tooling.

2. With SAP HANA, express edition or an on-premise install, a tool called SAP HANA Cockpit Manager can be used to register databases and organize them into groups.

![registered resources](cockpit-manager.png)
Expand All @@ -276,9 +282,6 @@ SAP HANA cockpit databases can be grouped together. This enables SQL statements

>The ability to see groups in the SAP HANA database explorer that have been created using the SAP HANA Cockpit Manager requires the SAP HANA database explorer to be opened from the SAP HANA cockpit.

>---



### Native HANA development with HDI (Optional)

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 8 additions & 2 deletions tutorials/hana-dbx-create-schema/hana-dbx-create-schema.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,9 @@ The following steps will create a sample hotel dataset using create and insert s

3. Add another SAP HANA database connection using USER1.

Select the Add instance icon and provide the details to connect to your SAP HANA database. Provide the user name of USER1 and password of Password1 as well as set the schema to be HOTEL in the advanced options.
Select the Add instance icon and provide the details to connect to your SAP HANA database. Provide the user name of USER1 and password of Password1 as well as set the schema to be HOTEL in the advanced options.

Uncheck the *Verify the server's certificate using the trusted certificate below* checkbox.

![add new user1 connection](user1-connection0.png)

Expand Down Expand Up @@ -309,7 +311,9 @@ The following steps will create a sample hotel dataset using create and insert s

### Explore auto-commit

Auto-commit is a setting that when enabled, causes each SQL statement to be immediately committed to the database. When auto-commit is turned off, multiple statements can be executed and then they can all be committed together, or they can all be rolled back. There are two auto-commit settings in an SAP HANA database. The first setting which can be set in the SQL Console, applies to SQL statements that manipulate data such as insert, update, or delete statements. These types of statements are known as Data Manipulation Language (DML). The second setting can be set via SQL applies to SQL statements that modify database schema such create table statements or alter table statements. These types of statements are known as Data Definition Language (DDL).
Auto-commit is a setting that when enabled, causes each SQL statement to be immediately committed to the database. When auto-commit is turned off, multiple statements can be executed and then they can all be committed together, or they can all be rolled back. There are two auto-commit settings in an SAP HANA database.

The first setting which can be set in the SQL Console, applies to SQL statements that manipulate data such as insert, update, or delete statements. These types of statements are known as Data Manipulation Language (DML). The second setting can be set via SQL applies to SQL statements that modify database schema such create table statements or alter table statements. These types of statements are known as Data Definition Language (DDL).


The following steps will demonstrate these settings.
Expand Down Expand Up @@ -612,6 +616,8 @@ Another option for data that is accessed less frequently is the SAP HANA Data La
END;
```

Details on SQL Error codes such as 301 ERR_SQL_UNIQUE_VIOLATED can be found at ![SAP HANA Cloud, SAP HANA Database SQL Reference Guide](https://help.sap.com/docs/HANA_CLOUD_DATABASE/c1d3f60099654ecfb3fe36ac93c121bb/20a78d3275191014b41bae7c4a46d835.html).

5. To run this procedure, execute the SQL statement below.

```SQL
Expand Down
Binary file modified tutorials/hana-dbx-create-schema/user1-connection0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading