How to Import & Export Data from HANA Studio Tutorial

โšก Smart Summary

Import and Export options in SAP HANA Studio move tables, information views, landscapes and complete delivery units between systems, so developers can promote content from a development server to quality assurance and production.

  • ๐Ÿ”˜ Entry point: Both actions start from the File menu of SAP HANA Studio and open a wizard with the same two option families.
  • โ˜‘๏ธ Catalog versus content: Catalog objects cover tables, views and procedures, while content covers repository packages and delivery units.
  • โœ… Delivery unit: A delivery unit bundles every package mapped to it, so one archive carries a complete release.
  • ๐Ÿงช Developer mode: Developer mode exports or imports individual objects to a folder on the local client machine.
  • ๐Ÿ› ๏ธ SQL alternative: The EXPORT and IMPORT statements perform the same work from any SQL console and support binary or CSV format.
  • ๐Ÿ” Authorisation: The EXPORT and IMPORT system privileges, plus SELECT or INSERT on the objects, are required before either action succeeds.

Import and export options in SAP HANA Studio

The Import and Export options of SAP HANA provide features that move tables, information views and a complete landscape to another system, or to a different location on the same system.

Both actions are started from the File menu of SAP HANA Studio, and the wizard that opens groups every object type into the same two families: SAP HANA, which covers catalog and landscape objects, and SAP HANA Content, which covers repository packages and delivery units. The two sections below walk through each direction in turn.

How to Export Data From SAP HANA?

STEP 1) Go to the File menu and choose Export.

The File menu of SAP HANA Studio lists Export directly under the Import entry, as the screenshot shows.

SAP HANA Studio File menu with the Export option highlighted

A pop-up for Export is then displayed.

Two families of Export options for SAP HANA objects are offered, and each family holds its own set of wizards.

SAP HANA

  • Catalog Objects: Used to export catalog objects such as a table, a view or a procedure.
  • Landscape: Used to export a landscape from one system to another.

SAP HANA Content

  • Change and Transport System (CTS): Used to export an information view through an ABAP program.
  • Delivery Unit: A delivery unit is a single unit. This option is used to export multiple packages that are mapped to one delivery unit.
  • Developer Mode: This option can be used to export individual objects to a location in the local system.
  • SAP Support Mode: This can be used to export the objects together with their data for SAP support purposes.

The Export wizard presents both families in a single selection tree, as shown below.

Export wizard in SAP HANA Studio listing SAP HANA and SAP HANA Content export options

After an option is selected, the wizard asks for the objects to be exported and for the target location, which can be a folder on the SAP HANA server or a folder on the local client. Content produced by SAP HANA modeling, such as an attribute view or a calculation view, always travels as content rather than as a catalog object.

How to Import Data From SAP HANA?

Import reverses the process and reads an archive, a local file or a source system into the target database.

STEP 1) Go to the File menu and choose Import.

The same File menu carries the Import entry, as the next screenshot shows.

SAP HANA Studio File menu with the Import option selected

A pop-up for the Import option is then displayed.

Two families of Import options for SAP HANA objects are offered, and the content family carries several more entries than its export counterpart.

SAP HANA

  • Catalog Objects: Used to import catalog objects such as a table, a view or a procedure.
  • ESRI Shape Files: Environmental Systems Research Institute, Inc. (ESRI) shapefile format is used to store geometry data and attribute information for the spatial features in a data set.
  • Landscape: Used to import a landscape from one system to another.

SAP HANA Content

  • Data From Local File: Used to import data from a .csv, .xls or .xlsx file into a table.
  • Delivery Unit: A delivery unit is a single unit. This option is used to import multiple packages that are mapped to one delivery unit.
  • Developer Mode: This option can be used to import individual objects from a location in the local system.
  • Mass Import of Metadata: This can be used to import the metadata of many objects at once.
  • SAP NetWeaver BW Models: This can be used to import BW models into SAP HANA.
  • Selective Import of Metadata: This can be used to import the metadata of single objects into SAP HANA.

The Import wizard lists all of these entries in one tree, as the screenshot below shows.

Import wizard in SAP HANA Studio showing catalog, content and metadata import options

Export and Import Data Using SQL Statements in SAP HANA

The Studio wizards are convenient for a single transport, but a repeatable migration is easier to run from a SQL console. The SAP HANA SQL engine exposes the same catalog behaviour through the EXPORT and IMPORT statements, which can be scheduled, scripted and kept under version control.

The documented form of both statements places the object list first and the storage path after the format keyword.

-- Statement forms published in the SQL reference
EXPORT <object_name_list> AS <format> INTO <path> [WITH <options>]
IMPORT <object_name_list> [AS <format>] FROM <path> [WITH <options>]

-- Export two tables of schema DHK_SCHEMA in CSV format
EXPORT "DHK_SCHEMA"."PRODUCT", "DHK_SCHEMA"."PURCHASE_ORDER"
    AS CSV INTO '/usr/sap/HDB/HDB00/work/export' WITH REPLACE THREADS 4;

-- Export every object of one schema in binary format
EXPORT "DHK_SCHEMA"."*" AS BINARY INTO '/usr/sap/HDB/HDB00/work/export';

-- Import the objects again and rename the target schema
IMPORT "DHK_SCHEMA"."*" FROM '/usr/sap/HDB/HDB00/work/export'
    WITH REPLACE RENAME SCHEMA "DHK_SCHEMA" TO "DHK_TEST";

Two export formats are available, and the choice affects both speed and portability.

Aspect BINARY CSV
Supported store Column store tables, procedures and sequences Column store and row store tables
Readable outside SAP HANA No, the files are internal Yes, any text editor or loader can read them
Import behaviour Existing table data is overwritten Rows are appended unless REPLACE is used
Typical use System to system copies on the same release Hand-over to another database or to an analyst

Useful options on the statements include REPLACE to overwrite an existing target, CATALOG ONLY to move definitions without rows, DATA ONLY to move rows into an existing definition, THREADS to raise parallelism, and RENAME SCHEMA to land the objects in a different schema. The full option list is published in the SAP HANA SQL reference guide.

Privileges Required for Import and Export in SAP HANA

An export or import that fails immediately with the message insufficient privilege: Not authorized is almost always an authorisation problem rather than a syntax problem, so the required grants are worth checking first.

  • EXPORT system privilege: Required before any catalog export runs, and granted separately from object access.
  • IMPORT system privilege: Required before any catalog import runs.
  • SELECT on the source objects: Needed in addition to EXPORT, because the statement reads the rows that it writes out.
  • INSERT on the target objects: Needed in addition to IMPORT, because the statement writes rows into the target table.
  • Package privileges: Needed for a delivery unit or developer mode transport, since those objects live in the repository rather than in a schema.

The delivered CONTENT_ADMIN role already carries EXPORT and IMPORT, which is why administrators often reach for it during a one-off transport. A dedicated role is safer for day-to-day work, and the same reasoning applies to every other grant discussed in SAP HANA security. Where an exported view also carries row-level restrictions, the target system needs matching analytic privileges before users see any data.

Import and Export in SAP HANA Cloud and the Database Explorer

SAP HANA Studio is an on-premise Eclipse client, and it is not the tool used with SAP HANA Cloud. The equivalent work there is done in the SAP HANA database explorer, which is opened from SAP HANA Cloud Central or from SAP Business Application Studio.

  • Data export and import: Works with the contents of one table or view at a time.
  • Catalog export and import: Works with several objects at once, can include functions and procedures, and includes the SQL needed to recreate each object.
  • Cloud storage: Export and import can address Amazon S3, Azure Blob storage or Google Cloud Storage instead of a file system on the database host.
  • Repository content: Delivery units belong to the classic repository, which was deprecated with SAP HANA 2.0 SPS 02, so cloud projects are transported as multi-target application archives built in SAP Business Application Studio instead.

The EXPORT and IMPORT statements themselves remain available in SAP HANA Cloud, so a script written against an on-premise system usually needs a new storage path and a credential object rather than a rewrite. A step-by-step walkthrough of the cloud tooling is published in the SAP developer tutorial on the database explorer.

FAQs

SAP HANA Studio writes the delivery unit as a compressed archive with the .tgz extension. The archive holds every package mapped to that delivery unit, so one file can be moved to the target system and imported in a single step.

Developer Mode suits a quick hand-over of a few individual views or packages to a local folder. Delivery Unit export suits a release transport, because it carries every package assigned to the unit together with its version information.

Catalog transports copy runtime database objects โ€” tables, views, procedures and their rows. Content transports copy design-time repository artefacts such as packages and information views. Catalog objects land inside a schema, while content lands inside a package.

An export reads a consistent snapshot, so writers are not blocked by locks. A large export still consumes processor time, memory and disk throughput on the server, so run bulk exports outside peak hours and control parallelism with the THREADS option.

Machine learning models profile source data before an import, flagging column type mismatches, duplicate keys and outlier values, and predicting which loads will fail. Anomaly detection on load statistics also highlights a run that moved far fewer rows than expected.

Yes. Assistants such as GitHub Copilot draft the statement, its option list and a shell wrapper from a comment. Always review the storage path, schema names and REPLACE option, because REPLACE overwrites existing table data.

Yes. In SAP HANA Cloud the export statement accepts an object store path for Amazon S3, Azure Blob storage or Google Cloud Storage, with the access keys supplied through a credential object, so no file system on the database host is needed.

Yes. The import statement accepts WITH RENAME SCHEMA, which maps the exported schema name onto a new target schema. Combine it with CATALOG ONLY or DATA ONLY when only the definitions, or only the rows, should be loaded.

Summarize this post with: