Query to check users and authorities for database
With this query, you can verify how user have which authorities on a database :
db2 "select char(grantee,8) as grantee, char(granteetype,1) as type, \
char(dbadmauth,1) as dbadm, char(createtabauth,1) as createtab, \
char(bindaddauth,1) as bindadd, char(connectauth,1) as connect, \
char(nofenceauth,1) as nofence, char(implschemaauth,1) as implschema, \
char(loadauth,1) as load, char(externalroutineauth,1) as extroutine, \
char(quiesceconnectauth,1) as quiesceconn, \
char(libraryadmauth,1) as libadm, char(securityadmauth,1) \
as securityadm from syscat.dbauth order by grantee"
The results will be something like that :
GRANTEE TYPE DBADM REATETAB BINDADD CONNECT NOFENCE IMPLSCHEMA LOAD
-------- ---- ----- -------- ------- ------- ------- ---------- ---- ---------- ----------- ------ -----------
IFRANCO U Y Y Y Y Y Y Y Y Y N N Y
PUBLIC G N Y Y Y N Y N N N N N N
DBUSER G N N Y Y N Y Y Y Y Y Y Y
Query to check what users have selectauth in a specific table
db2 "select substr(grantor,1,20), substr(grantee,1,20), selectauth from syscat.tabauth where tabname='<tabname>'"