How to create multiple users on SAP HANA using sql

We had to create multiple users on the HANA DB , so we used the following script names create_hana_users.sql

CREATE USER SAPSUPPORT1 PASSWORD ABC123 ;
ALTER USER SAPSUPPORT1 DISABLE PASSWORD LIFETIME;  ( disabling the passwd change )
GRANT MONITORING,USER to SAPSUPPORT1 with ADMIN OPTION ; ( granting roles)
GRANT SAP_INTERNAL_HANA_SUPPORT TO SAPSUPPORT1 WITH ADMIN OPTION;
GRANT CATALOG READ TO SAPSUPPORT1 WITH ADMIN OPTION; ( granting system privilege)
CREATE USER SAPSUPPORT2 PASSWORD ABC123 ;
ALTER USER SAPSUPPORT2 DISABLE PASSWORD LIFETIME;
GRANT MONITORING,USER to SAPSUPPORT2 with ADMIN OPTION ;
GRANT CATALOG READ TO SAPSUPPORT2 WITH ADMIN OPTION;
CREATE USER SAPSUPPORT3 PASSWORD ABC123 ;
ALTER USER SAPSUPPORT3 DISABLE PASSWORD LIFETIME;
GRANT MONITORING,USER to SAPSUPPORT3 with ADMIN OPTION ;
GRANT CATALOG READ TO SAPSUPPORT3 WITH ADMIN OPTION;

and then executed it via hdbsql :

hdbsql -n abc115 -i 00 -u SYSTEM -p password

\o outputfile.txt (incase you need an output to a file)

\i create_hana_users.sql  (input file name )

\o  (closing the output file)

\q  ( quit)

 

 

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: