Navigating SAP HANA Studio – the Navigator Pane
When we log on to SAP HANA Studio, this is the place through which we can access all the objects—schemas, tables, procedures, information views, and so on. We can see this pane on the left side of the studio. This recipe discusses the different actions that can be performed from the Navigator Pane.
Getting ready
SAP HANA Studio is client software deployed on local machines which is used to connect to the SAP HANA server (database). For this, we have to add the system with all the details in the Navigator Pane. It is this pane that we will be navigating to access objects in the database and achieve tasks, as shown in the following screenshot:
At first look, the pane looks empty as we don't have any systems added. Once we add systems, we can browse through all the content. We can connect to multiple HANA databases from a single studio. Let us say that, a company has multiple HANA servers across the landscape—Development, Quality, and Production. Individual entries have to be added for each system and connected to the same.
The options in the Navigator Pane depend on the opened perspective. When we are in the Modeler perspective, we will see only the available systems and the objects. The content differs with the SAP HANA Development perspective or Debug perspective. This can be seen in the following screenshot:
How it works…
There are other options in the top portion of the Navigator Pane to monitor system health, administration, the SQL console, and so on. We will look at all the available options in detail.
System Monitor
We can monitor the system using the option. When we click on this button, details of all the available systems will be displayed. By default, information available in the memory, used memory, and so on will be displayed system wise. These results can be configured with what data needs to be displayed on the monitor screen. We can further drill down to the administration mode from this menu. Just a double-click on the system will take us to the administration section of that system, as shown in the following screenshot:
Administration
The option helps us with the administration of a particular system. More details on this option will be covered in the Administering SAP HANA – the Administration Console perspective recipe of this chapter.
As we deal with the administration of the system, this completely depends on the roles and authorizations we possess in the system.
SQL Console
The option opens up an SQL console, where we can write the SQL code for different purposes. We usually write the SQL code for DDL/DML/TCL operations, such as creating/altering a table, inserting/updating/previewing/deleting data contents of a table, or committing updates. The code written in this is reusable. We can save the code as a file on our local PC and use the same code in the future.
The SQL code will be executed based on the roles/authorizations we have on a system. We should have authorization to execute SQL on a schema; otherwise, the execution fails with an invalid authorization issue. The SQL Console window is as shown in the following screenshot:
The level we select while opening the SQL console is very important. As shown in the preceding screenshot, we can see the name of the schema for which the SQL console has been opened. Text in the header section of the SQL console will be in the following format:
SYSTEM_NAME (USER_NAME) HOST_NAME (Current Schema: SCHEMA_NAME)
Let's have a look at each of the fields:
SYSTEM_NAME
: This represents the system which has been selected for opening SQL Console. The length of the system name will be three characters.USER_NAME
: This tells us the username with which we have logged in to the system and are working with in SQL Console.HOST_NAME
: This shows the details of the host to which we are connected. The same host details can be seen from the properties of the system.SCHEMA_NAME
: This gives us the name of the schema which has been selected while opening the SQL Console window. If SQL Console has been opened while selecting the system, we don't see this in the header section. From the preceding screenshot, we can see that when SQL Console is opened from the system level, no schema details are displayed. The same happens when we select a schema and open SQL Console; we can see the schema on which SQL Console is working.
The important thing here is that when we execute any SQL command without giving a schema name, it works on the schema which we have selected. When tables/views are created without giving the schema name, these will go and sit in the schema. There is no restriction on fetching data from any schema; we can run SQL on any schema to retrieve data.
Find Table
The option helps us in searching for a table in the system. This icon will be active only when we select a catalog folder in the system, as tables will be located in the catalog section. Even though a schema is selected to find a table, the search will be executed on the entire system. All the tables with the given search string will be returned. We can also select to include column names in the search. In this case, results will consist of the column names as well. The minimum length of the search string is two characters.
Find System
The option can be used to search systems. The name of the system will be stored in the following format:
SYSTEM_NAME HOST_NAME (USER_NAME)
A search will be executed soon after giving a single character. A search string can be a part of the system name, host name, or a username. All values that match will be displayed. There are two more options, Open Administration and Open SQL Console, at the bottom of the search window, as shown in the following screenshot. If these are checked, it automatically opens the corresponding windows—Administration/SQL Console.
Link with Editor
The option links the objects opened with the navigation pane. When this option is enabled and an object is selected, the corresponding object in the navigation pane will be highlighted automatically. For example, let us assume that we are working on a few tables, views, and procedures opened in SQL Console, which are present in different schemas. When we change from one object to another in the main window, the same object in the respective schema will be highlighted in the navigation pane. This allows us to search where the objects are located exactly when required.
There's more…
- Cheat sheets can be opened in SAP HANA Studio. Select the Window menu, expand Show View and select Other. Now expand the Help folder. We can see Cheat Sheets. Select it, now we can see the Cheat Sheets pane on the right-hand side of SAP HANA Studio
- Views in SAP HANA Studio
See also
- SAP HANA Database – Studio Installation and Update Guide at http://help.sap.com/hana/SAP_HANA_Studio_Installation_Update_Guide_en.pdf