Technical Articles
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 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.
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 ?
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.
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
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
Hello Volker,
you said "Not qualifying the database_id will default into the default database of your cf space. Typical this is the first database you have created."
How to see and change the default database for a cf space ?
Regards,
Michael
Hi Michael,
This is currently internal information of the HANA Service Broker. It’s not exposed to customers.
We have a backlog item to expose the default database via HANA Cloud Central. No time lines yet.
If you have ONLY ONE "HANA service" than this is the default one.
If you have ONLY ONE "share instance" than this is the default as well
BR
Volker
Hi Volker,
Thanks for your answer.
Waiting for the possibility to manage the default database via HANA Cloud, if we several HANA Cloud instances mapped to the same CF space and we would need to change the default database, we have to open a service request to SAP Support to do it ?
Regards,
Michael
Hi Volker,
in fact, I have the feeling there is no default database defined because, if I do not specify any database_id into the mta.yaml file, I'm getting the following error when deploying:
Could not create the entity since Service broker error: Service broker hana-broker failed with: Failed to select a database for instance ZF6D0_WORK_ORDER_EVENTS_DATArf7sG1twvdSuXMrOhwk6A, because of: Multiple databases are available, exact id needs to be specified via parameter 'database_id' (available ids: [c5b88acf-2738-48a0-b752-fbfd5a1e050e, d60c3cd6-d39a-41fb-9dab-67fd4dde11fc]), consider deleting it using the 'cf delete-service ZF6D0_WORK_ORDER_EVENTS_DATArf7sG1twvdSuXMrOhwk6A command'."