No Operation is allowed on the table. The error "SQLSTATE = 57016 SQLCODE =-668" is returned. The error code "7": SQL0668N Operation not allowed for reason code "7" on table XXX.
First, check:
Db2? 57016
SQLSTATE 57016: the table cannot be accessed because it is not active.
Solution: Execute the command: reorg table XXX.
Reference Original:
Operation not allowed for reason code reason-code on table-name.
Explanation: access to table-name is restricted. The cause is based on the following reason codes reason-code: 7
The table is in the reorg pending state. This can occur after an alter table statement containing a REORG-recommended operation.7
Reorganize the table using the reorg table command (note that inplace reorg table is not allowed for a table that is in the reorg pending state ).
Where:
Reorg table uses refactored rows to remove "fragment" data and compress information to reorganize the table.
Runstats on table. Collect the statistical information of the table.
Reorgchk on table all determines whether to reorganize the table. It is useful for automatic runstats execution on all tables.
>>> Reorg and runstats are single table optimization and initialization commands:
Runstats on table administrator. test;
Reorg table administrator. test;