问题
I need to know all the tables on which particular user let's say 'Abc' has any(read, write) kind of access.
Is this possible in db2?
回答1:
Try the SYSIBMADM.PRIVILEGES
administrative view. You can find more about it in the DB2 Knowledge Center:
SELECT AUTHID, PRIVILEGE, OBJECTNAME, OBJECTSCHEMA
FROM SYSIBMADM.PRIVILEGES WHERE OBJECTTYPE='TABLE' AND AUTHID='userID'
回答2:
Please use below to get list of of users, corresponding table and type of access(delete, modify, update, select etc),
SELECT GRANTEE,TTNAME ,GRANTOR , DATEGRANTED ,GRANTEETYPE , SELECTAUTH ,ALTERAUTH , DELETEAUTH , INDEXAUTH , INSERTAUTH ,DBNAME , SCREATOR , STNAME ,
TCREATOR , AUTHHOWGOT , TIMESTAMP , TIMEGRANTED
, UPDATECOLS ,
UPDATEAUTH , IBMREQD , GRANTEELOCATION , LOCATION ,
"COLLID" , CONTOKEN , CAPTUREAUTH , REFERENCESAUTH , REFCOLS ,
GRANTEDTS , TRIGGERAUTH , GRANTORTYPE
FROM "SYSIBM".SYSTABAUTH
WHERE ( GRANTOR like '%'
AND GRANTEE like '%' ) ;
来源:https://stackoverflow.com/questions/35602513/how-to-get-all-the-tables-on-which-a-particular-user-has-access-db2