Skip to Content
0

HANA Procedure to create DB User with multible privileges

Jun 28, 2017 at 03:02 PM

54

avatar image

Hi @all,

I'd like to build an procedure for my HANA DB to create easily users and roles with a lot of privileges. But I will fail by defining local or procedure variables for alter and create statements...

Could anyone give me an example?

Also I'm not able to Export designed roles... is this by design not possible?

What I need is:

variable a password
variable b username

CREATE USER username PASSWORD password;
ALTER USER username DISABLE PASSWORD LIFETIME;
GRANT MONITORING TO username;
call _SYS_REPO.GRANT_ACTIVATED_ROLE ('sap.hana.im.dp.monitor.roles::Monitoring','username');
call _SYS_REPO.GRANT_ACTIVATED_ROLE ('sap.hana.im.dp.monitor.roles::Operations','username');
etc pp

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

1 Answer

Lars Breddemann
Jul 03, 2017 at 05:02 AM
0

In order to make roles more manageable (i.e. to be able to transport them), please use the design-time objects (.hdbrole) to specify the role and the privileges assigned to it.

Also, check the Developer Guide documentation on details for that.

Share
10 |10000 characters needed characters left characters exceeded