Thursday, 9 November 2023

Easy way to provide schema access to a BTP HANA Cloud Standard User

Problem


While working with the CAP applications, I have came across a situation that a standard HANA cloud user used in CPI cannot perform direct CRUD operations on the tables via the JDBC driver. The CPI will throw the error: insufficient privileges.  So, I am writing the blogpost for reference purpose.

Solution


Please follow the below mentioned steps:

1. Open the SQL Console of the BTP HANA Cloud by selecting the DBADMIN node.

Easy way to provide schema access to a BTP HANA Cloud Standard User

2. Create the User group:

CREATE USERGROUP USERGROUP_NAME

Easy way to provide schema access to a BTP HANA Cloud Standard User

3. Creating the User & assigning it to the group: USER_01

CREATE USER USER_01 PASSWORD Password1111 NO FORCE_FIRST_PASSWORD_CHANGE SET USERGROUP USERGROUP_NAME

4. Grant the User: USER_01 operator of the group: USERGROUP_NAME

GRANT USERGROUP OPERATOR ON USERGROUP USERGROUP_NAME TO USER_01

Easy way to provide schema access to a BTP HANA Cloud Standard User

5. If there is already a user present then please ignore the above steps.

6. Now, its time to check the SCHEMA_OWNER.

i. Get the SCHEMA name. Add the instance by selecting Instance Type: HDI Container.

Easy way to provide schema access to a BTP HANA Cloud Standard User

ii. Expand & click on the Tables. Select any table & then double click to open. You will get the SCHEMA name.

Easy way to provide schema access to a BTP HANA Cloud Standard User

7. Go to the SAP HANA Cockpit.

Easy way to provide schema access to a BTP HANA Cloud Standard User

8. Click on the drop down list & select Security and User Management.

Easy way to provide schema access to a BTP HANA Cloud Standard User

9. Under the User & Role Management tile, select the Role Assignment option.

Easy way to provide schema access to a BTP HANA Cloud Standard User

10. Select Assign roles to a user. Enter the user.

Easy way to provide schema access to a BTP HANA Cloud Standard User

11. Click on the EDIT button & add the roles by providing the SCHEMA name.

Easy way to provide schema access to a BTP HANA Cloud Standard User

12. Select & add the role you want. Then, save it.

13. Click on the added role to check more details.

i. Object Privilege

Easy way to provide schema access to a BTP HANA Cloud Standard User

ii. Assigned Users

Easy way to provide schema access to a BTP HANA Cloud Standard User

14. Now, the user is having access to the SCHEMA.

15. That’s it.

No comments:

Post a Comment