SAP HANA Database Explorer en ORIGINAL
SAP HANA Database Explorer en ORIGINAL
5 Analyzing Performance. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
5.1 Configure Tracing in the SAP HANA Database Explorer. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .50
5.2 View Diagnostic Files in the SAP HANA Database Explorer. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .51
Viewing the Trace File List. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
View Diagnosis Files of an Unavailable Tenant Database. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
5.3 Traces. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
5.4 Analyze Procedure and Function Performance. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .54
5.5 View Execution Plans for SQL Statements, Procedures, and Anonymous Blocks. . . . . . . . . . . . . . . . 55
Use the SAP HANA database explorer to query information about the database, as well as view information
about your database's catalog objects.
The database explorer is integrated into both the SAP Web IDE for SAP HANA and in the SAP HANA cockpit.
The database explorer contains features and functions required by both database administrators and
developers.
The SAP HANA database explorer allows you to query your database and view information about your catalog
objects, by providing the following functionality:
A catalog browser View the definitions of all types of catalog objects, for example: tables, views, stored
procedures, functions, and synonyms. Also, view the content (data) of your tables and
views.
An SQL console Create SQLScript procedures and queries, and then execute them or analyze their
performance using the SQL analyzer.
An SQL analyzer View detailed information on your queries and evaluate potential bottlenecks and
optimizations for these queries. The SQL analyzer is accessible from the SQL console, as
well as from the plan trace and expensive statement features in the SAP HANA cockpit.
An SQL debugger View the call stack, set break points, view and evaluate expressions and variables.
Related Information
The following features are new or changed for this release of SAP HANA database explorer.
Administration
Remove Multiple You can now remove multiple databases simultaneously by clicking the icon above
Databases (New) the catalog browser on the left of the screen.
Create Virtual Functions The remote source editor can now create virtual functions for Smart Data Access
(New) (SDA) remote sources.
Removing Data from When deleting a table, you now have the option of truncating the table. Truncating
Tables (New) allows you to remove all the content from your table but leaves the table structure,
indexes, and privileges intact.
Deleting Tables and Data
Importing Data from and You can now import data from and export data to external sources such as
Exporting Data to External Amazon S3, Azure Storage, Alibaba Cloud OSS, and Google Cloud Storage.
Sources (New)
Import Data Into a New or Existing Table, Export Data Into a File
Import ESRI Shapefiles from You can now import ESRI shapefiles from the following external sources:
External Sources (Changed)
• Amazon S3
• Azure Storage
• Alibaba Cloud OSS
• Google Cloud Storage
Visualizing You are now able to visualize spatial data in the SAP HANA database explorer.
Spatial Data
(New) To visualize spatial data, in the table editor, right-click on a column of type ST_Geometry
that contains an extended well-known binary value and choose View data to show the
spatial data on a blank canvas.
Spatial Data
Monitoring
Download SQL Results for In the Background Activities Monitor, you can now download the SQL results for
Background Activities
one or multiple queries by clicking the (Download SQL Results for Selected
(New)
Row(s)) icon.
Run a Query as a Background Activity
Last Modified In the Statement Library dialog, you can now see when a statement was last modified.
Column in When you add to the statement library from the SQL console or import from a file, a
Statement Library timestamp for the corresponding statement is displayed under Last Modified. For
(New) SYSTEM statements, the value in the Last Modified column is N/A.
Use the Statement Library to Administer Your Database
Security
Enable Single Sign-On SSO authentication can now be enabled when adding a new SAP HANA database in
(SSO) (New) the SAP HANA database explorer.
Add a Database to the SAP HANA Database Explorer
Removing Groups Groups in the SAP HANA database explorer no longer need to be empty in order for you
(Changed) to remove them.
Remove Groups from the SAP HANA Database Explorer
Browse your database's catalog using the SAP HANA database explorer.
Prerequisites
You must be a user of the database that you want to explore and you must have the required privileges to view
the catalog items.
Context
Some monitoring and problem analysis may require you to examine individual tables and views, for example,
system views provided by the SAP HANA database. Use the catalog browser, which is located in the left pane,
to find and open these catalog objects.
1. In the catalog browser, choose the database that you want to explore.
If your database is not listed in the catalog browser, then click Add a database to the Database Explorer
( ) to add the database.
For example, right-click a table and choose Open Data to view the table's data.
Related Information
Use the SAP HANA database explorer to create a URL shortcut, and then use it to create a bookmark or
favorite in your browser.
Procedure
1. In the catalog browser, right-click a database object and choose Create Shortcut.
2. Click Copy URL to copy the shortcut to your clipboard.
3. Paste the URL into your browser.
4. Use your browser to create a bookmark or favorite for the copied URL.
Results
The shortcut is created. Use it to open the database explorer and quickly navigate to the database object.
Search for Database Objects in the SAP HANA Database Explorer [page 8]
Search for database objects across all databases that the SAP HANA database explorer is connected to.
Prerequisites
In the database explorer, connect to each database that you want to search.
Context
Use the catalog browser to find your object when you know the type of object and the database that it exists in.
If you are unsure of the object type or the database that it exists in, then use the database object search. This
search looks for matches in either a specified database or all of the connected databases in the database
explorer and it can search across more than one object type. For example, use this search to find all tables and
procedures that contain the word production in their names.
Procedure
From the right sidebar of the database explorer, click Object Search ( ).
a. Specify a search term that is longer than one character.
Results
The search results appear in the Search for Database Objects pane.
Create URL Shortcuts to Database Objects in the SAP HANA Database Explorer [page 7]
Open Catalog Objects [page 6]
Add a database to the SAP HANA database explorer so that you can browse its catalog and execute SQL
statements against it.
Context
Adding a database to the database explorer is similar to registering a database in the cockpit. Once a database
is added, it is listed in the catalog browser pane on the left.
You cannot add a database to the database explorer that uses LDAP authentication.
Procedure
database 2. Specify the fully qualified domain name (FQDN) of the host on which the system is installed.
Specify the instance number or port of the database you are adding.
When adding a database that is part of a multi-host system, specify the master host.
You do not have to enter all host names explicitly as they are determined automatically. If the
master host becomes unavailable, then the connection is automatically established through
one of the other hosts. Hosts that are added to the system later are also detected automati
cally.
3. (Optional) Select Authenticate using single sign-on
This will allow you to connect using your single sign-on (SSO) token and eliminate the need to
specify your login information.
4. (Optional) If you are adding an SAP HANA database, a tenant database, or a system database that is part
of a multi-tenant database container system, then specify encryption information and advanced
connection properties as required.
Option Description
Save user and password (stored in the SAP HANA secure By default, your database credentials are not saved. Each
store.) time you need to connect to an added database, you must
provide your user credentials.
Note
If you have selected Authenticate single sign-on, this
option is disabled.
Connect to the database securely using TLS/SSL. Choose this option to encrypt communication between
(Prevents data eavesdropping.) the database explorer and the SAP HANA database using
the Transport Security Layer (TLS)/Secure Sockets Layer
(SSL) protocol.
Verify the server's certificate using the trusted certificate Choose the Verify the server's certificate using the trusted
below. certificate below option and provide a trusted certificate, if
you want to verify the server's certificate when connect
ing. This prevents server impersonation. The certificate
field must contain the contents of a certificate, and not a
file name. For more information, see the SAP HANA Secur
ity Guide.
Note
You can only choose this option if you have also
chosen the Connect to the database securely using
TLS/SSL. (Prevents data eavesdropping.) option.
In the Advanced Options field, specify the advanced options as semi-colon-separated name=value pairs.
For example: locale=en-US, isolationLevel=READ COMMITTED.
Option Description
isolationLevel The isolation level for the connection. The supported val
ues are: READ COMMITTED, REPEATABLE READ, and SE
RIALIZABLE. The default is to specify no isolation level.
locale The locale to use for the connection. If you do not set this
option, then the database explorer looks for a locale set
ting in your user parameter, and then in your browser. If no
locale setting is found, then the locale is set to en-US.
CLIENT Sets the session client for the connection. The value is a
three character string. For example, CLIENT=100.
5. (Optional) Choose a display name that is used to identify your database in the database explorer. Each
database must have a unique display name. If you do not choose a display name, then one is generated for
you.
6. Click OK.
Results
After adding a cockpit database, you can always go back and re-add the database with different user
credentials. Just right-click the cockpit database and click Add Database with Different User.
Related Information
Remove databases from the SAP HANA database explorer if they are no longer required.
Procedure
Results
When a database is removed, editors for objects contained by the database are closed automatically, and
consoles are disconnected.
Related Information
Add a built HDI container to the SAP HANA database explorer in the SAP Web IDE for SAP HANA , so that you
can browse its catalog objects and test its procedures and functions.
Prerequisites
The HDI container must be configured on the same XS advanced server that the SAP Web IDE is running on.
To add an SAP HANA database to the database explorer, you must have a user ID and a password for that
database.
You must be a space developer of the space that the HDI container is deployed in.
You must be a user of the SAP Web IDE for SAP HANA.
Context
Once an HDI container or database is added to the database explorer, it is listed in the catalog browser pane on
the left.
You cannot add a database to the database explorer that uses LDAP authentication.
Procedure
1. Open the database explorer from the SAP Web IDE by choosing Tools Database Explorer .
2. Add a database by clicking the Add a database to the Database Explorer icon ( ) from the catalog browser
toolbar.
3. From the Database Type dropdown list, choose the type of database to add:
2. Specify the fully qualified domain name (FQDN) of the host on which the system is instal
led. Specify the instance number or port of the database you are adding.
When adding a database that is part of a multi-host system, specify the master host.
You do not have to enter all host names explicitly as they are determined automatically. If
the master host becomes unavailable, then the connection is automatically established
through one of the other hosts. Hosts that are added to the system later are also detected
automatically.
tained in instance 2. Specify the instance manager that contains the HDI container you want to add.
managers 3. Choose an HDI container from the list. The list contains all HDI containers used by the
SAP Web IDE and the database explorer as well as all user-defined HDI containers.
4. Set the XS_APPLICATIONUSER session variable to make the connection personalized for
the current user.
Option Description
Save user and password (stored in the SAP HANA secure By default, your database credentials are not saved. Each
store) time you need to connect to an added database, you must
provide your user credentials.
Connect to the database securely using TLS/SSL. Choose this option to encrypt communication between
(Prevents data eavesdropping.) the database explorer and the SAP HANA database using
the Transport Security Layer (TLS)/Secure Sockets Layer
(SSL) protocol.
Verify the server's certificate using the trusted certificate Choose the Verify the server's certificate using the trusted
below. certificate below option and provide a trusted certificate, if
you want to verify the server's certificate when connect
ing. This prevents server impersonation. The certificate
field must contain the contents of a certificate, and not a
file name. For more information, see the SAP HANA Secur
ity Guide.
Note
You can only choose this option if you have also
chosen the Connect to the database securely using
TLS/SSL. (Prevents data eavesdropping.) option.
In the Advanced Options field, specify the advanced options as a semi-colon-separated, option-
name=value pair. For example: locale=en-US, isolationLevel=READ COMMITTED.
Option Description
isolationLevel The isolation level for the connection. The supported val
ues are: READ COMMITTED, REPEATABLE READ, and SE
RIALIZABLE. The default is to specify no isolation level.
locale The locale to use for the connection. If you do not set this
option, then the database explorer looks for a locale set
ting in your user parameter, and then in your browser. If no
locale setting is found, then the locale is set to en-US.
CLIENT Sets the session client for the connection. The value is a
three character string. For example, CLIENT=100.
5. Click OK.
Results
By default, you are connected to the HDI container as the technical user.
Related Information
Remove a group from the SAP HANA database explorer if you no longer require it.
Context
A group or subgroup doesn't have to be empty to remove it. If the group has subgroups or connections (for
example, database connections or file container connections), when you delete the group, you are given the
option to move the connections to the parent of the selected group or to remove the connections when
removing the group.
Procedure
Results
Your group will be removed from the SAP HANA database explorer. If your group had connections and you
chose to move them, they can be found in the removed group's parent.
Related Information
Procedure
1. Choose whether to create a regular group or a nested group in the catalog browser.
• To create a regular group in the catalog browser, click the Add a group to the Database Explorer icon in
the catalog browser toolbar on the top left.
• To create a nested group, right-click on an existing group in the catalog browser and click Add Group.
2. When the New Group pop-up dialog appears, enter a unique Group Name.
3. Click Create.
Results
Next Steps
Add a database to the new group, or add a subgroup. You can move an existing group to a new parent group by
dragging and dropping the existing group onto a different folder.
You can also rename a group or remove a group. To rename a group, right-click on the desired group and click
Rename Group. Enter a new name for the group and click Save.
The database explorer supplies secure authentication, authorization, and connections and provides a simple
method to delete personal information as needed.
Data protection is associated with numerous legal requirements and privacy concerns. In addition to
compliance with general data privacy regulation, it is necessary to consider compliance with industry-specific
legislation in different countries. SAP provides specific features and functions to support compliance with
regards to relevant legal requirements, including data protection. SAP does not give any advice on whether
these features and functions are the best method to support company, industry, regional, or country-specific
requirements. Furthermore, this information does not give any advice or recommendation in regards to
additional features that would be required in particular IT environments; decisions related to data protection
must be made on a case-by-case basis, under consideration of the given system landscape and the applicable
legal requirements.
Note
In the majority of cases, compliance with applicable data protection and privacy laws will not be covered by
a product feature. SAP software supports data protection compliance by providing security features and
specific data protection-relevant functions, such as simplified blocking and deletion of personal data. SAP
does not provide legal advice in any form. Definitions and other terms used in this document are not taken
from any given legal source.
Glossary
Term Definition
Consent The action of the data subject confirming that the usage of his or her personal
data shall be allowed for a given purpose. A consent functionality allows the stor
age of a consent record in relation to a specific purpose and shows if a data sub
ject has granted, withdrawn, or denied consent.
Personal data Any information relating to an identified or identifiable natural person ("data sub
ject"). An identifiable natural person is one who can be identified, directly or indi
rectly, in particular by reference to an identifier such as a name, an identification
number, location data, an online identifier or to one or more factors specific to the
physical, physiological, genetic, mental, economic, cultural, or social identity of
that natural person.
Purpose A legal, contractual, or in other form justified reason for the processing of per
sonal data. The assumption is that any purpose has an end that is usually already
defined when the purpose starts.
SAP HANA database explorer stores only personal data entered by users; it never collects personal data
without a user's knowledge. The only personal information stored by the SAP HANA database explorer consists
of the following:
XSA user The XSA user ID is received from the XSA or Cloud Foundry login page and is recorded in both the
ID SAP HANA database explorer and in log files. The following information associated with the user ID
is also stored in the SAP HANA database explorer:
User-Defined SQL Statements User-defined SQL statements are associated with a specific
user and may contain personal data.
Long-Running SQL Queries These queries are associated with a specific user and may
contain personal data.
User ID for Cloud Foundry This ID is retained only until WebIDE is restarted or upgraded.
Login When Connecting to the
Database Explorer from
WebIDE
Database Credentials User credentials associated with a specific user for HANA
databases are stored in the SAP HANA database explorer.
User Preferences These preferences are associated with a specific user and are
stored in the SAP HANA database explorer.
Logging SAP HANA database explorer collects XSA logs (when running on premise), Cloud Foundry logs
(when running on SCP), and audit logs. Audit logs can track read access and changes and may
contain user-specific data.XSA logs are retained indefinitely by XSA. For more information about
XSA logging, see the SAP HANA Developer Guide for XS Advanced Model. Cloud Foundry logs are
retained for one week. Audit logs cannot be deleted.
By default, logging is set to an application-wide level that does not record any personal data.
However, you can set logging to session level, which collects all SQL statements for the current
session. These statements may contain personal data.
Delete user-specific information that is stored by the SAP HANA database explorer.
Context
This procedure deletes the following personal data that is associated with the specified user ID:
Procedure
1. Using the xs command-line utility to log in as a user with the SpaceDeveloper role to the organization and
space where the database explorer is installed.
For example, in SAP HANA Express, the command looks similar to the following:
2. Run the xs env hrtt-service command to find the connection parameters for the hrtt-datasource.
Search the command results for the credentials with path VCAP_SERVICES.hana[0].
{
"name": "hrtt-datasource",
"label": "hana",
"tags": [
"hana",
"database",
"relational"
],
"plan": "securestore",
"credentials": {
"schema": "USR_BTVXBP585K74Z43VYJBW8WWZU",
"password": "password",
"driver": "com.sap.db.jdbc.Driver",
"port": "port-number",
"host": "hxehost",
"db_hosts": [
{
"port": 39013,
"host": "hxehost"
}
],
"user": "USR_BTVXBP585K74Z43VYJBW8WWZU",
"url": "jdbc:sap://hxehost:39013/?
currentschema=USR_BTVXBP585K74Z43VYJBW8WWZU"
}
3. Open the database explorer from the SAP HANA cockpit or SAP Web IDE for HANA and add a database by
using the values from the hrtt-datasource entry above.
a. Click the Add a Database to the Database Explorer icon ( ) and choose either SAP HANA Database
(Multitenant) or SAP HANA Database (if you have a single database container).
b. Determine the instance number from the hrtt-service environment port field value. If the port number
is 3<xx>13, then <xx> is the instance number.
c. Enter the user name and the password from the hrtt-service environment.
d. After connecting to your database, navigate to the schema that has the same name as the user. This is
the schema where HRTT stores persistent user data.
4. Open a SQL console and execute the following SQL batch to delete all data for the user, substituting
<user-ID> with the actual user ID:
Results
The data for the specified user is removed from the tables in hrtt-datasource.
Delete your personal information stored by the SAP HANA database explorer.
Context
This procedure deletes the following personal data associated with the connected user ID:
Procedure
Results
Your user data is deleted and SAP HANA database explorer restarts.
Security considerations for SAP HANA database explorer include authentication, authorization, and secured
connections.
Authentication and Authentication and authorization for the database explorer is governed by the
authorization application in which it resides.
The database explorer is integrated into SAP HANA cockpit and SAP Web IDE for SAP
HANA. To use the database explorer you must be a non-administrator user of one of
these applications.
Access to As a cockpit user, you can access any HDI container that exists in a
registered space in which you have been assigned the SpaceDeveloper role.
cockpit
databases As a cockpit user, you can access any cockpit that is assigned to a
group of which you are a member.
Access to HDI As an SAP Web IDE user, you can access any HDI container that is
containers in configured to run on the same XS advanced server that SAP Web IDE
SAP Web IDE runs on, and that exists in a space in which you have been assigned
the SpaceDeveloper role.
For more information see the SAP HANA Developer Guide (For SAP
HANA XS Advanced Model).
Connections from As a user of the cockpit, you can add any registered database to the database explorer.
the browser to the When the database browser sends a connection request to the XS advanced server that
database explorer is associated with the database explorer, the browser verifies that the host name of the
XS advanced server responding XS advanced server matches the host name that it provides. Specifically the
browser includes the Origin header, which contains the host name of the XS advanced
server in the request. If the host name of the responding XS advanced server does not
match the host name in the Origin header, then the connection does not proceed. You
can provide the XS advanced server with a list of host names to use during this
verification by setting the WEBSOCKET_ORIGIN environment variable (using xs set -
env) for the XS advanced server.
TLS/SSL SAP HANA databases that accept TLS/SSL connections usually use certificates that
connections from are obtained from a Certification Authority (CA), but you can use your own signed
the database
1. Check the box marked Connect to the database securely using TLS/SSL.
2. Check the box marked Verify the server’s certificate using the trusted certificate
below.
3. Copy the root certificate into the box.
Storing database When you specify the credentials to connect to an SAP HANA database, those
user credentials credentials are not saved to your browser. To have the credentials persist between
sessions, save the credentials to the SAP HANA secure store.
Saving SQL console If your browser supports saving content to local storage, then, for the duration of your
information to your session, the SQL content in your SQL console is saved to your browser. (Configure this
browser's local behavior in your user preferences within the SAP Web IDE.)
storage
Exporting and When you export catalog objects, the content that is saved is not encrypted.
importing catalog
objects When you import catalog objects into a database, no automatic virus scan or content
validation of the files is performed before they are imported. Malicious content can be
imported. Use external tools to validate the content of the files and scan them for
viruses before importing them.
Related Information
When the host name in the URL for the SAP Web IDE for SAP HANA or SAP HANA cockpit does not match the
hostname of its XS advanced server, then you must provide the XS advanced server with the accepted host
names to use when the XS advanced server verifies connections to the SAP HANA database explorer.
Prerequisites
• OrgManager
Procedure
For example:
2. Set the WEBSOCKET_ORIGIN environment variable for the XS advanced server to the list of acceptable
host names. Use the set-env command and enclose the acceptable host names between square brackets.
On a Unix system, the value must be enclosed in single quotes. For example:
xs restage hrtt-service
xs restart hrtt-service
The SAP HANA database explorer allows you to configure different types of traces and view diagnostic files for
your database. You can also use the SQL debugger to ensure that your database queries are error-free.
Log all back-end service requests for the specific user session.
Context
Set user-specific session logging when you require debug traces for individual requests, for example to provide
to your cloud administrator for support purposes, but you do not want to expose sensitive data from other
users.
Session-based logging records all SQL statements executed during the database explorer session as well as
their result sets. These SQL statements may contain personal data.
Procedure
Results
Debug logging is now active only for the connected user for the duration of the SAP HANA database explorer
session.
Retrieve code coverage information for SQLScript procedures and anonymous blocks.
Prerequisites
To see a database object in the coverage report, you must have the DEBUG object privilege for that object.
Context
Information is provided for code executed within one user-provided SQL session.
Procedure
Results
The code is executed and a coverage report is generated and is displayed under the Code Coverage Report tab.
The Overview table of the code coverage report contains one row per procedure/anonymous block involved in
the code execution.
Use the SAP HANA database explorer to view and test a database procedure.
Prerequisites
• You have access to a running SAP HANA system that includes a database procedure.
Procedure
Find your procedure in your catalog browser, and then choose one of the following options:
Option Action
View information about the procedure's parameters Click the procedure to open.
View the CREATE statement associated with the proce Open the procedure, and then click the CREATE Statement
dure tab.
Generate a CALL statement for the procedure Open the procedure, and then click Generate CALL
Statement.
Open the procedure to debug it (SAP Web IDE only) Right-click the procedure, and then choose Open for
debugging.
Related Information
Debug your stored procedures by using the SQL debugger in the SAP HANA database explorer.
Prerequisites
You must have the DEBUG object privilege granted on the schema or procedures that you want to debug.
To allow a user to debug a procedure in another user's session, the secondary user must be granted the
ATTACH DEBUGGER privilege. For example, user A can grant the ATTACH DEBUGGER privilege (using the
Context
In the SAP Web IDE, use the development perspective to create stored procedures in .hdbprocedure
modules and build them into HDI containers. Switch to the database explorer to test and debug the built
procedures. To make corrections to the stored procedures, return to the development perspective.
Using the SQL debugger with user-provided services or application-managed service instances is not
supported.
Note
If you are debugging a procedure and subsequently make changes to the procedure, then you must restart
the debugging session by detaching and re-attaching the debugger. Each debug session works with a
snapshot of the procedure(s) and any subsequent changes to procedures are not visible in active debug
sessions.
Procedure
1. Choose one of the following options to open the procedure for debugging:
Option Action
From the development perspective: 1. Open the stored procedure (the .hdbprocedure
file.)
2. Right-click in the editor and choose Open Runtime
Object.
The database explorer opens, the HDI container ap
pears in the catalog browser, and the metadata
viewer for the procedure opens.
3. Right-click the procedure in the catalog browser item
list and click Open for debugging.
The procedure opens in a code editor, the debugger opens on the right sidebar and connects to the
database, and a debugger session starts.
2. Set breakpoints in the code of your stored procedure by clicking a line number.
3. Call the procedure by right-clicking the procedure in the catalog browser item list and clicking Generate
CALL statement.
a. In the code, enter values for any input parameters.
b. Choose Run ( ) from the global toolbar.
The debugger stops at the first breakpoint and the session is suspended until you resume the debugging.
4. Choose (Resume module execution (F8)) or (Step over next function call (F10)) to step through the
code execution.
Next Steps
Once you are finished debugging, click Detach debugger from running application ( ) to stop the debugging
session.
Use the database explorer debugger to debug stored procedures and functions.
Use the tutorials in this section to help you understand the following tasks you can perform with the database
explorer debugger:
Note
You must have the DEBUG object privilege granted on the schema or procedures that you want to debug.
To allow a user to debug a procedure in another user's session, the secondary user must be granted the
ATTACH DEBUGGER privilege. For more information on debugging prerequisites, see Debug Procedures in
the SAP HANA Database Explorer and Object Privileges (Reference).
Tutorial Requirements
Execute the following statements (using the same line numbering as below) to create the function func_add,
and the procedure dp2, which are used extensively in the debugger tutorials:
Related Information
Context
Start an active debugging session for a specific database and specific types of connections.
Procedure
1. Click the Debugger icon ( ) on the right-hand tool bar to open the debugger.
2. Click the Attach debugger icon ( ) and click the database you want to attach the debugger to.
3. Click OK.
4. In the Debugger Attach Options dialog, choose one of the following options for how the debugger is
attached:
Connections with the Debug connections that use the specified debug token. Click Choose a
following debug token Debug Token... opens a dialog that shows current tokens in use by the
current database.
Connections with the Debug connections with the specified HANA database user name and,
following attributes optionally, the specified application user name. Use the Application user
name option primarily for ABAP applications, as ABAP connections use the
same HANA database user name, but a different application user name.
Results
A message appears on the top right corner of the screen indicating that the debugger has successfully
connected and the Active Session dropdown menu shows the name of the connected database.
Create a sample procedure and then set breakpoints where you want the debugging to pause during the
execution of your code.
Prerequisites
You must have created the function func_add, and the procedure dp2, as specified in the SAP HANA Database
Explorer Debugger Tutorials topic.
Context
To debug a procedure, HANA must first compile it. Breakpoints that are set before the procedure is compiled
do not have a checkmark. Once the procedure is compiled, valid breakpoints show checkmarks. Setting a
breakpoint after procedure compilation automatically moves the breakpoint to the next valid line, if it is not
currently on a valid line.
Procedure
The procedure starts to run, but stops at the breakpoint, with a message in the top right corner of the
screen indicating that the procedure has been suspended. The Console section of the debugger displays
the message, Stopped at breakpoint.
5. To resume the execution of the procedure, click Resume ( ), or press F8, in the debugger window.
Results
Related Information
Create a sample function and then set breakpoints where you want the debugging to pause during the
execution of your code.
Prerequisites
You must have created the function func_add, and the procedure dp2, as specified in the SAP HANA Database
Explorer Debugger Tutorials topic.
Context
You cannot set breakpoints and debug a function directly. Instead, the function must be called through a
procedure or a table function.
A dialog pops up that says that debugging scalar UDFs is only supported if the UDF is assigned to a variable
within a procedure or a table function that also has a breakpoint set.
3. Click OK in the dialog box and call the procedure, dp2, which calls func_add, by right-clicking the procedure
and clicking Generate CALL Statement Run .
Results
When dp2 is called, you can see that func_add breaks on the set breakpoints, since dp2 calls the function at
line 17.
Related Information
Create a function that contains an anonymous block and then set breakpoints where you want the debugging
to pause during the execution of your code.
Prerequisites
To set breakpoints in an anonymous block, set the Stop at execution start option in the Debugger Attach
Options dialog when you attach the debugger to your database.
Context
You cannot set breakpoints and debug a function directly. Instead, the function must be called through a
procedure or a table function.
When debugging anonymous blocks, breakpoints and watchpoints are not persisted between executions.
Call the procedure dp2, which contains an anonymous block, by right-clicking the dp2 procedure in the
Procedures item list and clicking Generate CALL Statement.
Results
When you execute the SQL, a second, read-only editor tab opens and execution is paused at the start of the
SQL. You can step through the code, set breakpoints, and debug just as you can when debugging procedures
and functions.
Prerequisites
To set a watchpoint in the SQLScript library, you must first set the SQLScript library member in the Add
Watchpoint dialog.
Procedure
Right-click the SQL library that you want to debug and click Open for Debugging.
Results
The library opens in the debugging editor where you can set breakpoints.
Prerequisites
You must have created the function func_add, and the procedure dp2, as specified in the SAP HANA Database
Explorer Debugger Tutorials topic.
Context
The Expressions tab in the debugger allows you to watch expressions as executions are paused. As you step
through the code, the debuggers watches the expression and returns any results.
Procedure
The debugger watches the expression during the debug session and will return all values for i plus 5.
5. Click Add.
6. (Optional) To edit an expression, select the expression and click Edit ( ).
7. Set breakpoints on lines 13 and 18 in the dp2 procedure and run the procedure by right-clicking dp2 and
clicking Generate CALL Statement Run .
The procedure stops at line 13, and in the Expressions tab, the value of i + 5 is displayed as 5, since i was
declared as 0 on line 9.
The procedure now stops at line 18, and in the Expressions tab, the value of i + 5 has changed from 5 to
11. This is because on line 17, the value of i became 6, when the code i=FUNC_ADD(2,4); was executed.
Results
You have run a debugging session on procedure dp2, where the expression i + 5 was watched and returned
varying results, depending on the breakpoint set.
View variable values within the procedure or function that you are debugging.
Prerequisites
You must have created the procedure dp2, as specified in the SAP HANA Database Explorer Debugger Tutorials
topic.
Context
The Variables tab in the debugger allows you to view variables and their definitions as executions are paused
during the debug session.
Procedure
3. Right-click the procedure and click Generate CALL Statement Run to run the procedure.
• BINARY, VARBINARY
• BOOLEAN
• STRING
• CHAR, NCHAR, VARCHAR, NVARCHAR, VARCHAR3, VARCHAR2
• DATE, TIME, TIMESTAMP, DAYDATE, SECONDTIME, LONGDATE, SECONDDATE
• INTEGER, INT, TINYINT, SMALLINT, BIGINT
• DECIMAL, SMALLDECIMAL
• REAL, DOUBLE, FLOAT
You have run a debugging session on procedure dp2, where you examined the definition for the variable LT1:
table[3], when the procedure paused execution at line 14.
Setting a watchpoint in the debugger to pause code execution when a specified condition is encountered.
Prerequisites
You must have created the function func_add, and the procedure dp2, as specified in the SAP HANA Database
Explorer Debugger Tutorials topic.
Context
A watchpoint acts like a breakpoint, but rather than specifying a line at which to pause code execution, you
specify a condition at which to pause code execution. For example, you can pause code execution when the a
specified expression is true or when the result of a specified variable changes values.
Procedure
The procedure stops at line 18 with a message in the Console box stating that the procedure execution
stopped due to the specified watchpoint.
6. (Optional) Edit the expression in the watchpoint.
a. Click the watchpoint and click Edit Watchpoint ( ).
b. Change the value in Expression after to i<6.
7. Re-run procedure dp2.
Results
Explicitly quit your debugging session by detaching the debugger from your application, or by setting a
debugger timeout limit.
Context
Procedure
A message appears on the top right of the screen, indicating that the debugger is detatched.
2. Set the timeout limit for the debugger.
a. Click Preferences ( ).
b. Click the SQLScript Debugger option.
c. Enter the number of minutes you want to set the debugger session timeout limit to and click Save.
Results
You have quit your current debug session and set a timeout (in minutes) preference for all debugging sessions.
Execute queries on your database using the SQL console. These queries can be run as background activities.
To view keyboard shortcuts, right-click anywhere in the SQL console and then click Keyboard Shortcuts from
the context menu.
Set preferences for your SQL consoles by clicking the (Preferences) icon and navigating to Global
Preferences SQL Console .
Use the SQL console side panel to access syntax for SQL statements and to view metadata SQL objects. You
can view the following information:
Tables and Views View information on the tables or views being referenced in the current console and
use the title link to open the table or view definition.
Procedures and View information on procedures or functions being referenced in the current console
Functions and use the link to open the procedure or function definition.
SQL Functions View information on built-in functions and use the link to access full reference
documentation for the function.
Statement History
View the 50 most recently executed SQL statements in the History tab, located beside the Results and
Messages. Double-click a statement in the History tab to load it into the text editor. Closing the SQL console
erases the current statement history.
Execute SQL statements and analyze their results by using the SQL console that is included with the SAP
HANA database explorer.
Prerequisites
You must have the required privileges in the SAP HANA database to execute your SQL statements.
Context
Be default, DML contents are autocommited and syntax errors are indicated.
To view keyboard shortcuts, right-click anywhere in the SQL console and then click Keyboard Shortcuts from
the context menu.
Procedure
1. Open an SQL console from the database explorer by right-clicking your database and clicking Open SQL
Console.
For example, the following statement returns users who have the EXPORT or IMPORT system privilege:
You can also import SQL directly into the console by clicking the Import File icon ( ) and choosing a local
file.
3. Execute on or more statements by choosing one of the following options:
Option Action
Execute all statements Click the Run icon ( ) from the global toolbar or press
F8.
Execute individual statements Highlight the statement, and then click the Run icon ( )
from the global toolbar or press F8.
Execute a SQL query on multiple databases Open a SQL console, create your query and then click
Run Run on Multiple Databases . Click the data
bases, groups, or resources where you want to run the
query. The query runs as a background activity. Option
ally, click Cancel all queries on SQL error, to stop subse
quent queries from running on all databases if one of your
queries encounters a SQL error. Click Run SQL.
Execute a query and open the SQL analyzer to view in Open the Run dropdown list from the global toolbar, and
formation about the query's plan then choose Analyze SQL.
A new tab opens to display the query plan for your state
ment in the SQL analyzer.
To save the plan, click Analyze SQL and Save Plan and
specify a filename for the plan. You can also specify
whether to run the analysis as a background activity.
Execute the content of the current line Open the Run dropdown list from the global toolbar, and
then choose Run Line.
Prompt for the values of parameters before executing Open the Run dropdown list from the global toolbar, and
the statement then choose Prepare Statement.
Results
The Result pane appears with the results. Multiple Result tabs appear when there is more than one result set.
By default, only the first 1000 rows in a result set are retrieved.
All warnings are displayed in the Messages tab. A warning icon ( ) also appears next to the relevant statement
in the SQL console, and you can view the warning message by hovering over it or using the Alt+E keyboard
shortcut.
Introduction to SQL
SAP HANA SQL Reference
About SAP HANA SQLScript
Setting User Preferences
Run a Query as a Background Activity [page 44]
Use the Statement Library to Administer Your Database [page 45]
Analyzing Statement Performance
Context
Parameterized statements provide more flexibility to your application when the name of an object, or the value
for a statement option, is not known until execution time.
Procedure
For example:
Results
The statement executes with the given parameters and the results are returned on the Result tab.
Set a query to run as a background activity, which continues running even if the browser window is closed.
Context
Run a query as a background activity when the query is expected to run for a long time, for example, a query
that exports a schema or merges trace files.
Running a query as a background activity stores the query status and results, which can be retrieved at a later
time, and immediately disconnects you from the SQL console where the query was run from. The disconnected
SQL console remains open and can be reconnected to the same, or a different, database. Various operations
within the database explorer can run as background activities. You can view their status using the Background
Activity Monitor.
• Once the background activity has started running, the connection from the SQL console that started the
query is used to run the query. Once the background activity completes, the connection is closed. You
cannot reconnect to a connect that has been used by a background activity.
• Result sets are stored compressed and encrypted. You can store a maximum of 100 MB of background
activity results. If this limit is exceeded, background activity results are no longer stored and you cannot
create new background activities until you free up space by deleting completed background activities.
• The first 256 characters of the query are stored unencrypted as part of the query's description.
Procedure
1. Choose one of the following options to run your query as a background activity:
Option Action
Execute a long-running SQL query as a background ac Open a SQL console, create your query and then click
tivity Run Run as Background Activity .
Execute a SQL query on multiple databases Open a SQL console, create your query and then click
Run Run on Multiple Databases . Click the data
bases, groups, or resources where you want to run the
query. Click Run SQL.
The query runs as a background activity and you are disconnected from the SQL console where the query
was run.
2. (Optional) To view or manage background activities, choose one of the following options:
View the status of your background activities Click the (Background Activities Monitor) icon in the
bottom, right-hand corner of your screen to open the
Background Activities Monitor.
View the results of one or more background activities In the Background Activities Monitor, double-click a single
query to view its results in a new SQL console, or select
more than one query and click the (Open Details for
Selected Row(s)) icon. The results for each background
activity open in a separate console.
Cancel a background activity In the Background Activities Monitor, select the back
ground activity you want to cancel and click the (Cancel
Selected Row(s)) icon.
Delete a background activity In the Background Activities Monitor, select the back
ground activity you want to delete from the monitor and
click the (Delete Selected Row(s)) icon.
Download SQL results for one or more background ac In the Background Activities Monitor, select the query or
tivities queries you want to download the results from and click
the (Download SQL Results for Selected Row(s)) icon.
Your SQL results will then be able to be viewed in a JSON
file.
Related Information
The statement library in the SAP HANA database explorer contains default system statements and can also be
used to store user-defined statements.
Prerequisites
The maximum size allowed per user for all stored statements is 10 MB, uncompressed.
You cannot use forward slashes (/) in a statement name. Otherwise, there are no character restrictions.
You can edit statement contents and descriptions in the SQL console and then save them back to the
statement library as a new statement, or by replacing the old version.
Create your own SQL statements for administration purposes directly in the SQL console and add them to the
statement library. Alternatively, you can import statements saved as ZIP files, .sql files, or .txt files from
your local computer or network file server.
The content of statements stored in the statement library is encrypted, except for the statement description;
do not include sensitive information in your statement description.
The statement library is user-specific, therefore all stored statements are available for every database
associated with a specific user.
Action Description
Create and add statements 1. In the catalog browser, right-click your database and
click Open SQL Console.
2. Enter your SQL statement. Including a header is
optional. However, a description for your SQL
statement will not show up in the statement library
unless you create one in your statement header. The
format for your statement description is as follows:
/*
[DESCRIPTION]
--Sample description
*/
Export statements
Note
You can only export statements with the type USER.
Edit statements Edit a stored SQL statement by clicking its folder and
clicking the (Open in SQL Console) icon.
The statement opens in the SQL console where you can edit
the syntax and description and add it back into the
statement library under the same name or a different name.
Related Information
View and work with graph workspaces in the SAP HANA database explorer.
Prerequisites
Context
Running an algorithm expands 1000 vertices. Applying a filter returns a maximum of 1000 records.
For more information about graph workspaces, see the SAP HANA Graph Reference guide.
Procedure
A list of all available graph workspaces for your database appears both in the graph workspaces editor and
in the catalog browser item list.
Option Action
View schema information for a graph workspace Right-click a graph workspace and click Open to view infor
mation about the graph workspace, such as the names of
the edge and vertex tables, the schema the graph workspace
belongs to and its creation time.
View data in a graph workspace Right-click a graph workspace and click View Graph. The
graph workspace opens in the graph visualizer and allows
you to perform the following actions:
Improve the performance of query execution by analyzing SQL statements, and procedures and functions
written in SQLScript.
Various types of tracing are available in the SAP HANA database explorer for obtaining detailed information
about your database system operations.
Prerequisites
To configure tracing, you must have the TRACE ADMIN system privilege.
You must be connected to an SAP HANA database. You cannot configure tracing for HDI containers or cockpit
resources.
Procedure
Results
You have configured your tracing type and can now view and download tracing results from either your
Database Diagnostic Files folder or your Host Diagnostic Files folder.
Related Information
Traces
Diagnose and analyze errors in an SAP HANA database by viewing the relevant diagnostic files in the SAP
HANA database explorer.
Context
In the catalog browser, diagnostic files for online databases are grouped by host and then by service. In a multi-
host system, check each host folder to view all diagnostic files associated with a particular service.
Procedure
Option Description
View diagnostic files Open the Database Diagnostic Files folder of your database, then right-click the diagnostic file that
for a database that is you want to examine and click Show Files to open the file in an editor. If the trace file is binary, then
online and available
it cannot be opened in the database explorer, but can be downloaded. The Database Diagnostic
Files folder contains all diagnostic files that are available through the database's M_TRACEFILES
system view.
View diagnostic files Open the Host Diagnostic Files folder of your cockpit database, then right-click the diagnostic file
for a cockpit data that you want to examine and click Show Files to open the file in an editor. If the trace file is binary,
base that is either
then it cannot be opened in the database explorer, but can be downloaded. The Host Diagnostic
online or offline
Files folder contains all diagnostic files that have been configured for the SAP Host Agent.
For more information about configuring the SAP Host Agent, see the SAP Host Agent documenta
tion.
The cockpit database must have valid SAP Control Credentials set in the cockpit. If the user has
not set valid SAP Control Credentials, then an error is returned.
View diagnostic files Under the Database Diagnostic Files folder of your database, right-click the folder of the tenant da
for tenant databases tabase that you want to view trace files for, and then click Show Files to open the file in an editor.
in an MDC system
Note
You must be connected to the system database as the SYSTEM user.
Seeing trace files currently in your system is useful for SAP HANA database monitoring and analysis.
To view the trace file, open the SAP HANA database explorer. Right-click the desired host folder, and click Show
Files.
The trace file list opens, showing all trace files currently in the system. You can also see their metadata such as
the host, service, file name, size, and the time the file was modified.
To support monitoring and analysis, you can perform the following actions on the trace file list:
If a tenant database is unavailable, for example because it's stopped or experiencing major performance
problems, the tenant database administrator can't access diagnosis files. In this case, you as the system
administrator can access the diagnosis files of the tenant database from the system database using the SAP
HANA database explorer.
Procedure
Open the Host Diagnostic Files folder of your cockpit database, then click the diagnostic file that you want to
examine to open it in an editor. The Host Diagnostic Files folder contains all diagnostic files that have been
configured for the SAP Host Agent.
Note
You cannot open binary trace files (marked with a binary icon) in the database explorer. You can only
download binary trace files.
For more information about configuring the SAP Host Agent, see the SAP Host Agent documentation.
Next Steps
If more detailed diagnosis information is required (for example for SAP Support), you can trigger the collection
of a full system information dump for tenant databases. For more information, see Collecting Diagnosis
Information for SAP Support in the SAP HANA Administration Guide.
Related Information
5.3 Traces
SAP HANA provides various traces for obtaining detailed information about the actions of the database system
for troubleshooting and error analysis.
The following types of traces can be configured in the SAP HANA database explorer:
• Database Trace
• SQL Trace
• User-Specific Trace
• End-to-End Trace
• Kernel Profiler
• Expensive Statements Trace
• Performance Trace
• Plan Trace
For more information on how these traces work, see the relevant topic in the Traces section of the SAP HANA
Administration Guide for SAP HANA Platform.
Related Information
Traces
Analyze a procedure or function written in SQLScript to search for patterns indicating problems in code quality,
security or performance.
Prerequisites
You must be connected to a HANA database that has the SQLScript Code Analyzer.
You must have the required database permissions to run the SQLScript Code Analyzer.
Context
The SQLScript Code Analysis Results editor only shows the first 1,000 results.
Procedure
Option Action
To analyze all procedures and functions for a database Right-click on the database or schema and click Analyze
or schema SQLScript Code.
To analyze all procedures or all functions for a database Right-click on the Procedures folder or the Functions folder
or schema of the database or schema and click Analyze SQLScript
Code.
To analyze an individual procedure or function • Open the list of procedures or functions by clicking
the Procedures folder or the Functions folder. Right-
click a procedure or function in the catalog browser
list and click Analyze SQLScript Code.
• Click the procedure or function to open its definition
and then click Analyze SQLScript Code.
• Right-click on the procedure or function and click
Analyze SQLScript Code.
To analyze a specific set of procedures or functions Open the list of procedures or functions by clicking the
Procedures folder or the Functions folder. Click on the pro
cedures or functions that you want to analyze, then right-
click and click Analyze SQLScript Code.
The SQLScript Code Analysis Results editor opens and the results of the analysis are loaded.
2. (Optional) Search for a specific result using the search bar or download the results in CSV format by
clicking the download button ( ).
View the details of a compiled execution plan for a SQL statement, procedure, or an anonymous block.
Context
Running Explain Plan generates the SQLScript engine's execution plan for a given statement, procedure or
anonymous blocks. The results of the execution plan are stored in a global temporary table. For SQL
statements, the results are stored in the EXPLAIN_PLAN_TABLE temporary table. For procedures and
anonymous blocks, results are stored in the EXPLAIN_CALL_PLANS temporary table, and only if you are using
HANA 2.0 or higher.
Procedure
Results
The plan information for each statement is displayed separately. The results are visible only within the session
where the EXPLAIN PLAN call is executed.
Related Information
Import or export schemas and database objects and create and manage remote sources and virtual objects.
Use SAP HANA database explorer to create a remote source to another database.
Prerequisites
Context
The connection properties depend on your adapter type and connection mode.
Configuration File • For SAP Event Stream Processor and SAP Streaming Analytics, specify
property_esp.ini.
• For SAP MaxDB, specify property_maxdb.ini.
• For SQL Server, specify property_mss.ini.
• For IBM DB2, specify property_db2.ini.
• For Oracle, specify property_orcl.ini.
• For IBM Netezza, specify property_db2.ini.
• For Google BigQuery, specify property_bq.ini.
Driver The library name containing the driver for the specified adapter.
Server/ServerNode The SAP HANA server. For failover, list the failover server name, separated by a comma. For exam
ple, server_name1:30015,failover_server_name1:30015.
SSL mode Specifies whether to use SSL. Specify use SSL or no SSL.
Database Name The name of the database you are creating the remote source for.
Extra Adapter Proper Additional connection properties. Choose one of the following:
ties
SAP (Session Connection Information Only)
HANA
sessionVariable:<session_variable_name>=?
SAP Specify the additional properties to complete the remote connection as follows:
IQ
ServerName=<iq_computer_name>;CommLinks=tcpip(host=<IQ_host>;port=<IQ_por
For example, the additional properties to connect to the demo database would be:
ServerName=<iq_machine_name>_iqdemo;
CommLinks=tcpip(host=<iq_machine_name>;port=2638)
SAP (For failover only) Enables automatic failover for the remote source. Enter:
ASE
HASession=1;AlternateServers=<failover_server>:<failover_port_number>
Port Number The port number of the computer where the client is located.
System Object Prefix The prefix for object names of the specified database system.
1. In the SAP HANA database explorer, right-click the Remote Sources object in your database catalog and
click Add Remote Source.
2. Specify a remote source name, adapter name, and, optionally, a source location. The Source Location field
defaults to indexserver for SDA adapters, and dpserver for smart data integration.
3. Specify an adapter version and connection mode. Choose Data Source Name if you are using a DSN entry.
Otherwise, choose the default setting, Adapter Properties.
4. Fill in the other required connection property fields, which are marked with an *.
5. Specify one of the following credential modes (enter your user name and password as required):
Technical User All connections to the remote data source share the same credentials.
SSO Kereberos Single sign-on (SSO) with Kereberos is used to connect to the data source.
6. Click OK.
Related Information
View the properties of a remote source and edit the parameters that were used to create the remote source.
Prerequisites
The remote data source must be accessible from your the network.
1. In your catalog browser, click Remote Sources to bring up an item list of your remote sources.
2. Click the remote source that you want to edit to open the remote source editor.
3. Click Edit and make the changes to your remote source properties.
4. Click Save.
The system saves the change and then tests the new connection properties. If the connection fails, then a
message appears. If defined, then all filters are reset and the remote object list is cleared.
Related Information
Prerequisites
You must either be the creator of the remote source or have the CREATE VIRTUAL TABLE object privilege on
the remote source.
Procedure
Alternatively, you can display all remote objects of a specific type using the Type drop-down menu.
If you select only one remote object, then either use the default virtual object name or give it a new name. If
you select more than one remote object, then you can either leave the Object Names Prefix field blank so all
objects are created with their default names, or you can specify a prefix that is added to the name of the
new virtual objects.
6. Specify the schema to create the virtual object(s) in.
7. Click Create.
Results
You can view your new virtual object in the relevant catalog object list. For example, if you click on Functions,
you will see a list of all functions, including virtual functions in the catalog object list below. Virtual objects are
differentiated from other objects by the inclusion of a green highlight on their icon.
Related Information
Prerequisites
You must either be the creator of the remote source or have the CREATE VIRTUAL TABLE object privilege on
the remote source.
For more information about smart data integration, see SAP HANA Smart Data Integration and SAP HANA
Smart Data Quality .
Procedure
Note
The search functionality is only enabled if a dictionary is created for a remote source. A dictionary is a
local copy of the objects in a remote source. Searching is performed only on dictionaries for
performance purposes.
Use the Dictionary section of your remote source editor to create, refresh, or clear your dictionary.
4. Select one or more remote object(s) and click Create Virtual Object(s).
5. Name your virtual object(s).
If you select only one remote object, then either use the default virtual object name or give it a new name. If
you select more than one remote object, then you can either leave the Object Names Prefix field blank so all
objects are created with their default names, or you can specify a prefix that is added to the name of the
new virtual objects.
6. Specify the schema to create the virtual object(s) in.
7. Click Create.
Import catalog objects, including schemas, into your database by using the SAP HANA database explorer.
Prerequisites
• Import data must be compressed in .tar.gz format, which is provided during the database explorer
export. Data exported by the SAP HANA studio must be compressed to .tar.gz before it can be
imported.
• The database objects being imported must have been exported by using the export feature in the database
explorer.
Context
You cannot import a database object larger than 2 GB. If you are importing a database object larger than 1 GB,
then import the object to the SAP HANA computer rather than to the local computer.
Procedure
1. In the SAP HANA database explorer, right-click the schema that you want to import the objects to, and
choose Import Catalog Objects.
2. Specify where you're importing the file from. You have the following options:
• Local Computer
• SAP HANA Server
• Amazon S3 (if supported by your database)
• Azure (if supported by your database)
3. Specify the filepath for the object you want to import.
Note
For Amazon S3 and Azure you have the option of either manually providing the filepath or editing the
region (Amazon S3) and path. Clicking the Edit button allows you to enter the path components
separately. The components vary depending on the source. After entering the components and clicking
OK, the path components are composed into the path string and populate the S3 Path or Azure Path
input box on the main dialog.
Once you've provided the filepath, click Load to view all the catalog objects from the specified import
file.
You can repeat the above operation to import multiple catalog objects.
Option Description
Include Dependent objects of the selected objects are also imported. For example, if a table has any trig
dependencies gers or indexes associated with it, then these definitions are imported.
Include object data Import the table data along with the table definitions.
If you deselect this option, then only the table definitions are imported.
Replace existing If objects with the same names already exist in the destination database, then they are overwrit
objects ten by the objects being imported.
Fail import if it If you are including object data when importing a catalog object, then selecting this checkbox
contains invalid data ensures that your import is canceled if any of the object data is incomplete or corrupt.
Number of Parallel Increasing the number of threads can speed up the import and affect database performance.
Threads Consider the following guidelines when choosing the number of threads to use:
• For a view or procedure, use two or more threads, up to the number of dependent objects.
• For a whole schema, consider using more than ten threads, up to the number of CPU cores
in the system.
• For an SAP BW or SAP ERP system with tens of thousands of tables, using many threads is
reasonable (up to 256).
5. Click Import.
Results
The catalog objects are imported. The length of time that the export process takes depends on the number of
objects being imported and the scope of the import.
You can monitor the progress of a running import with the M_IMPORT_BINARY_STATUS monitoring view.
Related Information
Import data from your local system into a new or existing database table.
Prerequisites
Context
Unlike using the IMPORT statement, which only allows you to import data if you are creating or replacing a
table, this feature allows you to add rows of data to an existing table.
Procedure
1. Right-click one of the following catalog objects to open the context menu:
• Your database
• Your database's Tables icon
• The table you are importing data into
2. In the context menu, click Import Data.
3. Choose one of the following import types and complete the corresponding actions:
Option Action
Import Data
1. Import Source
Choose one of the following import sources:
Note
If the first row of your file contains a header, then
leave File has header in first row checked by
2. Import Target
Whether you are creating a new table or adding data
to an existing table, you must choose an existing
schema to import data into.
Note
If you are importing into an HDI container or an
Application Managed Service Instance, then you
can only import your data into an existing table.
3. Table Mapping
If you are creating a new table, then specify your
table type, column names, and properties. Some
properties such as Data Type and Length are set to
default values, but you can modify them according to
your preferences.
If you are importing data into an existing table, then
configure the source column names for the target
columns.
If source column names are not provided in the CSV
file, the system will automatically populate the
Source Column Name fields in the order of the values
in the dropdown list. You can modify these names by
selecting new values from the dropdown list.
Note
When dragging a column into the table, you
must drag it either directly above or below
another column.
4. Import Options
If you are importing from an external source and
have selected CSV as the File Format, then you must
set up additional options such as an escape
character, the number of parallel threads, and date
and time formats. Most of these options are set to
Note
When creating your tar.gz file, select
individual files rather than the parent
directory to avoid inadvertently including
hidden directories in your import file.
• Amazon S3
• Azure Storage
• Alibaba Cloud OSS
• Google Cloud Storage
2. Import Target
If you are importing shape files, then you can create
a new schema to import the files into, or import
them into an existing schema.
3. Import Options
Specifying the SRID automatically sets the Spatial
Reference System Name.
Note
If you do not specify, the default SRID will be
used.
4. Click Import Into Database, if importing from a local source, or click Import, if importing shape files.
Results
The data is imported into the specified table. You can press Cancel at any time to roll back the import
operation. If you are importing data from a local source, then you can view the import progress on the Import
Status page.
Related Information
Prerequisites
You must have the HDI Container Group Administrator permission for at least one container group in the
database.
Context
tbd
You can view the upload progress in the Import HDI Container tab.
4. Once the file has completed uploading to a staging table, give it a new HDI container name and assign it to
an HDI container group.
5. Click Import HDI Container and then Import, to confirm the process.
Staging tables are saved in your database and are named according to the
format: .SAP.HRTT.ImportHDI.<timestamp>.
a. Right-click the import background activity and click Delete.
b. Select whether to delete just the background activity, or the background activity and the staging table.
Keeping the staging table allows you to reuse it for future imports.
Results
The new container has been imported into the database successfully.
Export catalog objects, including schemas, from your database by using the SAP HANA database explorer.
Prerequisites
• You must have the SELECT privilege for the catalog objects that you want to export.
• You must have the EXPORT system privilege.
Context
1. In the catalog browser, right-click the object that you want to export, and then choose Export Catalog
Objects.
2. Specify a file name for the object being exported and choose where to export the object to. You have the
following options:
• Local Computer
• SAP HANA Server
• Amazon S3 (if supported by your database)
• Azure (if supported by your database)
Option Description
Local Choose this option to save the export as a compressed file to a directory on your local machine.
Computer
To avoid sending large amounts of data across the network, do not use this option when exporting large
amounts of table data. Instead choose to export to the same computer as the SAP HANA server. An ex
port (as well as an import) will fail if the resulting compressed file is larger than 2GB.
The contents of the compressed file are not encrypted, so do not use this option if your local machine is
not secure.
SAP HANA Choose this option to save the export to a directory in the database server's file system.
Server
If you specify a different directory from the default, then:
Amazon S3 Choose this option to export the database objects to an Amazon S3 directory.
You can either provide the filepath manually, or click Edit to formulate a filepath by providing individual
component values. The components vary depending on the source.
Include the file extension .tar.gz or .tgz on <archive_file_name> to export the data to an archive file.
Each file added to the archive file must not exceed 8 GB in size or it will become corrupt. There is no size
restriction on the archive file itself.
Azure Choose this option to export the database objects to an Azure directory.
You can either provide the filepath manually, or click Edit to formulate a filepath by providing individual
component values. The components vary depending on the source.
Include the file extension .tar.gz or .tgz on <archive_file_name> to export the data to an archive file.
Each file added to the archive file must not exceed 8 GB in size or it will become corrupt. There is no size
restriction on the archive file itself.
Include Select this option to export the objects as well as any objects that depend on them. For example,
dependencies if a table has any triggers or indexes associated with it, then their definitions are exported.
Include object data When exporting tables, select this option to export the data, in addition to the definitions.
Replace existing When exporting tables, select this option to replace existing tables with exported tables of the
exported tables same name.
Number of Parallel Increasing the number of threads can speed up the export and affect database performance.
Threads Consider the following guidelines when choosing the number of threads to use:
• For a view or procedure, use two or more threads, up to the number of dependent objects.
• For a whole schema, consider using more than ten threads, up to the number of CPU cores
in the system.
• For an SAP BW or SAP ERP system with tens of thousands of tables, using many threads is
reasonable (up to 256).
• Choose CSV when you are exporting row-store tables or when you must read the contents of
the export.
• Choose Binary to speed up the export time when you are exporting column-store tables.
• Statistics objects
• Statistic object data
4. Click Export.
Results
The catalog objects are exported to the specified location. The length of time that the export process takes
depends on number of objects being exported and the scope of the export.
Monitor the progress of a running export by using the M_EXPORT_BINARY_STATUS monitoring view.
Related Information
Export data from an existing database table or view into a local or external file.
Prerequisites
The file content must follow the data type format supported by SAP HANA as documented in the SAP HANA
SQL Reference Guide for SAP HANA Platform.
Procedure
Results
Prerequisites
You must have the HDI Container Group Administrator permission for at least one container group in the
database.
Context
Preparing the HDI container for Saves the HDI container contents to a staging table. This staging table
download is created in your default schema.
Downloading the HDI container as a Downloads the contents of the staging table to your local machine as a
file tar.gz file.
Procedure
Staging tables are saved in your database and are named according to the
format: .SAP.HRTT.ExportHDI.<timestamp>.
a. Right-click the "Prepare HDI Container" background activity and click Delete.
b. Select whether to delete just the background activity, or the background activity and the staging table.
Keeping the staging table allows you to reuse it for future imports using the SQL console.
Results
Your HDI container has been successfully downloaded to your computer's default download folder
Learn how to remove data from tables in your instances using SAP HANA database explorer.
Prerequisites
You must be a user of the database that you want to explore and have the required privileges to view the
catalog items. In order to complete certain operations, you may need to be the owner of the table.
Context
There are three main methods used to remove data from tables. Depending on your needs and the setup of
your instance, you can choose between dropping, deleting, or truncating data from your table.
Procedure
Option Description
Drop the table if no other objects depend on it Completely delete the table, including the following:
• Table structure
• Table contents
• Indexes
• Privileges
Drop the table and any other objects that depend on it Completely delete the table and all of its dependent ob
jects, including the following:
• Table structure
• Table contents
• Indexes
• Privileges
Delete all rows from the table Delete only the content of the table.
Truncate the table Delete only the content of the table. Data deleted by click
ing Truncate the table is not logged in any way, making it
faster and more resource efficient than clicking Delete all
rows from the table.
Note
The truncate option can only be used if there are no
dependencies on the table's contents.
5. Click Delete.
Related Information
For information about the capabilities available for your license and installation scenario, refer to the Feature
Scope Description for SAP HANA.
Hyperlinks
Some links are classified by an icon and/or a mouseover text. These links provide additional information.
About the icons:
• Links with the icon : You are entering a Web site that is not hosted by SAP. By using such links, you agree (unless expressly stated otherwise in your
agreements with SAP) to this:
• The content of the linked-to site is not SAP documentation. You may not infer any product claims against SAP based on this information.
• SAP does not agree or disagree with the content on the linked-to site, nor does SAP warrant the availability and correctness. SAP shall not be liable for any
damages caused by the use of such content unless damages have been caused by SAP's gross negligence or willful misconduct.
• Links with the icon : You are leaving the documentation for that particular SAP product or service and are entering a SAP-hosted Web site. By using such
links, you agree that (unless expressly stated otherwise in your agreements with SAP) you may not infer any product claims against SAP based on this
information.
Example Code
Any software coding and/or code snippets are examples. They are not for productive use. The example code is only intended to better explain and visualize the syntax
and phrasing rules. SAP does not warrant the correctness and completeness of the example code. SAP shall not be liable for errors or damages caused by the use of
example code unless damages have been caused by SAP's gross negligence or willful misconduct.
Bias-Free Language
SAP supports a culture of diversity and inclusion. Whenever possible, we use unbiased language in our documentation to refer to people of all cultures, ethnicities,
genders, and abilities.
SAP and other SAP products and services mentioned herein as well as
their respective logos are trademarks or registered trademarks of SAP
SE (or an SAP affiliate company) in Germany and other countries. All
other product and service names mentioned are the trademarks of their
respective companies.