SQL0551N error when issuing 'REFRESH TABLE <table name>' command
Troubleshooting
Problem
SQL0551N error can be thrown when issuing 'REFRESH TABLE
' against an MQT table stating that the user does not have the required authorization or privilege to
perform operation "SET CONSTRAINTS" on the object.
Symptom
When issuing 'REFRESH TABLE' command you may get the following:
For example:
db2 "refresh table db2inst1.mqt_t1"
DB21034E The command was processed as an SQL statement because it was not a
valid Command Line Processor command. During SQL processing it returned:
SQL0551N "DB2INST2" does not have the required authorization or privilege to perform operation "SET CONSTRAINTS" on object "DB2INST1.MQT_T1".
If DIAGLEVEL is set to 4, it can be observed that "REFRESH TABLE" command in turn executes "SET CONSTRAINTS" command:
[{"Product":{"code":"SSEPGG","label":"Db2 for Linux, UNIX and Windows"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Component":"Routines (SP & UDF) - SQL","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF010","label":"HP-UX"},{"code":"PF016","label":"Linux"},{"code":"PF027","label":"Solaris"},{"code":"PF033","label":"Windows"}],"Version":"9.8;9.7;10.1;10.5","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}}]