1

On Db2 v11.1 Linux I can get the list of groups a user belongs to:

db2 "SELECT * FROM TABLE (SYSPROC.AUTH_LIST_GROUPS_FOR_AUTHID('MYUSER'))"

How to get vice-versa, list of users that belongs to specific group?

Regards

mustaccio
  • 18,234
  • 16
  • 48
  • 57
folow
  • 229
  • 1
  • 5
  • 14

2 Answers2

2

Group membership is managed externally to Db2-server.

Because of that, all the members of a group might not be known to Db2, but Db2 will have a way to test if a specific user is a member of a specific group.

In your case this is either in linux or (if configured) an identity-management toolset/LDAP/Active-Directory etc.

For the simplest case on linux, look in /etc/groups , or use local tooling to list group memberships.

mao
  • 11,321
  • 2
  • 13
  • 29
0

Listing of some particular group members is not implemented in Db2 in the form of a table function like it's done for a list of groups a user belongs to.
You may write the corresponding external C/C++ function, for example. But it might not be so trivial in common case, since it depends on the authentication method used by the instance. That is, you must use the corresponding OS, LDAP (or even some others) API functions depending on the current Db2 instance authentication method used.

Mark Barinstein
  • 11,456
  • 2
  • 8
  • 16