Quantcast
Channel: Sybase – Jason L. Froebe – Tech tips and How Tos for Fellow Techies
Viewing all articles
Browse latest Browse all 102

How to Add logins/users to SAP Sybase IQ and copy the password from another system!

$
0
0

You will need to create one or more application groups. In the below example we create the mygroup group:

sp_iqaddlogin "mygroup", null;
GRANT CONNECT TO "mygroup";
GRANT GROUP TO "mygroup";

After that you can create a user:

sp_iqaddlogin "henry", null;
GRANT CONNECT TO "henry" IDENTIFIED BY 'password';

Note that if you are copying a user from one IQ system to another and want to keep the password, this is a simple thing. You just need to grab the password column of sysuser for the user in question:

select password
from sysuser 
where user_name = "henry";
0x0112fd265040a70f82873c922d2aa5d1cbae597ff18217687d3e0ca45b4e246b74198f1713

You will need to escape each byte in order to add the password:

GRANT CONNECT TO "henry" 
IDENTIFIED BY ENCRYPTED 
'\x01\x12\xfd\x26\x50\x40\xa7\x0f\x82\x87\x3c\x92\x2d\x2a\xa5\xd1\xcb\xae\x59\x7f\xf1\x82\x17\x68\x7d\x3e\x0c\xa4\x5b\x4e\x24\x6b\x74\x19\x8f\x17\x13';

Now we need to add henry to the mygroup group:

GRANT MEMBERSHIP 
IN GROUP "mygroup" to 'henry';

Any and all object permissions should be granted to the group not the user.


Viewing all articles
Browse latest Browse all 102