Skip to Content
avatar image
Former Member

HANA Procedure to create DB User with multible privileges

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Jul 03, 2017 at 05:02 AM

    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.

    Add comment
    10|10000 characters needed characters exceeded