# Revoke all privileges on packages for UID:
db2 "select 'REVOKE ' || strip(strip(case when CONTROLAUTH IN ('Y', 'G') then 'CONTROL, ' else '' end ||case when BINDAUTH IN ('Y', 'G') then 'BIND, ' else '' end ||case when EXECUTEAUTH IN ('Y', 'G') then 'EXECUTE, ' else '' end, trailing, ' '), trailing, ',') || ' ON PACKAGE ' || rtrim(PKGSCHEMA) ||'.' || PKGNAME || ' FROM ' ||case when granteetype = 'U' then 'USER ' else 'GROUP ' end ||rtrim(grantee) || ';' from syscat.PACKAGEAUTH where grantee IN ('DB2PROD')"
TIP: ***
1 revoke bind & execute on package should run AFTER revoke control, or it won't work
2 for system packages you have to use:
revoke execute on specific function xxxx from xxx restrict
3 for error:
SQL0478N DROP, ALTER, TRANSFER OWNERSHIP or REVOKE on object type "PACKAGE"
cannot be processed because there is an object "TAP.SP_HELP", of type
"PROCEDURE", which depends on it. SQLSTATE=42893
you have to drop and re-create it。
***
db2bfd can show the detail of the bind file
Example:
db2bfd -b asnsqlcd.bnd
asnsqlcd.bnd: Header Contents
Header Fields:
Field Value
----- -----
releaseNum 0x800
Endian 0x42
numHvars 9
maxSect 4
numStmt 29
optInternalCnt 4
optCount 9
Name Value
------------------ -----
Isolation Level Uncommitted Read
Creator "NULLID "
App Name "ASNDD9A0"
Timestamp "ASNCOMON:User defined timestamp"
Cnulreqd Yes
Sql Error No package
Validate Bind
Date Default/local
Time Default/local
*** All other options are using default settings as specified by the server ***
also check the info centre:
IBM DB2 9.7 for Linux, UNIX and Windows Information Center