Skip to Content
Technical Articles
Author's profile photo Volker Saggau

HANA Cloud deployment with several databases

Problem:

If you have more that one HANA Cloud server in your account, you have to tell the system which database you want to choose for your work.

Solution: 

You need to modify your mta.yaml file like this:

You need to add in a default scenario:

  • resources:
  •    parameters:
  •       service-name: <my-service-name>
  •       config:
  •            database_id: <database_id>

 

-> service-name is the name you want your serve to have at the end

Not setting the service name leads (default) to a generated name by the system. This is perfectly fine.

This sample of a service starts with “FridayXXX”. So now you are responsible for the service name.  Obviously this improves the readability.

Listing your services in cloud foundry admin you will find your service back by it’s name

HDI%20service%20with%20name%20Friday_XXX

HDI service with name FridayXXX

 

-> database_id: is the id of your SAP HANA Cloud database in Cloud Foundry. You can find the database_id at various places in your cloud foundry environment. Please do not mix up with instance_id.

Not qualifying the database_id will default into the default database of your cf space. Typical this is the first database you have created.

Summary:

With a few additions to your mta.yaml file you get more control on the deployment behaviour.

As general remarks:

  • One has to respect whitespace in yaml files.
  • The defaults are good for beginner with only on database that just want to start working.

 

Assigned Tags

      4 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Michael Cocquerel
      Michael Cocquerel

      Could you confirm there is one default database by cloud foundry space meaning if our databases are in separated spaces, there is no need to provide database_id ?
      Could you also confirm we can provide database_id via an mta extension file at deployment time meaning there is no need to create specific mtar for each database ?

      Author's profile photo Volker Saggau
      Volker Saggau
      Blog Post Author

      Could you confirm there is one default database by cloud foundry space meaning if our databases are in separated spaces, there is no need to provide database_id ?

      Yes.

      Could you also confirm we can provide database_id via an mta extension file at deployment time meaning there is no need to create specific mtar for each database ?

      Yes.

      Author's profile photo Diego Ismael Ibarra
      Diego Ismael Ibarra

      Hello Volker,

      We are setting up our Transport management strategy:

      On one hand we have our DEV subaccount --> DEV space --> and finally our DEV HANA cloud DB.

      On the other hand we have a TEST subaccount --> TEST space --> and a TEST HANA cloud DB.

      We've set up our CI/CD integrated to our ChaRM and cTMS.

       

      Now, suppose we try to transport an MTA file (it's a CAP project) containing HANA tables from DEV to TEST.: How can we tell the transport tool which DB the transport should be targeted?

      If we identify our target DB by using the ID in dev, it is expected that the DB ID in test be different. on the other hand if we try to identify our DB by Name we can´t use different names (in our case DEV an TEST) because the transport will try (I assume) to find the same DB name on the transport target environment.

       

      Kind Regards

      Diego

      Author's profile photo Volker Saggau
      Volker Saggau
      Blog Post Author

      Hi Diego,

      you would specify different cf deploy commands for the various target landscapes. With the help of  so called MTA Deployment Extensions you can express the differences of the various landscapes as for example DATABASE_ID.

      The MTA Deployment Extension Descriptor | SAP Help Portal

      Sample: cf deploy target/<MTA_archive>.mtar -e myMTADeployExtension.mtaext

      HTH

      Volker