Db2 Reports Error " *RATE_DDL;;SQL0551 Reason code or token: ...,BIND,NULLID.DB2L"
Problem
When you extract metadata from a Db2 database, the database reports the following error:
DB2 SQL Error: SQLCODE=-443, SQLSTATE=38553, SQLERRMC=*RATE_DDL;;SQL0551 Reason code or token: USER_NAME_HERE,BIND,NULLID.DB2L, DRIVER=4.33.31
Additional information
The issue is caused by missing BIND privilege for the user used for the extraction. This Db2 diag log entry suggests the issue is with bind on package (ID not having necessary authority):
2025-03-23-19.23.28.017699+000 E127407E675 LEVEL: Warning
PID : 1674401 TID : 140121060740688 PROC : db2fmp
INSTANCE: db2inst1 NODE : 000 DB : MYDB
APPID : 172.30.144.142.45426.250230091802
HOSTNAME: dashmpp-head-0
FUNCTION: DB2 UDB, routine_infrastructure, sqlerFencedTruncateTokensUserSqlState, probe:100
DATA #1 : signed integer, 4 bytes
-443
DATA #2 : String with size, 5 bytes
38553
DATA #3 : String with size, 26 bytes
SYSPROC.DB2LK_GENERATE_DDL
DATA #4 : String with size, 18 bytes
DB2LK_GENERATE_DDL
DATA #5 : String with size, 69 bytes
SQL0551 Reason code or token: USER_NAME_HERE,BIND,NULLID.DB2LKSP
Solution
Grant the user BIND privilege on nullid.db2lksp package using:
GRANT bind ON PACKAGE nullid.db2lksp TO USER "USER_NAME_HERE";
as per Db2 Integration Requirements.