2

all! I have a db with tables User and Group, which represent entities in some application. But at the same time there are database users and database groups with the same names. I need to anonymize the database. It's easy to change db tables, e.g. update User set "Name" = "John",... where Id = 100500

But what to do with db users and db groups?

My first thought was to drop user and that create a new one:

drop user John;
create user njoh identified by 'pswd' login policy "root";

But belonging to groups is lost in the approach.

Is there any kind of rename method for db users in Sybase Anywhere 11?

Also I don't know how to change last log-in time and comments for a db user. The same problem with groups. I didn't try to 'drop groups', 'cause I don't know if there is a possibility in Sybase Anywhere 11.

Could anyone tell me the truth - does the problem have a solution?

Illia Levandovskyi
  • 1,228
  • 1
  • 11
  • 20

1 Answers1

2

No, there is no way to rename an existing user. You can certainly drop it and create a new user but like you said, any group memberships are lost, as are permissions granted on objects like tables and procedures.

The only way to change the last login time for a user is by logging in. You can change the comment on a user by using comment on user is '<string>'.

There is no drop group statement - a group in SQL Anywhere (versions 12 and older) is simply a user with "group authority", so to drop a group you would use revoke connect from <group name>.

Disclaimer: I work for SAP in SQL Anywhere engineering.

Graeme Perrow
  • 56,086
  • 21
  • 82
  • 121
  • Thanks for the answer. My current solution is: 1. to save data from sys views sysuserperms and sysgroups in tmp tables; 2. to drop users I need to delete, and revoke connect from groups I need to delete; 3. create groups were deleted with new names, create users were deleted with new names, grant membership in groups for users and restore other properties from with data from tmp tables. – Illia Levandovskyi Jul 08 '14 at 10:09
  • ATM, The problem is that some user initially was in a few groups. And now Sybase shows an error: "User already has membership in group ". May it be caused by the fact I use 'execute immediate' for a string, which contains a few commands 'grant membership to group...' for the same user? – Illia Levandovskyi Jul 08 '14 at 10:13