Posts

Showing posts from July, 2023

DB2: See privileges for procedures

  select substr(t1.schema,1,5) as schema     , substr(t2.routinename,1,30) as unqualname     , substr(t1.specificname,1,30) as qualname     , substr(t1.grantee,1,20) as who     , t1.granteetype as type from syscat.routineauth as t1 inner join syscat.routines as t2     on t1.specificname = t2.specificname where t1.schema = 'WCS'     and t1.routinetype = 'P' order by unqualname with ur

DB2: Checking the privileges, authorities and authorizations

  system catalog     description SYSCAT.DBAUTH Lists the database privileges SYSCAT.TABAUTH  Lists the table and view privileges SYSCAT.COLAUTH Lists the column privileges SYSCAT.PACKAGEAUTH Lists the package privileges SYSCAT.INDEXAUTH  Lists the index privileges SYSCAT.SCHEMAAUTH Lists the schema privileges SYSCAT.PASSTHRUAUTH  Lists the server privileges SYSCAT.ROUTINEAUTH Lists the routine (functions, methods, and stored procedures) privileges

DB2: Grant on procedure

(1) see what role the user is in select substr(rolename,1,18) as rolename, substr(grantee,1,18) as grantee from syscat.roleauth order by rolename, grantee with ur; (2) run the GRANT grant execute on procedure WCS.TMW_PUBLISH_UNPUBLISH_CATENTRY to  role uc4; (3) what procedures are on the database select procname from syscat.procedures where procschema='WCS' and procname like 'TMW%'; (4) to see the privilege select * from SYSCAT.ROUTINEAUTH where schema='WCS';