diff --git a/tutorials/hana-cloud-mission-trial-2/BTP-entitlements-ft.png b/tutorials/hana-cloud-mission-trial-2/BTP-entitlements-ft.png index 213906159..c7ec8e6fb 100644 Binary files a/tutorials/hana-cloud-mission-trial-2/BTP-entitlements-ft.png and b/tutorials/hana-cloud-mission-trial-2/BTP-entitlements-ft.png differ diff --git a/tutorials/hana-cloud-mission-trial-3/hana-cloud-mission-trial-3.md b/tutorials/hana-cloud-mission-trial-3/hana-cloud-mission-trial-3.md index fd7748dc1..6f3a17ff5 100644 --- a/tutorials/hana-cloud-mission-trial-3/hana-cloud-mission-trial-3.md +++ b/tutorials/hana-cloud-mission-trial-3/hana-cloud-mission-trial-3.md @@ -40,7 +40,7 @@ A few notes to remember about free tier instances: ### 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: diff --git a/tutorials/hana-cloud-sqltools-console/hana-cloud-sqltools-console.md b/tutorials/hana-cloud-sqltools-console/hana-cloud-sqltools-console.md index 41f2828c1..721cbd2a6 100644 --- a/tutorials/hana-cloud-sqltools-console/hana-cloud-sqltools-console.md +++ b/tutorials/hana-cloud-sqltools-console/hana-cloud-sqltools-console.md @@ -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 --- @@ -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 @@ -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) @@ -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. @@ -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 @@ -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. @@ -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. @@ -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 ------ | ------ @@ -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. @@ -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; @@ -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: @@ -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. @@ -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 @@ -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. @@ -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. @@ -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 diff --git a/tutorials/hana-cloud-sqltools-console/history-tab-columns.png b/tutorials/hana-cloud-sqltools-console/history-tab-columns.png index 957a1f738..e40302192 100644 Binary files a/tutorials/hana-cloud-sqltools-console/history-tab-columns.png and b/tutorials/hana-cloud-sqltools-console/history-tab-columns.png differ diff --git a/tutorials/hana-cloud-sqltools-console/result-behavior.png b/tutorials/hana-cloud-sqltools-console/result-behavior.png index ad65bc69b..9b8baf3cb 100644 Binary files a/tutorials/hana-cloud-sqltools-console/result-behavior.png and b/tutorials/hana-cloud-sqltools-console/result-behavior.png differ diff --git a/tutorials/hana-cloud-sqltools-console/search-through-tabs.png b/tutorials/hana-cloud-sqltools-console/search-through-tabs.png index 1392e9923..628df6a0c 100644 Binary files a/tutorials/hana-cloud-sqltools-console/search-through-tabs.png and b/tutorials/hana-cloud-sqltools-console/search-through-tabs.png differ diff --git a/tutorials/hana-cloud-sqltools-console/set-schema.png b/tutorials/hana-cloud-sqltools-console/set-schema.png index 180f4b863..6019b2078 100644 Binary files a/tutorials/hana-cloud-sqltools-console/set-schema.png and b/tutorials/hana-cloud-sqltools-console/set-schema.png differ diff --git a/tutorials/hana-cloud-sqltools-create-schema/hana-cloud-sqltools-create-schema.md b/tutorials/hana-cloud-sqltools-create-schema/hana-cloud-sqltools-create-schema.md index f1a298ea0..ebf9a90cc 100644 --- a/tutorials/hana-cloud-sqltools-create-schema/hana-cloud-sqltools-create-schema.md +++ b/tutorials/hana-cloud-sqltools-create-schema/hana-cloud-sqltools-create-schema.md @@ -1,6 +1,8 @@ --- parser: v2 auto_validation: true +author_name: Dan van Leeuwen +author_profile: https://github.com/danielva time: 15 tags: [ tutorial>beginner, software-product>sap-hana-cloud, software-product-function>sap-hana-cloud--sap-hana-database, programming-tool>sql] primary_tag: software-product>sap-hana-cloud @@ -31,7 +33,7 @@ The following steps create a sample hotel dataset using CREATE and INSERT statem 1. In SAP HANA Cloud Central, open a SQL console connected to your SAP HANA database instance. - ![Open SQL Console](open-sql-console.png) + ![Open SQL console](open-sql-console.png) The connected user is DBADMIN. In this step, you will create USER1 and USER2, which are used throughout the rest of this tutorial group. @@ -74,27 +76,27 @@ The following steps create a sample hotel dataset using CREATE and INSERT statem Privileges can be assigned to users directly or, as a better practice, assigned to a role that has a defined set of privileges. - It is recommended not to use the DBADMIN user for day-to-day operations in production environments. For additional details see [Deactivate the DBADMIN User](https://help.sap.com/docs/hana-cloud-database/sap-hana-cloud-sap-hana-database-administration-guide/deactivate-dbadmin-user). + It is not recommended to use the DBADMIN user for day-to-day operations in production environments. For additional details see [Deactivate the DBADMIN User](https://help.sap.com/docs/hana-cloud-database/sap-hana-cloud-sap-hana-database-administration-guide/deactivate-dbadmin-user). For additional details on the commands above, consult [CREATE USERGROUP Statement](https://help.sap.com/docs/hana-cloud-database/sap-hana-cloud-sap-hana-database-sql-reference-guide/create-usergroup-statement-access-control), [CREATE USER Statement](https://help.sap.com/docs/hana-cloud-database/sap-hana-cloud-sap-hana-database-sql-reference-guide/create-user-statement-access-control), [CREATE ROLE Statement](https://help.sap.com/docs/hana-cloud-database/sap-hana-cloud-sap-hana-database-sql-reference-guide/create-role-statement-access-control), and [GRANT Statement](https://help.sap.com/docs/hana-cloud-database/sap-hana-cloud-sap-hana-database-sql-reference-guide/grant-statement-access-control). > Users and roles can also be managed in SAP HANA Cloud Central under the **User & Role Management** tile in the instance detail panel. Additional details can be found at [User and Role Management](https://help.sap.com/docs/hana-cloud-database/sap-hana-cloud-sap-hana-database-administration-guide/user-and-role-management). - > ![User & Role Management in HCC](user-management.png) + > ![User & role management in SAP HANA Cloud Central](user-management.png) 3. Open a new SQL console tab by pressing the **+** in the tab bar. This time we wish to connect with USER1 and to set the schema to HOTELS so we will not use the cached credentials (DBADMIN). - Click on **Select an Instnace** and choose the SAP HANA database. + Click on **Select an Instance** and choose the SAP HANA database. - Choose **Connect ...** + Select **Connect ...** - ![Connect New User](connect-new-user.png) + ![Connect new user](connect-new-user.png) Specify USER1 and Password1. Click on **Current Schema** in the tab bar and choose **HOTELS**. - ![Change Schema](current-schema.png) + ![Change schema](current-schema.png) Alternatively, the last two actions could have performed the below SQL. @@ -103,10 +105,9 @@ The following steps create a sample hotel dataset using CREATE and INSERT statem SET SCHEMA HOTELS; ``` - The details of the connection also be found in the connection details dialog. - ![connection details](connection-details.png) + ![Connection details](connection-details.png) 4. The following example demonstrates the privilege assignments that were previously created. USER1 was granted the HOTEL_ADMIN role which has all privileges the HOTELS schema while USER2 was granted the HOTEL_READER role which has only select privileges on the HOTELS schema. Execute the below SQL and notice that USER2 does not have the privilege to perform an insert. Press Skip on the SQL Execution Error dialog so that execution continues and the TEST table is removed. @@ -213,12 +214,10 @@ Execute the below SQL and notice that USER2 does not have the privilege to perfo ``` > To find the newly created tables, open the Database Objects app, set the schema filter to **HOTELS**, and select the **Tables** tab. - - > ![Tables in Database Objects](view-tables.png) + > ![Viewing tables in Database Objects](view-tables.png) > Should you wish to examine the SQL of a table, it can be viewed after selecting a table and choosing **CREATE Statement**. - - > ![CREATE Statement](create-statement.png) + > ![CREATE statement](create-statement.png) For additional details see [CREATE TABLE Statement](https://help.sap.com/docs/hana-cloud-database/sap-hana-cloud-sap-hana-database-sql-reference-guide/create-table-statement-data-definition). @@ -328,7 +327,7 @@ Execute the below SQL and notice that USER2 does not have the privilege to perfo ### Explore auto-commit (optional) -Auto-commit is a setting that, when enabled, causes each SQL statement to be immediately committed to the database. When auto-commit is off, multiple statements can be executed and then committed or rolled back together. +Auto-commit is a setting that when enabled, causes each SQL statement to be immediately committed to the database. When auto-commit is off, multiple statements can be executed and then committed or rolled back together. There are two auto-commit settings: @@ -350,9 +349,9 @@ There are two auto-commit settings: An error will occur and the table TEST1 will exist with two rows. There is no option to rollback as DML or data manipulation language autocommit is on by default. To undo the operation, drop the table. -2. Navigate to the user settings by clicking on your profile. Then in the SQL console section set auto-commit to **off**. +2. Navigate to the user settings by clicking on your profile. Then in the SQL console section set auto-commit to **off** and press **Save**. - ![Autocommit Checkbox](auto-commit.png) + ![Autocommit checkbox](auto-commit.png) 3. Execute the following SQL. @@ -391,7 +390,7 @@ There are two auto-commit settings: INSERT INTO TEST3 VALUES (1, 'Bob'); INSERT INTO TEST3 VALUES (2, 'Sue'); SELECT * FROM TEST3; - INSERT INTO TEST3 VALUES (2, 'John'); + INSERT INTO TEST3 VALUES (2, 'John'); --fails due to duplicate primary key --DROP TABLE TEST3; --ROLLBACK; --COMMIT; @@ -522,7 +521,7 @@ Another option for less frequently accessed data is the SAP HANA data lake. Add SELECT AVERAGE_PRICE('single') from dummy; ``` - ![Average Price Function](average-price.png) + ![Average price function](average-price.png) For additional details see [User-Defined Functions](https://help.sap.com/docs/hana-cloud-database/sap-hana-cloud-sap-hana-sqlscript-reference/user-defined-functions). @@ -598,7 +597,8 @@ Another option for less frequently accessed data is the SAP HANA data lake. Add EXEC('INSERT INTO GENERATOR_LOGS (LOG) VALUES (' || val || ')'); 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/sap-hana-cloud-sap-hana-database-sql-reference-guide/sap-hana-cloud-sap-hana-database-sql-reference-guide) + + 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/sap-hana-cloud-sap-hana-database-sql-reference-guide/sql-error-codes) 5. Run the stored procedure. @@ -606,7 +606,7 @@ Another option for less frequently accessed data is the SAP HANA data lake. Add CALL RESERVATION_GENERATOR(NUMTOGENERATE => 100); ``` - ![RESERVATION_GENERATOR Procedure Output](reservation-generator.png) + ![RESERVATION_GENERATOR procedure output](reservation-generator.png) Once the procedure has been successfully executed, execute the below SQL and notice that dates both in the past and future are generated and that there are now 110 reservations. @@ -646,7 +646,7 @@ SELECT * FROM M_SCHEDULER_JOBS WHERE SCHEDULER_JOB_NAME = 'GEN_RESERVATIONS_JOB' Details about a scheduled job — including its properties, parameters, history, and CREATE statement — can be viewed in the **Database Objects** app under **Job Scheduler**. Filter by the HOTELS schema to locate the job. Navigate to **Select Object Types** to add Job Scheduler if unavailable. -![Scheduled Jobs](job-scheduler.png) +![Scheduled jobs](job-scheduler.png) For additional details see [Scheduling Administrative Tasks](https://help.sap.com/docs/hana-cloud-database/sap-hana-cloud-sap-hana-database-administration-guide/scheduling-administrative-tasks) and [CREATE SCHEDULER JOB Statement](https://help.sap.com/docs/hana-cloud-database/sap-hana-cloud-sap-hana-database-sql-reference-guide/create-scheduler-job-statement-data-definition). diff --git a/tutorials/hana-cloud-sqltools-database-objects/DbObjNav.png b/tutorials/hana-cloud-sqltools-database-objects/DbObjNav.png index be232b796..89d13d5a1 100644 Binary files a/tutorials/hana-cloud-sqltools-database-objects/DbObjNav.png and b/tutorials/hana-cloud-sqltools-database-objects/DbObjNav.png differ diff --git a/tutorials/hana-cloud-sqltools-database-objects/SettingsFunc.png b/tutorials/hana-cloud-sqltools-database-objects/SettingsFunc.png index 9d3e16b3b..a9d2782d9 100644 Binary files a/tutorials/hana-cloud-sqltools-database-objects/SettingsFunc.png and b/tutorials/hana-cloud-sqltools-database-objects/SettingsFunc.png differ diff --git a/tutorials/hana-cloud-sqltools-database-objects/hana-cloud-sqltools-database-objects.md b/tutorials/hana-cloud-sqltools-database-objects/hana-cloud-sqltools-database-objects.md index b7699d96c..5053dab38 100644 --- a/tutorials/hana-cloud-sqltools-database-objects/hana-cloud-sqltools-database-objects.md +++ b/tutorials/hana-cloud-sqltools-database-objects/hana-cloud-sqltools-database-objects.md @@ -1,18 +1,19 @@ --- parser: v2 auto_validation: true +author_name: Dan van Leeuwen +author_profile: https://github.com/danielva time: 10 -tags: [ tutorial>beginner, software-product-function>sap-hana-cloud--sap-hana-database, software-product-function>sap-hana-cloud--data-lake] +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 --- # Browse and Explore Catalog Objects with the Database Objects App - Dive into using the database objects app to explore and inspect schema objects in an SAP HANA Cloud, SAP HANA database or data lake Relational Engine. + Dive into using the Database Objects app to explore and inspect schema objects in an SAP HANA Cloud, SAP HANA database or data lake Relational Engine. ## Prerequisites -- An SAP HANA Cloud database such as SAP HANA Cloud free tier - You have completed the first 3 tutorials in this group ## You will learn @@ -23,33 +24,35 @@ primary_tag: software-product>sap-hana-cloud ## Introduction -The database objects app is a built-in application in SAP HANA Cloud Central that enables you to search, view metadata, and generate SQL for catalog objects. +The database objects app is a built-in application in SAP HANA Cloud Central that enables you to search, view metadata, and generate SQL for catalog objects. Further details can be found in the documentation at [Using Database Objects in SAP HANA Cloud Central](https://help.sap.com/docs/hana-cloud/sap-hana-cloud-administration-guide/database-objects). --- -### Filters and navigation +### Navigation and Filters -1. Ensure that your database instance is running before attempting to open the Database Objects app. Once it is started, you can access the app directly by selecting its icon from the left‑hand navigation panel on the Instances page. +1. Ensure that your database instance is running before attempting to open the Database Objects app. - ![DBObj Navigation](DbObjNav.png) + The application can be opened from the actions menu of an instance or directly from the list of applications on the left side bar of SAP HANA Cloud Central. - You can also open the database objects app through the SQL Console. Make sure you are connected to the correct database, then click the three‑dot menu in the top‑right corner and select Open Database Objects. + ![Navigation from the instances list](DbObjNav.png) - ![DBObj Navigation SQL Console](NavSQLConsole.png) + You can also open the database objects app through the SQL Console as shown below. -2. Upon opening database objects, click “Select an Instance” at the top of the page to choose the database you want to work with. You can browse the list or use the search field to quickly find your instance. + ![Navigation from the SQL console](NavSQLConsole.png) + +2. Upon opening database objects, click **Select an Instance** at the top of the page to choose the database you want to work with. You can browse the list or use the search field to quickly find your instance. ![Instances](Instances.png) - ![Select Database](SelectDatabase.png) + ![Select database](SelectDatabase.png) - Once selected, the **Schema** and **Search** filter are both available to use. Select the **Schema** filter and search for the HOTELS schema. + Once selected, the **Search** and **Schema** filters are both available to use. Select the **Schema** filter and search for the HOTELS schema. - ![Hotels Schema](SelectSchema.png) + ![Hotels schema](SelectSchema.png) You can also search for the schema or any other objects directly in the **Search** filter. In this case after searching navigate to the **Schemas** tab directly to view the metadata for the HOTELS schema. This data includes ownership, privileges and create time. - ![Schema Data](SchemaData.png) + ![Schema data](SchemaData.png) ### Explore tables @@ -59,56 +62,55 @@ Information for tables includes columns, indexes, properties, runtime informatio The page now displays all tables in the schema HOTELS and their table type. - ![Tables View](TableView.png) + ![Tables view](TableView.png) 2. Select the **RESERVATION** table to explore it further. Click the full screen icon on the top right of the screen to maximize the page and view all tabs. - ![Table Data](TableData.png) + ![Table data](TableData.png) By default you should see the column details for the table. - ![Column Data](ColumnData.png) + ![Column data](ColumnData.png) 3. Explore the **Runtime Information** tab, where further information about the table can be found. This information includes the total number of rows, disk size, partitions and memory consumption for the table, as well as individual columns. - ![Runtime Information](RuntimeInformation.png) + ![Runtime information](RuntimeInformation.png) 4. Examine the other tabs, such as **CREATE Statements**, where SQL code to generate the table can be found. - ![Create Statement](CreateStatement.png) + ![Create statement](CreateStatement.png) -5. Select the Generate SQL Statement dropdown to see the three ways to have SQL generated for the table. +5. Select the **Generate SQL Statement** dropdown to see the three ways to have SQL generated for the table. - ![SQL Generation](GenerateSQL.png) + ![SQL generation](GenerateSQL.png) ### Explore functions and procedures 1. To display functions in the Database Objects app, click on **Select Object Types** and turn on the functions object type. The visibility and order of the database objects can be customized by selecting the checkbox and dragging objects by the drag handle icon. - ![Functions Database Objects](SettingsFunc.png) - + ![Functions in the Database Objects app](SettingsFunc.png) -2. Open the **Functions** tab and select AVERAGE_PRICE to examine it further. +2. Open the **Functions** tab and select **AVERAGE_PRICE** to examine it further. - ![Average Price Function](AvgPrice.png) + ![Average price function](AvgPrice.png) - Select the Generate SQL Statement dropdown and click SELECT Statement to navigate to the SQL Console. + Select the **Generate SQL Statement** dropdown and click SELECT Statement to navigate to the SQL Console. - ![Average Price Function Generate Statement](GenerateFuncStatement.png) + ![Average price function generate statement](GenerateFuncStatement.png) - Input *'suite'* in the single quotes of the SELECT statement to get the average price for suites. + Input *suite* in the single quotes of the SELECT statement to get the average price for suites. - ![Function Call](FuncCall.png) + ![Function call](FuncCall.png) -3. Navigate back to the Database Objects app and open the **Procedure** tab. Select RESERVATION_GENERATOR to examine it further. +3. Navigate back to the Database Objects app and open the **Procedure** tab. Select **RESERVATION_GENERATOR** to examine it further. - ![Procedure Data](ProcedureData.png) + ![Procedure data](ProcedureData.png) -4. Click Generate SQL and select the CALL statement to get SQL that runs the stored procedure. +4. Click **Generate SQL** and select **CALL Statement** to get SQL that runs the stored procedure. - ![Run Procedure](Procedure.png) + ![Run procedure](Procedure.png) The following SQL will be generated: @@ -116,7 +118,7 @@ Information for tables includes columns, indexes, properties, runtime informatio CALL "HOTELS"."RESERVATION_GENERATOR"(NUMTOGENERATE => /**/) ``` - The parameter NUMTOGENERATE expects an integer value, which specifies how many reservations to generate. Replace /**/ with the desired number of reservations you want the procedure to create. + The parameter NUMTOGENERATE expects an integer value, which specifies how many reservations to generate. Replace *\* with the desired number of reservations you want the procedure to create. ### Additional features @@ -126,23 +128,17 @@ Information for tables includes columns, indexes, properties, runtime informatio 2. Navigate to an object and click the star icon on the top right of the screen to favorite it. - ![Favorite Icon](FavIcon.png) + ![Favorite icon](FavIcon.png) Once selected as a favorite, navigate to the **Favorites** tab to see it. ![Favorite](Fav.png) -3. Click All/Selected Instance toggle to filter favorites. - - ![Filter Favorites](FilterFav.png) - -4. You can also navigate to HANA Cloud Central user settings to customize preferences for the Database Objects App. - - ![settings](SettingsFunc.png) +3. Click All/Selected Instance toggle to filter between favorites for the current instance or to show all favorites. -5. The [SAP HANA database explorer extension for Microsoft Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=SAPSE.hana-database-explorer) and the SAP Business Application Studio provide a few additional features that developers may find helpful which include the ability to [view and download SAP HANA Cloud trace files](https://help.sap.com/docs/hana-cloud-database/sap-hana-cloud-sap-hana-database-developer-guide-for-cloud-foundry-multitarget-applications-sap-business-app-studio/work-with-trace-files) and the ability to [debug SQL Script](https://help.sap.com/docs/hana-cloud-database/sap-hana-cloud-sap-hana-database-developer-guide-for-cloud-foundry-multitarget-applications-sap-business-app-studio/debugging-sqlscript-in-database-explorer). + ![Filter favorites](FilterFav.png) -One additional feature that the extension provides is the ability to maintain a list connections to instances. In addition the extension for Visual Studio Code provides an option to maintain these as [local connections](https://marketplace.visualstudio.com/items?itemName=SAPSE.hana-database-explorer). +4. The [SAP HANA database explorer extension for Microsoft Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=SAPSE.hana-database-explorer) and the SAP Business Application Studio provide a few additional features that developers may find helpful which include the ability to [view and download SAP HANA Cloud trace files](https://help.sap.com/docs/hana-cloud-database/sap-hana-cloud-sap-hana-database-developer-guide-for-cloud-foundry-multitarget-applications-sap-business-app-studio/work-with-trace-files), the ability to [debug SQL Script](https://help.sap.com/docs/hana-cloud-database/sap-hana-cloud-sap-hana-database-developer-guide-for-cloud-foundry-multitarget-applications-sap-business-app-studio/debugging-sqlscript-in-database-explorer), and the ability to maintain a custom list of instances. Further details can be found at [Use the SAP HANA Database Explorer Extension in Visual Studio Code](hana-cloud-sqltools-dbx-extension). ### Knowledge check diff --git a/tutorials/hana-cloud-sqltools-db/hana-cloud-sqltools-db.md b/tutorials/hana-cloud-sqltools-db/hana-cloud-sqltools-db.md index e1ef65af9..c0a12bc1d 100644 --- a/tutorials/hana-cloud-sqltools-db/hana-cloud-sqltools-db.md +++ b/tutorials/hana-cloud-sqltools-db/hana-cloud-sqltools-db.md @@ -39,37 +39,39 @@ Instances in the list can represent an SAP HANA database, a data lake Relational ![Instances actions menu](actions_menu.png) -3. From the actions menu you can: + From the actions menu you can: - Select **Open Database Objects** to browse the catalog of this instance. - Select **Open SQL Console** to open a SQL console connected directly to this instance. - When the Database Objects app opens, use the search to specify objects that start with M_DATABASE that are in the schema **SYS**. The object type tabs, **Tables**, **Views**, **Functions**, **Procedures**, and others, let you browse objects by type. +3. When the Database Objects app opens, use the search to specify objects that start with **M_DATABASE** that are in the schema **SYS**. The object type tabs, Tables, Views, Functions, Procedures, and others, let you browse objects by type. - ![database objects app](database-objects-app.png) + ![Database Objects app](database-objects-app.png) Selecting an object such as the view M_DATABASE_HISTORY displays its details, such as column names and data types. From the detail panel you can also view the **CREATE Statement** to see the SQL used to define the object, and the **Dependencies** tab to see which objects reference it or which objects it depends on. - ![views tab](database-objects2.png) + ![Views tab](database-objects2.png) + + > The next tutorial creates the HOTELS schema and populates it with tables, views, functions, and procedures that can then be explored here. After viewing the details of the M_DATABASE_HISTORY view, return to the objects list by pressing the exit or X icon in the top right. A SQL console can also be opened directly from the Database Objects app by selecting the SQL console icon in the toolbar, which opens a console pre-connected to the same instance. - ![DB Objects](db-objects.png) - - > The next tutorial creates the HOTELS schema and populates it with tables, views, functions, and procedures that can then be explored here. + ![Open a SQL console from the Database Objects app](db-objects.png) 4. Once the SQL console is open, run the following queries to verify the connection and view basic database information. ```SQL - SELECT CURRENT_USER FROM DUMMY; + SELECT CURRENT_USER, CURRENT_SCHEMA FROM DUMMY; SELECT * FROM M_DATABASE; ``` + ![SQL console](sql-console.png) + 5. To copy the SQL endpoint, select the **Instance Information** button in the SQL Console and copy the endpoint. This is needed to connect external [clients](mission.hana-cloud-clients) or tools such as JDBC, ODBC, or a local development environment, - ![SQL Endpoint in Console](console-endpoint.png) + ![SQL endpoint](console-endpoint.png) > Additionally, you can navigate to the instances page and select **Copy SQL Endpoint** from the instance's actions menu. > ![Copy SQL endpoint](copy-sql-endpoint.png) @@ -84,7 +86,7 @@ A data lake Relational Engine is a column-oriented, disk-based relational store 2. Locate the data lake Relational Engine instance in the **Instances** list and select **Open SQL Console** from the actions menu. The default user name is **HDLADMIN**. - ![data lake](data-lake.png) + ![Data lake Relational Engine](data-lake.png) The connection details can also be copied using **Copy SQL Endpoint** from the same actions menu and used to connect from a [client](group.hana-cloud-clients-data-lake). @@ -97,7 +99,7 @@ A data lake Relational Engine is a column-oriented, disk-based relational store SELECT * FROM SYS.SYSOPTIONS WHERE UPPER("option") LIKE '%AUTO%' OR UPPER("option") LIKE '%COMM%' OR UPPER("option") LIKE '%ISOL%'; ``` - ![querying a data lake relational engine](data-lake2.png) + ![Querying a Data Lake Relational Engine](data-lake2.png) ### Access a data lake Files instance (optional) @@ -111,11 +113,11 @@ A [data lake Files instance](https://help.sap.com/docs/hana-cloud-data-lake/user 2. Once SSO is enabled, select **Open Data Lake Files** from the same actions menu, and select **Single Sign-On**. Files can be added, deleted, or viewed. When uploading files, if a path is specified that does not exist, the necessary folders will be created automatically. -3. To upload a file, select the **Upload** button and choose a file. Because SSO was enabled, you will have the option to authenticate using SSO rather than entering separate database credentials. +3. To upload a file, select the **Upload** button and choose a file. ![Upload a file](upload-data-lake-file-container.png) -3. To query structured files stored in the data lake Files instance using SQL, see [Create Virtual Tables for SQL on Files](hana-dbx-sof). +4. To query structured files stored in the data lake Files instance using SQL, see [Create Virtual Tables for SQL on Files](hana-dbx-sof). Additional details on configuring the data lake Files instance can be found at [Managing Data Lake Files](https://help.sap.com/docs/hana-cloud-data-lake/user-guide-for-data-lake-files/configuring-data-lake-files) and [Getting to know SAP HANA data lake Files](group.hana-data-lake-containers). @@ -125,13 +127,14 @@ An SAP HANA Deployment Infrastructure (HDI) container can be created using SAP B For a walkthrough of setting up a project in SAP Business Application Studio and connecting it to your database, see [Create a Development Project in SAP Business Application Studio](hana-cloud-mission-trial-8). -Once set up, you may view the container in HANA Cloud Central within the HDI Containers app, and directly open the SQL Console. -![HDI Container](hdi-containers.png) +Once set up, you may view the container in HANA Cloud Central within the HDI Containers app, and directly open the SQL Console. + +![HDI container](hdi-containers.png) For a deeper look at collaborative SAP HANA native development with HDI, see [Get Started to Collaborate in SAP Business Application Studio](hana-cloud-collaborative-database-development-1). ### Knowledge check -Congratulations! You have learned how to access SAP HANA database, data lake Relational Engine, and data lake Files instances from SAP HANA Cloud Central, and how to open SQL consoles and browse catalog objects directly from the Instances list. +Congratulations! You have learned how to access SAP HANA database, data lake Relational Engine, and data lake Files instances from SAP HANA Cloud Central, and how to open SQL consoles and browse catalog objects directly from the instances list. In the next tutorial, you will create tables, views, functions, and procedures directly in the database. diff --git a/tutorials/hana-cloud-sqltools-db/sql-console.png b/tutorials/hana-cloud-sqltools-db/sql-console.png new file mode 100644 index 000000000..628206660 Binary files /dev/null and b/tutorials/hana-cloud-sqltools-db/sql-console.png differ diff --git a/tutorials/hana-cloud-sqltools-dbx-extension/catalog_browser_dependency_viewer.png b/tutorials/hana-cloud-sqltools-dbx-extension/catalog_browser_dependency_viewer.png new file mode 100644 index 000000000..d17fb87ba Binary files /dev/null and b/tutorials/hana-cloud-sqltools-dbx-extension/catalog_browser_dependency_viewer.png differ diff --git a/tutorials/hana-cloud-sqltools-dbx-extension/cloudConnection.png b/tutorials/hana-cloud-sqltools-dbx-extension/cloudConnection.png new file mode 100644 index 000000000..6604c14d7 Binary files /dev/null and b/tutorials/hana-cloud-sqltools-dbx-extension/cloudConnection.png differ diff --git a/tutorials/hana-cloud-sqltools-dbx-extension/database_dependency_viewer.png b/tutorials/hana-cloud-sqltools-dbx-extension/database_dependency_viewer.png new file mode 100644 index 000000000..37134cd38 Binary files /dev/null and b/tutorials/hana-cloud-sqltools-dbx-extension/database_dependency_viewer.png differ diff --git a/tutorials/hana-cloud-sqltools-dbx-extension/diagnosticFiles.png b/tutorials/hana-cloud-sqltools-dbx-extension/diagnosticFiles.png new file mode 100644 index 000000000..292803b7a Binary files /dev/null and b/tutorials/hana-cloud-sqltools-dbx-extension/diagnosticFiles.png differ diff --git a/tutorials/hana-cloud-sqltools-dbx-extension/hana-cloud-sqltools-dbx-extension.md b/tutorials/hana-cloud-sqltools-dbx-extension/hana-cloud-sqltools-dbx-extension.md new file mode 100644 index 000000000..e3b04f67b --- /dev/null +++ b/tutorials/hana-cloud-sqltools-dbx-extension/hana-cloud-sqltools-dbx-extension.md @@ -0,0 +1,167 @@ +--- +author_name: Michelle Wang +author_profile: https://github.com/MichelleWangSAP +auto_validation: true +time: 15 +tags: [ tutorial>beginner, software-product>sap-hana-cloud, software-product-function>sap-hana-cloud--sap-hana-database] +primary_tag: software-product>sap-hana-cloud +parser: v2 +--- + +# Use the SAP HANA Database Explorer Extension in Visual Studio Code + + Explore the additional features provided by the SAP HANA Database Explorer extension in Visual Studio Code, including creating local connections, working with SQL files on the file system, viewing database object dependencies, and diagnosing issues with diagnostic files. + +## Prerequisites + +- You have [Visual Studio Code](https://code.visualstudio.com/) installed +- You have installed the [SAP HANA Database Explorer](https://marketplace.visualstudio.com/items?itemName=SAPSE.hana-database-explorer) extension from the Visual Studio Code Marketplace +- You have access to an SAP HANA Cloud instance (host, port, user name, and password) + +## You will learn + +- How to create a local connection to an SAP HANA Cloud instance +- How SQL can be saved to and loaded from the file system +- How to work with multiple SQL consoles side by side in Visual Studio Code +- How to view database object dependencies +- How to access and view diagnostic files + +--- + +## Intro + +The SAP HANA Database Explorer extension for Visual Studio Code provides the ability to run SQL queries and browse catalog objects directly in your development environment. This tutorial highlights features that are unique to or work particularly well in the Visual Studio Code context. + +### Install the SAP HANA Database Explorer Extension + +1. If needed, download [Visual Studio Code](https://code.visualstudio.com/download) for your computer. + +2. Open Visual Studio Code and install the [SAP HANA Database Explorer](https://marketplace.visualstudio.com/items?itemName=SAPSE.hana-database-explorer) extension from the Visual Studio Marketplace by navigating to **Extensions** and searching for **SAP HANA Database Explorer**. + + > For information about the latest features and version updates, refer to the **CHANGELOG** tab on the Marketplace page. + + ![Install extension](installExtension.png) + +3. Open the extension from the new icon in the activity bar on the left. You will see the **Database List** panel which is where connections are managed. + + ![Open extension](openExtension.png) + +--- + +### Create a Local Connection + +Local connections are added directly in Visual Studio Code by specifying the host, port, and credentials. Unlike the SAP HANA Database Explorer connections (which require logging in to Cloud Foundry), local connections work with any SAP HANA Cloud instance in any subaccount and do not require BTP or Cloud Foundry authentication. + +> You can hide the SAP HANA Database Explorer Connections section if you prefer to work only with local connections. Navigate to **Manage** > **Settings**, search for **Show Database Explorer Connections**, and deselect the checkbox. +> ![Manage Extension](manage-extension.png) + +1. In the **Database List** section, navigate to **Local Connections** and click the **+** button to **Add SAP HANA Database**. + +2. Select **SAP HANA Cloud** as the database type and enter values for **Host**, **Port**, **User**, and **Password**. You may also set a display name. This tutorial makes use of the `HOTELS` schema, in **Advanced Options** set `currentSchema=HOTELS;` + + > Enable the **Connect to database securely using TLS/SSL** checkbox to ensure the connection is secure. If you do not check **Save Password**, you will be prompted for your password each time the extension starts. + + ![Adding an SAP HANA Database](cloudConnection.png) + + A confirmation notification will appear in the bottom right corner if the database was added successfully. The connection will be listed under **Local Connections** in the Database List. + + ![Successful Connection](successfulConnection.png) + +3. To edit a connection, right-click the connection name and select **Edit Database**. + +4. To delete a connection, right-click the connection name and select **Remove Database** and confirm the deletion. + +--- + +### View Database Object Dependencies + +Database object dependencies can be visualized using a graphical dependency viewer. This can be opened in two ways: + +- By right-clicking an object in the catalog browser and choosing **Open Dependency Viewer** + + ![Catalog Browser Dependency Viewer](catalog_browser_dependency_viewer.png) + +> You can specify the object types that you wish to exclude in the viewer by clicking on the settings button and selecting types to hide. ![Hide Nodes](hide-nodes.png) + +- By right-clicking a database connection + + ![Database Dependency Viewer](database_dependency_viewer.png) + + When opened from an object, the viewer immediately shows that object's dependencies. When opened from a connection, use the **Select an object** dropdown to choose an object to visualize. + + ![Select Objects from Dependency Viewer](select_object_dv.png) + +Dependencies can be explored in both directions, incoming and outgoing. Schemas are shown as boxes surrounding objects. + +> Click an object to highlight it and its direct dependencies + ![Direct Dependencies](view_dependencies.png) + +--- + +### Work with SQL Files on the File System + +The Visual Studio Code extension allows SQL files to be loaded from and saved directly to the file system. This makes it straightforward to store SQL files in a Git repository and share common queries with teammates. + +1. Open a SQL console by right-clicking your database and selecting **Open SAP HANA SQL Console** or clicking on the icon, and click the **folder** icon to import an existing `.sql` file from your file system. + + ![Open SQL Console](openConsole.png) + +2. Edit the SQL as needed, then click the **save** icon to save your changes back to the file on disk. + + ![Make Changes and Save](saveFileButton.png) + +Because these files are stored on the file system, they can be committed to a Git repository and version-controlled alongside other project files. + +--- + +### Use Multiple SQL Consoles in Visual Studio Code + +Visual Studio Code's editor layout features work well with the SQL console, allowing you to view and work with multiple consoles at the same time. + +1. Open a SQL console from a connection in the Database List. Then open a second SQL console. + +2. Click the **split editor** icon in the top right of the editor, then drag one of the SQL console tabs into the new panel to display them side by side. + + ![Split Editor](splitEditors.png) + +3. As an alternative to splitting within the same window, you can drag a SQL console tab completely outside of Visual Studio Code to open it in its own window. + + ![New Window Editor](new_editor.png) + +--- + +### View Diagnostic Files + +Diagnostic files for an SAP HANA Cloud instance can be viewed directly within the extension. + +1. In the **Database List**, expand your database connection. + +2. Navigate to **Database Diagnostic Files**. + + ![Database Diagnostic Files](diagnosticFiles.png) + +3. Select a trace file to open and view its contents. + + ![Trace File](traceFile.png) + + > When opening a trace file, you can choose to view the entire file, a number of lines from the start of the file, or a number of lines from the end of the file. + +--- + +### Use the SAP HANA SQL Statements Collection + +The SAP HANA Database Explorer extension includes a built-in collection of SQL statements. This saves time searching for commonly needed SQL statements outside of Visual Studio Code. + +1. In the activity bar, open the SAP HANA Database Explorer extension and locate the **SAP HANA SQL Statements Collection** view. + + ![SQL Statements Collection](statement-collection.png) + +2. Browse the collection to find a statement. Click a statement to open it in a new SQL console. + +--- + +### Knowledge check + +Congratulations! You have now used the SAP HANA Database Explorer extension for Visual Studio Code and have become familiar with some of the features it provides. + +[VALIDATE_7] \ No newline at end of file diff --git a/tutorials/hana-cloud-sqltools-dbx-extension/hide-nodes.png b/tutorials/hana-cloud-sqltools-dbx-extension/hide-nodes.png new file mode 100644 index 000000000..a295cefa9 Binary files /dev/null and b/tutorials/hana-cloud-sqltools-dbx-extension/hide-nodes.png differ diff --git a/tutorials/hana-cloud-sqltools-dbx-extension/incoming-outgoing_nodes.png b/tutorials/hana-cloud-sqltools-dbx-extension/incoming-outgoing_nodes.png new file mode 100644 index 000000000..1d3586059 Binary files /dev/null and b/tutorials/hana-cloud-sqltools-dbx-extension/incoming-outgoing_nodes.png differ diff --git a/tutorials/hana-cloud-sqltools-dbx-extension/incoming_outgoing_nodes.png b/tutorials/hana-cloud-sqltools-dbx-extension/incoming_outgoing_nodes.png new file mode 100644 index 000000000..0173b1089 Binary files /dev/null and b/tutorials/hana-cloud-sqltools-dbx-extension/incoming_outgoing_nodes.png differ diff --git a/tutorials/hana-cloud-sqltools-dbx-extension/installExtension.png b/tutorials/hana-cloud-sqltools-dbx-extension/installExtension.png new file mode 100644 index 000000000..7baae08ce Binary files /dev/null and b/tutorials/hana-cloud-sqltools-dbx-extension/installExtension.png differ diff --git a/tutorials/hana-cloud-sqltools-dbx-extension/manage-extension.png b/tutorials/hana-cloud-sqltools-dbx-extension/manage-extension.png new file mode 100644 index 000000000..7eae4d65e Binary files /dev/null and b/tutorials/hana-cloud-sqltools-dbx-extension/manage-extension.png differ diff --git a/tutorials/hana-cloud-sqltools-dbx-extension/new_editor.png b/tutorials/hana-cloud-sqltools-dbx-extension/new_editor.png new file mode 100644 index 000000000..c5391da05 Binary files /dev/null and b/tutorials/hana-cloud-sqltools-dbx-extension/new_editor.png differ diff --git a/tutorials/hana-cloud-sqltools-dbx-extension/openConsole.png b/tutorials/hana-cloud-sqltools-dbx-extension/openConsole.png new file mode 100644 index 000000000..d406ba470 Binary files /dev/null and b/tutorials/hana-cloud-sqltools-dbx-extension/openConsole.png differ diff --git a/tutorials/hana-cloud-sqltools-dbx-extension/openExtension.png b/tutorials/hana-cloud-sqltools-dbx-extension/openExtension.png new file mode 100644 index 000000000..5640af1c5 Binary files /dev/null and b/tutorials/hana-cloud-sqltools-dbx-extension/openExtension.png differ diff --git a/tutorials/hana-cloud-sqltools-dbx-extension/saveFileButton.png b/tutorials/hana-cloud-sqltools-dbx-extension/saveFileButton.png new file mode 100644 index 000000000..c824cf9bd Binary files /dev/null and b/tutorials/hana-cloud-sqltools-dbx-extension/saveFileButton.png differ diff --git a/tutorials/hana-cloud-sqltools-dbx-extension/select_object_dv.png b/tutorials/hana-cloud-sqltools-dbx-extension/select_object_dv.png new file mode 100644 index 000000000..265a4370c Binary files /dev/null and b/tutorials/hana-cloud-sqltools-dbx-extension/select_object_dv.png differ diff --git a/tutorials/hana-cloud-sqltools-dbx-extension/splitEditors.png b/tutorials/hana-cloud-sqltools-dbx-extension/splitEditors.png new file mode 100644 index 000000000..4689591d1 Binary files /dev/null and b/tutorials/hana-cloud-sqltools-dbx-extension/splitEditors.png differ diff --git a/tutorials/hana-cloud-sqltools-dbx-extension/statement-collection.png b/tutorials/hana-cloud-sqltools-dbx-extension/statement-collection.png new file mode 100644 index 000000000..2bbbe3e1d Binary files /dev/null and b/tutorials/hana-cloud-sqltools-dbx-extension/statement-collection.png differ diff --git a/tutorials/hana-cloud-sqltools-dbx-extension/successfulConnection.png b/tutorials/hana-cloud-sqltools-dbx-extension/successfulConnection.png new file mode 100644 index 000000000..6527f3416 Binary files /dev/null and b/tutorials/hana-cloud-sqltools-dbx-extension/successfulConnection.png differ diff --git a/tutorials/hana-cloud-sqltools-dbx-extension/traceFile.png b/tutorials/hana-cloud-sqltools-dbx-extension/traceFile.png new file mode 100644 index 000000000..a2ee1f30f Binary files /dev/null and b/tutorials/hana-cloud-sqltools-dbx-extension/traceFile.png differ diff --git a/tutorials/hana-cloud-sqltools-dbx-extension/view_dependencies.png b/tutorials/hana-cloud-sqltools-dbx-extension/view_dependencies.png new file mode 100644 index 000000000..c9fcfa86f Binary files /dev/null and b/tutorials/hana-cloud-sqltools-dbx-extension/view_dependencies.png differ diff --git a/tutorials/hana-cloud-sqltools-import-export/catalog-import.png b/tutorials/hana-cloud-sqltools-import-export/catalog-import.png index d4daa39bf..d24164558 100644 Binary files a/tutorials/hana-cloud-sqltools-import-export/catalog-import.png and b/tutorials/hana-cloud-sqltools-import-export/catalog-import.png differ diff --git a/tutorials/hana-cloud-sqltools-import-export/catalog-selection.png b/tutorials/hana-cloud-sqltools-import-export/catalog-selection.png index 3b88c09e2..5a698de68 100644 Binary files a/tutorials/hana-cloud-sqltools-import-export/catalog-selection.png and b/tutorials/hana-cloud-sqltools-import-export/catalog-selection.png differ diff --git a/tutorials/hana-cloud-sqltools-import-export/hana-cloud-sqltools-import-export.md b/tutorials/hana-cloud-sqltools-import-export/hana-cloud-sqltools-import-export.md index 36c4bfa9d..bd9feb7b0 100644 --- a/tutorials/hana-cloud-sqltools-import-export/hana-cloud-sqltools-import-export.md +++ b/tutorials/hana-cloud-sqltools-import-export/hana-cloud-sqltools-import-export.md @@ -33,7 +33,7 @@ For a broader overview of all export and import options available, including loc ### Export and import data -The following steps demonstrate how to export and import data from the MAINTENANCE table using the SQL console download option and the import data wizard in SAP HANA Cloud Central. For use with larger amounts of data, it is recommended to use a cloud storage provider such as SAP HANA Cloud data lake Files which is shown in the next step. +The following steps demonstrate how to export and import data from the MAINTENANCE table using the SQL console download option and the import data wizard in SAP HANA Cloud Central. For use with larger amounts of data, it is recommended to use a cloud storage provider such as SAP HANA Cloud data lake Files which is used in subsequent steps of this tutorial. 1. Enter the SQL statement below in the SQL console. @@ -47,7 +47,7 @@ The following steps demonstrate how to export and import data from the MAINTENAN >There is a setting that controls the number of results displayed which may need to be adjusted for tables with larger results. > - > ![Max Rows](max-rows.png) + > ![Max rows](max-rows.png) 2. Enter the SQL statement below to delete the rows in the table. They will be added back in the next step. @@ -61,17 +61,19 @@ The following steps demonstrate how to export and import data from the MAINTENAN 5. In **Source Data**, select **Local Computer** and browse to the previously downloaded CSV file. - ![Local Import](local-import.png) + ![Local import](local-import.png) 6. In **Target Table**, select **Use Existing Table**, choose the **HOTELS** schema, and select the **MAINTENANCE** table. Complete the remaining steps of the wizard and click **Import**. + ![Select where the data will be imported to](target-table.png) + After completing the wizard, the contents of the MAINTENANCE table should be the same as before the delete statement was executed. Run the following SQL statement to confirm. ```SQL SELECT * FROM HOTELS.MAINTENANCE; ``` - ![Maintenance Table](maintenance-table.png) + ![Maintenance table](maintenance-table.png) ### Export and import data from an SAP HANA Cloud, SAP HANA database (optional) @@ -80,7 +82,7 @@ The following steps walk through the process of exporting data to and importing SQL Statements used: | Statement | Target | Format | -| -------|--------|-----------| +| --------- | ------ | ------ | | [Export INTO](https://help.sap.com/docs/hana-cloud-database/sap-hana-cloud-sap-hana-database-sql-reference-guide/export-into-statement-data-import-export) | Data lake Files, S3, Azure, GCS | CSV, Parquet, JSON | | [Import FROM](https://help.sap.com/docs/hana-cloud-database/sap-hana-cloud-sap-hana-database-sql-reference-guide/import-from-statement-data-import-export) | Data lake Files, S3, Azure, GCS | CSV, Parquet, JSON | @@ -125,7 +127,7 @@ SQL Statements used: SELECT CERTIFICATE_ID FROM CERTIFICATES WHERE COMMENT = 'SAP_HC'; ``` - Remove the comma and add the certificate ID (ex: 123456) from the previous statement into ``. + Add the certificate ID (ex: 123456) from the previous statement into ``. ```SQL ALTER PSE HTTPS ADD CERTIFICATE ; @@ -154,42 +156,48 @@ SQL Statements used: Navigate to the **Import and Export** app and choose **Export Data**. - ![Import and Export App](import-export-app.png) + ![Import and Export app](import-export-app.png) 5. In **Source Instance**, select the SAP HANA database instance you want to export data from. 6. Navigate to **Source Data**, select **Data File** as the export type, choose **HOTELS** as the schema, and select the **MAINTENANCE** table as the database object. - ![Source Data](export-source-data.png) + ![Source data](export-source-data.png) 7. For **Target Instance**, select **Data Lake Files** as the export destination. Enter **DL_FILES** as the credential purpose and provide the REST API endpoint of your data lake Files instance. Enter the file path (e.g. `HOTELS/maintenance.csv`). > The REST API endpoint can be copied by clicking the three dots in the **Actions** column next to your data lake Files instance. > - > ![Data Lake Endpoint](rest-api-endpoint.png) - - ![Target Instance](export-target-instance.png) - - Complete the remaining export options and click **Export**. Verify that the export was successful in the Import and Export app, under Exports. - - ![Export Successful](export-successful.png) + > ![Data lake endpoint](rest-api-endpoint.png) -8. The wizard makes use of the `EXPORT INTO` statement. An example is shown below: + ![Target instance](export-target-instance.png) - ```SQL - EXPORT INTO CSV FILE - 'hdlfs://1234-567-890-1234-56789.files.hdl.prod-us10.hanacloud.ondemand.com/HOTELS/maintenance.csv' - FROM MAINTENANCE - WITH - CREDENTIAL 'DL_FILES' - COLUMN LIST IN FIRST ROW; - ``` + Complete the remaining export options and click **Export**. >On the final screen of the wizard, you can select **View Generated SQL** to see the SQL statement that will be executed. > >![Generated SQL](generated-sql.png) -9. Delete the rows from the table. They will be restored in the next step. + Verify that the export was successful in the Import and Export app, under Exports. + + ![Export successful](export-successful.png) + + You can also use the data lake Files app to view the contents of the exported file. + + ![maintenance csv](maint.png) + +8. The wizard makes use of the `EXPORT INTO` statement. An example is shown below: + + ```SQL + EXPORT INTO CSV FILE + 'hdlfs://1234-567-890-1234-56789.files.hdl.prod-us10.hanacloud.ondemand.com/HOTELS/maintenance.csv' + FROM MAINTENANCE + WITH + CREDENTIAL 'DL_FILES' + COLUMN LIST IN FIRST ROW; + ``` + +9. In a SQL console connected to the SAP HANA database, delete the rows from the table. They will be restored in the next step. ```SQL DELETE FROM HOTELS.MAINTENANCE; @@ -201,7 +209,7 @@ SQL Statements used: 12. Under **Source Data**, select **Data Lake Files** as the source type. Enter **DL_FILES** as the database credential, provide the REST API endpoint of your data lake Files instance (which can be copied by clicking the **three dots** in the **Actions** column next to your data lake Files instance in SAP HANA Cloud Central), and enter the file path (e.g. `HOTELS/maintenance.csv`). - ![Source Data](import-source-data.png) + ![Source data](import-source-data.png) 13. In **Target Table** select **Use Existing Table** and choose the **HOTELS** schema and **MAINTENANCE** table. @@ -218,7 +226,7 @@ SQL Statements used: You can verify the success of the export or import operation by navigating to the **Import and Export** app and reviewing the job history and by executing a select against the table. - ![Import Export Success](successful-import-export.png) + ![Import export success](successful-import-export.png) ```SQL SELECT * FROM HOTELS.MAINTENANCE; @@ -231,7 +239,7 @@ The following steps walk through exporting to and importing data from data lake SQL Statements used: | Statement | Target | Format | -| -------|--------|-----------| +| --------- | ------ | ------ | | [Unload](https://help.sap.com/docs/hana-cloud-data-lake/sql-reference-for-data-lake-relational-engine/unload-statement-for-data-lake-relational-engine) | Data lake Files, S3, Azure, GCS | Parquet, Text, Binary | | [Load](https://help.sap.com/docs/hana-cloud-data-lake/sql-reference-for-data-lake-relational-engine/load-table-statement-for-data-lake-relational-engine) | Data lake Files, S3, Azure, GCS | Parquet, ASCII, Binary | @@ -295,24 +303,20 @@ SQL Statements used: 2. The HOTELS schema and MAINTENANCE table are not automatically shared with the Relational Engine. If the schema does not already exist, create it manually in the Relational Engine SQL console. - ```SQL - CREATE SCHEMA HOTELS; - CREATE TABLE HOTELS.MAINTENANCE ( - MNO INTEGER NOT NULL, - HNO INTEGER NOT NULL, - DESCRIPTION VARCHAR(100), - DATE_PERFORMED DATE, - PERFORMED_BY VARCHAR(40) - ); - ``` - - Ensure you are in the HOTELS schema before performing the following inserts. - - ```SQL - INSERT INTO MAINTENANCE VALUES(10, 24, 'Replace pool liner and pump', '2019-03-21', 'Discount Pool Supplies'); - INSERT INTO MAINTENANCE VALUES(11, 25, 'Renovate the bar area. Replace TV and speakers', '2020-11-29', 'TV and Audio Superstore'); - INSERT INTO MAINTENANCE VALUES(12, 26, 'Roof repair due to storm', null, null); - ``` + ```SQL + CREATE SCHEMA HOTELS; + CREATE TABLE HOTELS.MAINTENANCE ( + MNO INTEGER NOT NULL, + HNO INTEGER NOT NULL, + DESCRIPTION VARCHAR(100), + DATE_PERFORMED DATE, + PERFORMED_BY VARCHAR(40) + ); + + INSERT INTO HOTELS.MAINTENANCE VALUES(10, 24, 'Replace pool liner and pump', '2019-03-21', 'Discount Pool Supplies'); + INSERT INTO HOTELS.MAINTENANCE VALUES(11, 25, 'Renovate the bar area. Replace TV and speakers', '2020-11-29', 'TV and Audio Superstore'); + INSERT INTO HOTELS.MAINTENANCE VALUES(12, 26, 'Roof repair due to storm', null, null); + ``` 3. Export (unload) the data from the `MAINTENANCE` table to data lake Files using the export data wizard or the SQL statement below. @@ -328,21 +332,21 @@ SQL Statements used: >Export or unload the data from the MAINTENANCE table to a data lake Files instance using the SQL statement. The below example targets the data lake Files instance that is attached to the data lake Relational Engine. - ```SQL - UNLOAD SELECT * FROM HOTELS.MAINTENANCE - INTO FILE 'hdlfs:///maint.csv' - NULL FORMAT EMPTY - ``` + ```SQL + UNLOAD SELECT * FROM HOTELS.MAINTENANCE + INTO FILE 'hdlfs:///maint.csv' + NULL FORMAT EMPTY + ``` The below example targets a different data lake Files instance. - ```SQL - UNLOAD SELECT * FROM HOTELS.MAINTENANCE - INTO FILE 'hdlfs://18b4be74-a4f1-40a0-a357-60155aee5f30/maint.csv' - CONNECTION_STRING 'ENDPOINT=https://18b4be74-a4f1-40a0-a357-60155aee5f30.files.hdl.prod-ca10.hanacloud.ondemand.com' - WITH CREDENTIAL 'DL_FILES' - NULL FORMAT EMPTY; - ``` + ```SQL + UNLOAD SELECT * FROM HOTELS.MAINTENANCE + INTO FILE 'hdlfs://18b4be74-a4f1-40a0-a357-60155aee5f30/maint.csv' + CONNECTION_STRING 'ENDPOINT=https://18b4be74-a4f1-40a0-a357-60155aee5f30.files.hdl.prod-ca10.hanacloud.ondemand.com' + WITH CREDENTIAL 'DL_FILES' + NULL FORMAT EMPTY; + ``` 7. Import (load) the data back into the `MAINTENANCE` table using the import data wizard or the SQL statement below. @@ -386,49 +390,52 @@ SQL Statements used: ### Export and import schema or catalog objects (optional) -Similar to the previous examples, the MAINTENANCE table will be exported and re-imported to an SAP HANA Cloud database. The export catalog wizard and export statement can include multiple objects in the export or import, include additional object types such as functions and procedures, and can include the SQL statements to recreate the objects. +The export catalog wizard and export statement can include multiple objects in the export or import such as tables, views, functions, and procedures. The operation can also recreated the schema of the objects. The following tables list the different options available in SAP HANA Cloud Central to export and import catalog objects. SQL Statements used: | Statement | Target | Format | -| -------|--------|-----------| +| --------- | ------ | ------ | | [Export](https://help.sap.com/docs/hana-cloud-database/sap-hana-cloud-sap-hana-database-sql-reference-guide/export-statement-data-import-export) | Data lake Files, S3, Azure, GCS | Binary, CSV, Parquet | | [Import](https://help.sap.com/docs/hana-cloud-database/sap-hana-cloud-sap-hana-database-sql-reference-guide/import-statement-data-import-export) | Data lake Files, S3, Azure, GCS | Binary, CSV, Parquet | To try these out, follow the steps below. -1. Navigate to the **Import and Export** app and connect to the desired SAP HANA instance you want to export data from. Under **Source Data**, select **Database Objects**. Navigate to the **Add Database Objects** button and search for **Maintenance**. Notice how you can select multiple object types. +1. Navigate to the **Import and Export** app and connect to the desired SAP HANA instance you want to export data from. Under **Source Data**, select **Database Objects**. Navigate to the **Add Database Objects** button and search for the schema **HOTELS**. Notice how you can select multiple object types. In this example we are exporting all of the objects that are part of the HOTELS schema. Select **Add to List**. - ![Export Catalog Objects Wizard](catalog-selection.png) + ![Export catalog objects wizard](catalog-selection.png) - Choose **Local Computer** for the export location and provide a name for the archive. Next, select an export format such as CSV, and click **Export**. + Choose **Local Computer** for the export location and provide a name for the archive. - ![Export Options](export-options.png) + ![Target settings]](target.png) - > **Binary Raw** is the binary format for SAP HANA Cloud and **Binary Data** is the format option for SAP HANA as a Service and SAP HANA on-premise. + Next, select an export format such as CSV, and click **Export**. + + ![Export options](export-options.png) + + > **Binary Raw** is the binary format for SAP HANA Cloud and **Binary Data** is the format option for SAP HANA on-premise. 2. The archive file contains the SQL to recreate the table as well as the data of the table. -3. Enter the SQL statement below to drop the table. It will be added back in the next step. +3. Enter the SQL statement below to drop all of the objects in the schema. They will then be re-added in the next sub-step. ```SQL - DROP TABLE HOTELS.MAINTENANCE; + DROP SCHEMA HOTELS CASCADE; ``` -4. Navigate to the **Import and Export** app and choose **Import Database Objects**. Browse to the previously downloaded archive file and complete the wizard. +4. Navigate to the **Import and Export** app and choose **Import Database Objects**. Browse to the previously downloaded archive file and complete the wizard. - ![Import Catalog Wizard](catalog-import.png) + ![Import catalog wizard](catalog-import.png) - You can also rename the schema if desired. + ![Adding objects to the import](rename-schema.png) - ![Rename Schema](rename-schema.png) - - The contents of the MAINTENANCE table should now be the same as before the drop statement was executed. + The contents of the HOTELS schema should now be the same as before the drop statement was executed. ```SQL - SELECT * FROM HOTELS.MAINTENANCE; + SELECT * FROM HOTELS.CUSTOMER; + SELECT * FROM HOTELS.HOTEL; ``` ### Knowledge check diff --git a/tutorials/hana-cloud-sqltools-import-export/maint.png b/tutorials/hana-cloud-sqltools-import-export/maint.png new file mode 100644 index 000000000..2eee8e885 Binary files /dev/null and b/tutorials/hana-cloud-sqltools-import-export/maint.png differ diff --git a/tutorials/hana-cloud-sqltools-import-export/rename-schema.png b/tutorials/hana-cloud-sqltools-import-export/rename-schema.png index 92736277d..09a8af3b4 100644 Binary files a/tutorials/hana-cloud-sqltools-import-export/rename-schema.png and b/tutorials/hana-cloud-sqltools-import-export/rename-schema.png differ diff --git a/tutorials/hana-cloud-sqltools-import-export/target-table.png b/tutorials/hana-cloud-sqltools-import-export/target-table.png new file mode 100644 index 000000000..6ef018397 Binary files /dev/null and b/tutorials/hana-cloud-sqltools-import-export/target-table.png differ diff --git a/tutorials/hana-cloud-sqltools-import-export/target.png b/tutorials/hana-cloud-sqltools-import-export/target.png new file mode 100644 index 000000000..c40493055 Binary files /dev/null and b/tutorials/hana-cloud-sqltools-import-export/target.png differ diff --git a/tutorials/hana-cloud-sqltools-multi-model/hana-cloud-sqltools-multi-model.md b/tutorials/hana-cloud-sqltools-multi-model/hana-cloud-sqltools-multi-model.md index d7e3cd47d..3b4759c4a 100644 --- a/tutorials/hana-cloud-sqltools-multi-model/hana-cloud-sqltools-multi-model.md +++ b/tutorials/hana-cloud-sqltools-multi-model/hana-cloud-sqltools-multi-model.md @@ -1,8 +1,10 @@ --- parser: v2 auto_validation: true +author_name: Dan van Leeuwen +author_profile: https://github.com/danielva time: 15 -tags: [ tutorial>beginner, software-product-function>sap-hana-cloud--sap-hana-database, software-product>sap-hana, software-product>sap-hana--express-edition, software-product-function>sap-hana-multi-model-processing, software-product-function>sap-hana-spatial, software-product-function>sap-hana-graph, tutorial>license] +tags: [ tutorial>beginner, software-product>sap-hana-cloud, software-product-function>sap-hana-cloud--sap-hana-database, software-product-function>sap-hana-multi-model-processing, software-product-function>sap-hana-spatial, software-product-function>sap-hana-graph, tutorial>license] primary_tag: software-product>sap-hana-cloud --- @@ -19,7 +21,7 @@ primary_tag: software-product>sap-hana-cloud - How to create and explore a knowledge graph, a property graph, a document store, and spatial data -## Intro +## Overview A [knowledge graph](https://help.sap.com/docs/hana-cloud-database/sap-hana-cloud-sap-hana-database-knowledge-graph-guide/sap-hana-cloud-sap-hana-database-knowledge-graph-engine-guide) can be used to store facts in triples providing additional meaning and relationships. @@ -157,17 +159,17 @@ Before you can create a knowledge graph, please ensure your instance has the tri ); ``` - Additional examples can be found at [SAP HANA Cloud, SAP HANA Database SPARQL Reference Guide](https://help.sap.com/docs/hana-cloud-database/sap-hana-cloud-sap-hana-database-sparql-reference-guide/sap-hana-cloud-sap-hana-database-sparql-reference-guide) + Additional examples can be found at [SAP HANA Cloud, SAP HANA Database SPARQL Reference Guide](https://help.sap.com/docs/hana-cloud-database/sap-hana-cloud-sap-hana-database-sparql-reference-guide/sap-hana-cloud-sap-hana-database-sparql-reference-guide). -4. To visualize and examine the knowledge graph database objects, you must first enable the feature in your preferences. Click on your account +4. To visualize and examine the knowledge graph database objects, you must first enable the feature in your preferences. Click on your account. ![Account Settings](go_preferences_RDF.png) - Go to the Database Objects tab + Go to the Database Objects tab. ![Database Objects Tab](go_database_objects.png) - Enable RDF Named Graphs + Enable RDF Named Graphs. ![Enable RDF Graphs](enable_RDF_graphs.png) @@ -319,13 +321,13 @@ For additional information, see [SAP HANA Cloud, SAP HANA Database Graph Referen In the steps above, the property graph viewer was used to visualize hotel distances, filter by state and distance, highlight specific vertices, and view details on individual vertices and edges. -Additional property graph examples include the [Greek Mythology Graph Example](https://help.sap.com/viewer/f381aa9c4b99457fb3c6b53a2fd29c02/2.0.04/en-US/071d7b7349f04e419507387c271dce8f.html) and [Open Flights](https://help.sap.com/docs/hana-cloud-database/sap-hana-cloud-sap-hana-database-graph-reference/appendix-open-flights-and-company-graph-examples). The company graph example does not currently display in the viewer as it does not currently support the display of homogeneous graphs. Property graph workspaces may also be viewed using the [SAP HANA plug-in for Cytoscape](https://github.com/SAP/sap-hana-plugin-for-cytoscape). +Additional property graph examples include the [Greek Mythology Graph Example](https://help.sap.com/viewer/f381aa9c4b99457fb3c6b53a2fd29c02/2.0.04/en-US/071d7b7349f04e419507387c271dce8f.html) and [Open Flights](https://help.sap.com/docs/hana-cloud-database/sap-hana-cloud-sap-hana-database-graph-reference/appendix-open-flights-and-company-graph-examples). Property graph workspaces may also be viewed using the [SAP HANA plug-in for Cytoscape](https://github.com/SAP/sap-hana-plugin-for-cytoscape). ### Use property graph algorithms The shortest path algorithm can be used to provide the optimal route between two vertices. The nearest neighbor algorithm can be used to show only the vertices that are connected to a specified vertex. -The following steps will walk through using the shortest path algorithm to determine the optimal route from Airport Hotel in Rosemont, IL to Regency Hotel in Seattle, WA. +The following steps will walk through using the shortest path algorithm to determine the optimal route from Airport Hotel in Rosemont Illinois to the Regency Hotel in Seattle Washington. 1. Execute the following in SQL to add a few connections between hotels in different states. @@ -355,7 +357,7 @@ The following steps will walk through using the shortest path algorithm to deter INSERT INTO DISTANCES VALUES (40,21,20,4348); ``` -2. After removing the previously applied filters, navigate to the property graph viewer, and select the algorithms tab. Update the Algorithm field to "Shortest Path", specify the values shown below, and click Apply. +2. After removing the previously applied filters, navigate to the property graph viewer, and select the algorithms tab. Update the Algorithm field to "Shortest Path", specify the values shown below, and click **Apply**. ![Graph Algorithms](graph-algorithms.png) @@ -509,7 +511,7 @@ Additional details can be found at [hana_ml.docstore package](https://help.sap.c ### Import spatial data -This step will import an [`ESRI shapefile`](https://help.sap.com/docs/hana-cloud-database/sap-hana-cloud-sap-hana-database-spatial-reference/support-for-esri-shapefiles) or optionally a `GeoJSON` file containing points of interest in the city of Waterloo Ontario. The `ESRI shapefile` import will result in a table while the JSON import will result in a JSON Collection. In the following step, a search will be performed to return the closest points of interest to the Delta hotel located in Waterloo. +This step will import an [`ESRI shapefile`](https://help.sap.com/docs/hana-cloud-database/sap-hana-cloud-sap-hana-database-spatial-reference/support-for-esri-shapefiles) or optionally a `GeoJSON` file containing points of interest in the city of Waterloo, Ontario. The `ESRI shapefile` import will result in a table while the JSON import will result in a JSON Collection. In the following step, a search will be performed to return the closest points of interest to the Delta hotel located in Waterloo. 1. At the [ARCGIS Hub](https://hub.arcgis.com/search), search for **`Points of Interest Waterloo`**. Scroll through the results and choose the selection below. @@ -519,7 +521,7 @@ This step will import an [`ESRI shapefile`](https://help.sap.com/docs/hana-cloud ![download shapefile](download-shapefile.png) -3. Unzip the downloaded `shapefile`. Upload all of the extracted files (`Points_of_Interest.shp`, `.dbf`, `.prj`, `.shx`, `.cpg`, `.xml`) to your data lake Files instance using by navigating to the Data Lake Files app, selecting the desired file, and using the upload button. +3. Unzip the downloaded `shapefile`. Upload all of the extracted files (`Points_of_Interest.shp`, `.dbf`, `.prj`, `.shx`, `.cpg`, `.xml`) to your data lake Files instance using by navigating to the data lake Files app, selecting the desired file, and using the upload button. >The `IMPORT AS SHAPEFILE` SQL requires the individual shapefile components to be present in data lake Files — not the `.zip` file. @@ -595,6 +597,6 @@ This step will import an [`ESRI shapefile`](https://help.sap.com/docs/hana-cloud ### Knowledge check -Congratulations! You have explored a few of the multi-model features in SAP HANA and are now familiar with graph workspaces, JSON collections, and spatial data when using the SAP HANA database explorer. +Congratulations! You have explored a few of the multi-model features in SAP HANA and are now familiar with knowledge graphs, graph workspaces, JSON collections, and spatial data. --- diff --git a/tutorials/hana-cloud-sqltools-overview/hana-cloud-sqltools-overview.md b/tutorials/hana-cloud-sqltools-overview/hana-cloud-sqltools-overview.md index 7435bcbdd..9e7f7cfc9 100644 --- a/tutorials/hana-cloud-sqltools-overview/hana-cloud-sqltools-overview.md +++ b/tutorials/hana-cloud-sqltools-overview/hana-cloud-sqltools-overview.md @@ -25,10 +25,6 @@ parser: v2 --- -## Intro - -> Access help from the SAP community or provide feedback on this tutorial by navigating to the "Feedback" link located on the top right of this page. - ### SAP HANA Cloud Overview [SAP HANA Cloud](https://www.sap.com/products/data-cloud/hana.html) lets you use advanced data processing capabilities of relational, JSON, text, spatial, predictive, vector, knowledge graph, and more, to pull insights from all types of data. @@ -37,12 +33,11 @@ By combining in-memory storage with columnar store, data operations are performe The following are some related documentation links for SAP HANA Cloud. - -| :------------- | :------------- | -| Version | Notes | -| [SAP HANA Cloud](https://help.sap.com/docs/hana-cloud) | Product documentation page | -| [SAP HANA Cloud Administration Guide](https://help.sap.com/docs/hana-cloud/sap-hana-cloud-administration-guide/sap-hana-cloud-administration-guide) | Administration tasks performed in SAP HANA Cloud Central | -| [Understand How the SAP HANA Cloud Free Tier Service can be Used in a SAP BTP Trial or Productive Account](hana-cloud-mission-trial-1)| Overview of SAP HANA Cloud free tier service plan and the SAP BTP account options available | +| Version | Notes | +| ------- | ----- | +| [SAP HANA Cloud](https://help.sap.com/docs/hana-cloud) | Product documentation page | +| [SAP HANA Cloud Administration Guide](https://help.sap.com/docs/hana-cloud/sap-hana-cloud-administration-guide/sap-hana-cloud-administration-guide) | Administration tasks performed in SAP HANA Cloud Central | +| [Understand How the SAP HANA Cloud Free Tier Service can be Used in a SAP BTP Trial or Productive Account](hana-cloud-mission-trial-1) | Overview of SAP HANA Cloud free tier service plan and the SAP BTP account options available | ### What this tutorial group covers @@ -61,7 +56,7 @@ To complete the tutorials in this group, an SAP HANA Cloud instance is needed. C The SAP BTP Trial is available on the US10 and AP21 landscapes, and includes the SAP HANA Cloud free tier service. If a free tier instance is used in a productive subaccount, a seamless transition from a free tier to a paid plan is available. -> The SAP HANA Cloud Basic Trial provides a database user and password that has access to a specific schema free for 30 days. The provided database user can be used to create database objects within the provided schema but cannot create new schemas or users. To get started, click on **Try Now** on the Discover SAP HANA Cloud section of the trial page of [SAP HANA Cloud](https://www.sap.com/products/technology-platform/hana/trial.html). The SAP HANA Cloud Basic Trial does not provide access to SAP HANA Cloud Central or the SQL Console in SAP HANA Cloud Central and for that reason, it is not recommended to be used for this tutorial group. +> The SAP HANA Cloud Basic Trial does not provide access to SAP HANA Cloud Central or the SQL Console in SAP HANA Cloud Central and for that reason, it is recommended instead to use the advanced trial for this tutorial group. ### Provision and manage an instance @@ -71,7 +66,7 @@ The full provisioning walkthrough — including how to open SAP HANA Cloud Centr Complete that tutorial and return here once your instance shows a **Running** status in SAP HANA Cloud Central. -![Instance Running](instances-running.png) +![Instance running](instances-running.png) > SAP HANA Cloud free tier instances are shut down overnight (i.e. 10:00 PM based on the location where your instance was provisioned) and will need to be restarted before working with them the next day. The tutorial group [Automating SAP HANA Cloud Tasks](https://developers.sap.com/group.sap-hana-cloud-automating.html) provides some examples of using tools such as the BTP CLI or the SAP Automation Pilot to help with repetitive tasks such as starting and stopping instances. diff --git a/tutorials/hana-cloud-sqltools-remote-sources/hana-cloud-sqltools-remote-sources.md b/tutorials/hana-cloud-sqltools-remote-sources/hana-cloud-sqltools-remote-sources.md index ea3c82ac5..6d8edf8c1 100644 --- a/tutorials/hana-cloud-sqltools-remote-sources/hana-cloud-sqltools-remote-sources.md +++ b/tutorials/hana-cloud-sqltools-remote-sources/hana-cloud-sqltools-remote-sources.md @@ -1,8 +1,10 @@ --- parser: v2 auto_validation: true +author_name: Dan van Leeuwen +author_profile: https://github.com/danielva time: 10 -tags: [ tutorial>beginner, software-product-function>sap-hana-cloud--sap-hana-database, software-product>sap-hana, software-product-function>sap-hana-cloud--data-lake] +tags: [ tutorial>beginner, software-product>sap-hana-cloud, software-product-function>sap-hana-cloud--sap-hana-database, software-product>sap-hana, software-product-function>sap-hana-cloud--data-lake] primary_tag: software-product>sap-hana-cloud --- @@ -40,7 +42,7 @@ The example in step 1 demonstrates a connection from one SAP HANA Cloud, SAP HAN Two SAP HANA Cloud, SAP HANA database instances can be connected so that one can query data from the other in real time using virtual tables, without copying or moving data. -![Virtual Table Diagram](virtual-table-diagram.png) +![SAP HANA database connecting virtually to another SAP HANA database](virtual-table-diagram.png) 1. In SAP HANA Cloud Central, select an SAP HANA database (HDB) instance (the one you want to connect *to*), and execute the following SQL statements to create the `tourist_reviews` table. @@ -69,10 +71,10 @@ Two SAP HANA Cloud, SAP HANA database instances can be connected so that one can 2. The result can be seen below. ```SQL - SELECT * FROM TOURIST_REVIEWS + SELECT * FROM TOURIST_REVIEWS; ``` - ![Select All](select-all.png) + ![Select all](select-all.png) 3. To create a remote source to SAP HANA Cloud, open another SAP HANA database. @@ -89,21 +91,21 @@ Two SAP HANA Cloud, SAP HANA database instances can be connected so that one can For the Database Source Type, select **SAP HANA Cloud, SAP HANA Database**. - Add a source name and specify the server, port, and credentials (USER1, Password1). The Extra Adapter properties can be retreived by copying the `sslTrustStore` in the SQL query above. + Add a source name and specify the server, port, and credentials (USER1, Password1). The Extra Adapter properties can be retrieved by copying the `sslTrustStore` in the SQL query above. - ![Creatomg a Remote Source Using the UI](remote-source-table.png) + ![Create a remote source using the UI](remote-source-table.png) Additional details can be found at [CREATE REMOTE SOURCE Statement](https://help.sap.com/docs/hana-cloud-database/sap-hana-cloud-sap-hana-database-sql-reference-guide/create-remote-source-statement-access-control) If the above command fails, one reason might be that an allowlist has been set on the SAP HANA Cloud instance. This can be seen by choosing Actions > Manage Configuration > Connections. - ![Allow All IP Addresses](allow-all.png) + ![Allow all IP addresses](allow-all.png) The public root certificate of the certificate authority (CA) that signed the SAP HANA Cloud instance’s server certificate is required in the `sslTrustStore` parameter. For more information, see [Secure Communication Between SAP HANA Cloud and JDBC/ODBC Clients](https://help.sap.com/docs/hana-cloud-database/sap-hana-cloud-sap-hana-database-security-guide/secure-communication-between-sap-hana-and-sap-hana-clients). 5. A virtual table named `vt_tourist_reviews` will be created in the SAP HANA database you are connecting from. This will enable access to the `tourist_reviews` table that was created in SAP HANA Cloud. This can be visualized as follows: - Open the SAP HANA database you wish to connect from. + Open the SAP HANA database you wish to connect from. > If needed, create the HOTELS schema and a user who can access the schema. @@ -118,9 +120,10 @@ Two SAP HANA Cloud, SAP HANA database instances can be connected so that one can ```SQL CREATE VIRTUAL TABLE VT_TOURIST_REVIEWS AT "REMOTE_HC"."HC_HDB".HOTELS."TOURIST_REVIEWS"; ``` + Additional details can be found at [CREATE VIRTUAL TABLE STATEMENT](https://help.sap.com/docs/hana-cloud-database/sap-hana-cloud-sap-hana-database-sql-reference-guide/create-virtual-table-statement-data-definition) -7. Perform queries against the local tables, the remote table, and perform a federated query that contains both local and remote tables. +7. Perform queries against the local tables, the remote table, and perform a federated query that contains both local and remote tables. ```SQL SELECT * FROM HOTELS.RESERVATION; @@ -141,7 +144,7 @@ Two SAP HANA Cloud, SAP HANA database instances can be connected so that one can SELECT * FROM VT_TOURIST_REVIEWS; ``` - ![Virtual Table](virtual-table.png) + ![Virtual table](virtual-table.png) Add a new review. @@ -152,7 +155,7 @@ Two SAP HANA Cloud, SAP HANA database instances can be connected so that one can Notice that the virtual table is editable. - A benefit of a virtual table is that there is no data movement. There is only one location where the data is persisted. + A benefit of a non replicated virtual table is that there is only one location where the data is persisted. ### Connect from SAP HANA Cloud, SAP HANA database to a data lake Relational Engine @@ -160,11 +163,11 @@ Two SAP HANA Cloud, SAP HANA database instances can be connected so that one can 1. If needed, in SAP HANA Cloud Central, add an SAP HANA Cloud, data lake (HDLRE) instance to your SAP HANA Cloud instance, by choosing **Actions > Add Data Lake**. - ![add a SAP HANA Data Lake](add-data-lake.png) + ![Add a SAP HANA Data Lake](add-data-lake.png) 2. Open a SQL console connected to the data lake instance by selecting the instance tile and choosing **Actions > Open SQL Console**. - ![Open SQL console in HCC](open-sql-console.png) + ![Open SQL console](open-sql-console.png) 3. Execute the following SQL to create a table named `tourist_reviews` in the HDLRE. @@ -195,8 +198,6 @@ Two SAP HANA Cloud, SAP HANA database instances can be connected so that one can 4. In the HDB SQL console, create a remote source **from** the HANA database **to** the HDLRE. Be sure to replace the host and password values. - >If you have not already done so, ensure that you have added USER1 to your HDLRE database, as shown in sub-step 3 above. - ```SQL CREATE REMOTE SOURCE HC_DL ADAPTER "IQODBC" @@ -205,23 +206,24 @@ Two SAP HANA Cloud, SAP HANA database instances can be connected so that one can USING 'user=USER1;password=Password1'; CALL PUBLIC.CHECK_REMOTE_SOURCE('HC_DL'); ``` + >Access host details under Actions > Copy SQL Endpoint - ![Copy SQL Endpoint](copy-sql-endpoint.png) + ![Copy SQL endpoint](copy-sql-endpoint.png) 5. Navigate to **Database Objects** to view an instance's remote sources. Notice that under remote sources, there is a remote source `HC_DL`. - ![Remote Sources in Database Objects](remote-source-db-objects.png) + ![Remote sources in Database Objects](remote-source-db-objects.png) If an instance's remote sources are unavailable, go to **Select Object Types** to add **Remote Sources**. - ![Adding Remote Source Option in Database Objects](add-remote-source-db-objects.png) + ![Adding remote source in Database Objects](add-remote-source-db-objects.png) 6. In the HDB SQL console, create a virtual table named **`VT_DL_TOURIST_REVIEWS`** in the schema **HOTELS** that maps to the newly created table in the HDLRE. This can be visualized as follows: - ![data lake and on-premise remote connection](dl-cloud-connection.png) + ![SAP HANA database connecting to a data lake Relational Engine](dl-cloud-connection.png) ```SQL CREATE VIRTUAL TABLE VT_DL_TOURIST_REVIEWS AT HC_DL.iqaas.HOTELS.TOURIST_REVIEWS; @@ -257,13 +259,13 @@ Two SAP HANA Cloud, SAP HANA database instances can be connected so that one can SELECT * FROM VT_DL_TOURIST_REVIEWS; ``` - ![New Review](new-review.png) + ![New review](new-review.png) - Notice that the remote data source is updateable. Data stored in an HDLRE is stored on disk, which has cost advantages compared to memory storage. HDLRE can also be used to store large amounts of data. + Notice that the remote data source is updatable. Data stored in an HDLRE is stored on disk, which has cost advantages compared to memory storage. HDLRE can also be used to store large amounts of data. ### Connect from a data lake Relational Engine to SAP HANA Cloud, SAP HANA database -The first task in preparing the HDLRE instance is creating a remote server that connects the HDLRE to the HDB instance that contains the data you want to access. +The first task in preparing the data lake Relational Engine instance is creating a remote server that connects to the SAP HANA database instance that contains the data you want to access. 1. In SAP HANA Cloud Central, locate the SAP HANA database instance tile and choose **Actions > Copy SQL Endpoint** to obtain the host name. @@ -313,12 +315,10 @@ The first task in preparing the HDLRE instance is creating a remote server that --DROP TABLE VT_HDB_TOURIST_REVIEWS; ``` - ![Test Query Results](test_query.png) + ![Query the virtual table](test_query.png) ### Connect from a data lake Relational Engine to another data lake Relational Engine -When connecting from one HDLRE instance to another, the steps follow a similar pattern to connecting from an HDLRE to an HDB instance (Step 2 of this tutorial). - 1. In SAP HANA Cloud Central, locate the target data lake instance tile and choose **Actions > Copy SQL Endpoint** to obtain the host name. 2. In SAP HANA Cloud Central, select the source data lake instance tile and choose **Actions > Open SQL Console**. @@ -361,7 +361,7 @@ When connecting from one HDLRE instance to another, the steps follow a similar p --DROP TABLE VT_HDLRE_TOURIST_REVIEWS; ``` - ![HDLRE Table](virtual-table.png) + ![Query the virtual table](virtual-table.png) For further information, see [Data Replication and Data Virtualization](group.hana-cloud-extend-2-data-replication), and [Getting Started with SAP HANA Cloud | Remote Data Source](https://blogs.sap.com/2020/08/03/getting-started-with-sap-hana-cloud-vii-smart-data-access/).