Skip to Content
0

Import Delivery Unit using a SQL script

Mar 11, 2017 at 08:04 AM

399

avatar image

Is there a way to export and import Delivery Units using a short SQL script? I am working mostly in HANA Studio, and I can export and import using ALM (Application Lifecycle Management). However is there an easier why to automate the export from a development system and import into a test system without all the manual steps.

At this time we do not have a transport management solution setup.

Thanks, Andy

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Best Answer
Antonio Almeida Nunes Mar 11, 2017 at 06:03 PM
1

Hi,

To create such a script you could use the HANA client command hdbalm. When you run it for the first time without specifying any argument on the command line you might get a message to set an environment variable:

"The environment variable PYTHON_HOME is not set! The hdbalm program requires a python version[...]"

To import a DU called MYDU (compressed in a ZIP format) in a HANA DB running on a hostname called MYHOST you can run the following command:

hdbalm -h MYHOST -p 8011 -u MYUSER install MYDU.zip

Note: the port number is the same used when calling HANA Cockpit in the format 80<Instance Number>

hdbalm has many interesting options extending the possibilities we have available from the studio. We have the install option as shown above to import DUs we get from SAP Marketplace but also an import option we could use for our own DUs (in tgz fomat).

The password for the user specifyed in the command line will be prompted but there are a way to not have any prompt which is important when we create a script.

Help on how to use HDBALM:

http://help-legacy.sap.com/saphelp_hanaplatform/helpdata/en/37/be2f0d13e343ef8a3d3998361ea883/content.htm

Hope it gives you enough and usefull hints on the subject. I've used this command for a couple of times to either install files I got from SAP (HANA Live) and also Delivery Units I got manually from other systems in my landscape.

Best Regards

A.Nunes

Share
10 |10000 characters needed characters left characters exceeded
Florian Pfeffer
Mar 11, 2017 at 09:22 AM
1

No, not with SQLScript.

But there exists already tools which allow you to export and import DUs. To package and export a DU the "regi" tool can be used. For the import the "hdbalm" tool can be used.

Details can be found in the tutorial: Continuous Integration (CI) Best Practices with SAP: SAP HANA Extended Application Services (XS), classic model

Consider that the tutorial describes a full setup of a CI infrastructure for a HANA XS project. Also in case you do not wanna set it up in that way, you can extract the information how to use the existing tools manually.

Regards,
Florian

Share
10 |10000 characters needed characters left characters exceeded
Andrew Frigaard Mar 12, 2017 at 01:43 AM
0

Thanks, Antonio and Florian. Both great answers and that Continuous Integration looks very interesting although we are not working that way currently. It looks like HDBALM will do most of what I need. We dont have the HANA client installed on workstations, only HANA Studio, so I'll get it installed and explore further,

Thanks, Andy

Share
10 |10000 characters needed characters left characters exceeded