cancel
Showing results for 
Search instead for 
Did you mean: 

Mass user creation at HANA

Former Member
0 Kudos

Hi

we need to create mass user creation in hana.


we have user A as template. and need to create more number of users(say 40users) at once.

hope this can be done in SQL command right?
do we have option to copy the roles and user info from User A to User B,C,D etc

for eg, for one user and one role below is ok.
but for many user and many roles to be added. how to achieve this.

CREATE USER my_user PASSWORD My_Password;
GRANT MODELING TO my_user;


Regards

Chandra

Accepted Solutions (0)

Answers (3)

Answers (3)

Bruhn
Explorer
0 Kudos

Hi All,

Besides scripting you could invoke an ABAP for the same(actually you don't state which HANA constellation you are using - so I don't know if you have this option). I have used the following ABAP template for creating initial users - however not as a mass execution - you will have to amend the logic (include a loop) inorder for that to take place and preferably some input parameters will be required ;-).

REPORT ZHANA_CREATEUSER.

data : err TYPE REF TO cx_sql_exception,

       lv_sql type string.

  lv_sql = |CREATE USER XYZ PASSWORD SuperDuper123|.

  TRY.

      NEW cl_sql_statement( )->execute_query( lv_sql ).

    CATCH cx_sql_exception INTO err.

      MESSAGE err TYPE 'I' DISPLAY LIKE 'E'.

  ENDTRY.

COMMIT WORK.

Obviously you can amend the logic even further to grant access and more.

/MiB

Former Member
0 Kudos

Hi Chandra,

You can not add multiple roles to multiple users in a single go. However you can

1. create few control tables having UserIDs, groups, roles, authorisations etc

2. Create a stored procedure that read all these control table and create/update/delete the Users/auth etc automatically.

You just need to have a Security admin who maintains these tables and execute the stored procedure. Creating a user maintenance table in ECC and SLTing is not a bad idea though.

/bikas

justin_molenaur2
Contributor
0 Kudos

Hi guys, I know this is a SUPER old post, but just wanted to inform for anyone who searches for a solution might find one.

I just tossed a quick blog together over here

http://scn.sap.com/community/hana-in-memory/blog/2015/02/26/how-toperform-mass-user-creation-role-as...

Happy HANA,

Justin

lbreddemann
Active Contributor
0 Kudos

Hello Chandra,

just like in most other DBMS, there is no mass user management available for HANA out of the box.

But you can easily implement the same solution as you would do with other databases:

write a stored procedure that would create the users and grant the desired roles in a loop.

regards,

Lars