Skip to Content

Import Delivery Unit using a SQL script

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    Mar 11, 2017 at 06:03 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • Mar 11, 2017 at 09:22 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • Mar 12, 2017 at 01:43 AM

    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

    Add comment
    10|10000 characters needed characters exceeded