How to get all the tables on which a particular user has access-DB2

主宰稳场 提交于 2019-12-11 23:33:09

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!