cancel
Showing results for 
Search instead for 
Did you mean: 

HANA Procedure to create DB User with multible privileges

0 Kudos

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

Accepted Solutions (0)

Answers (1)

Answers (1)

lbreddemann
Active Contributor
0 Kudos

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.